tModLoader  0.12 Alpha
A mod to make and play Terraria mods
Terraria.ModLoader.NPCSpawnInfo Struct Reference

A struct that stores information regarding where an NPC is naturally spawning and the player it is spawning around. This serves to reduce the parameter count for ModNPC.CanSpawn and GlobalNPC.EditSpawnPool. More...

Public Attributes

bool desertCave
 Whether or not the player is in front of a desert wall or the NPC will spawn near one. More...
 
bool granite
 Whether or not the NPC will spawn on a granite block or the player is near a granite biome. More...
 
bool invasion
 Whether or not there is an invasion going on and the player is near it. More...
 
bool lihzahrd
 Whether or not the player is inside the jungle temple, where Lihzahrds spawn. More...
 
bool marble
 Whether or not the NPC will spawn on a marble block or the player is near a marble biome. More...
 
bool planteraDefeated
 Whether Plantera is defeated and the world is in hardmode. This isn't needed (it's easy to find by yourself), but it's a local flag in NPC.SpawnNPC, so it is included for completeness. More...
 
Player player
 The player that this NPC is spawning around. For convenience, here are the player zones, which are also useful for determining NPC spawn:

  • ZoneDungeon
  • ZoneCorrupt
  • ZoneHoly
  • ZoneMeteor
  • ZoneJungle
  • ZoneSnow
  • ZoneCrimson
  • ZoneWaterCandle
  • ZonePeaceCandle
  • ZoneTowerSolar
  • ZoneTowerVortex
  • ZoneTowerNebula
  • ZoneTowerStardust
  • ZoneDesert
  • ZoneGlowshroom
  • ZoneUndergroundDesert
  • ZoneSkyHeight
  • ZoneOverworldHeight
  • ZoneDirtLayerHeight
  • ZoneRockLayerHeight
  • ZoneUnderworldHeight
  • ZoneBeach
  • ZoneRain
  • ZoneSandstorm
More...
 
int playerFloorX
 The x-coordinate of the tile the player is standing on. More...
 
int playerFloorY
 The y-coordinate of the tile the player is standing on. More...
 
bool playerInTown
 Whether or not the player is in a town. This is used for spawning critters instead of monsters. More...
 
bool playerSafe
 Whether or not the player is in front of a player-placed wall or in a large town. If this is true, enemies that can attack through walls should not spawn (unless an invasion is in progress). More...
 
bool safeRangeX
 Whether or not the NPC is horizontally within the range near the player in which NPCs cannot spawn. If this is true, it also means that it is vertically outside of the range near the player in which NPCs cannot spawn. More...
 
bool sky
 Whether or not the player is in the sky biome, where harpies and wyverns spawn. More...
 
int spawnTileType
 
int spawnTileX
 The x-coordinate of the tile the NPC will spawn above. More...
 
int spawnTileY
 The y-coordinate of the tile the NPC will spawn above. More...
 
bool spiderCave
 Whether or not the player is in a spider cave or the NPC will spawn near one. More...
 
bool water
 Whether or not the tile the NPC will spawn in contains water. More...
 

Detailed Description

A struct that stores information regarding where an NPC is naturally spawning and the player it is spawning around. This serves to reduce the parameter count for ModNPC.CanSpawn and GlobalNPC.EditSpawnPool.

Member Data Documentation

◆ desertCave

bool Terraria.ModLoader.NPCSpawnInfo.desertCave

Whether or not the player is in front of a desert wall or the NPC will spawn near one.

◆ granite

bool Terraria.ModLoader.NPCSpawnInfo.granite

Whether or not the NPC will spawn on a granite block or the player is near a granite biome.

◆ invasion

bool Terraria.ModLoader.NPCSpawnInfo.invasion

Whether or not there is an invasion going on and the player is near it.

◆ lihzahrd

bool Terraria.ModLoader.NPCSpawnInfo.lihzahrd

Whether or not the player is inside the jungle temple, where Lihzahrds spawn.

◆ marble

bool Terraria.ModLoader.NPCSpawnInfo.marble

Whether or not the NPC will spawn on a marble block or the player is near a marble biome.

◆ planteraDefeated

bool Terraria.ModLoader.NPCSpawnInfo.planteraDefeated

Whether Plantera is defeated and the world is in hardmode. This isn't needed (it's easy to find by yourself), but it's a local flag in NPC.SpawnNPC, so it is included for completeness.

◆ player

Player Terraria.ModLoader.NPCSpawnInfo.player

The player that this NPC is spawning around. For convenience, here are the player zones, which are also useful for determining NPC spawn:

  • ZoneDungeon
  • ZoneCorrupt
  • ZoneHoly
  • ZoneMeteor
  • ZoneJungle
  • ZoneSnow
  • ZoneCrimson
  • ZoneWaterCandle
  • ZonePeaceCandle
  • ZoneTowerSolar
  • ZoneTowerVortex
  • ZoneTowerNebula
  • ZoneTowerStardust
  • ZoneDesert
  • ZoneGlowshroom
  • ZoneUndergroundDesert
  • ZoneSkyHeight
  • ZoneOverworldHeight
  • ZoneDirtLayerHeight
  • ZoneRockLayerHeight
  • ZoneUnderworldHeight
  • ZoneBeach
  • ZoneRain
  • ZoneSandstorm

◆ playerFloorX

int Terraria.ModLoader.NPCSpawnInfo.playerFloorX

The x-coordinate of the tile the player is standing on.

◆ playerFloorY

int Terraria.ModLoader.NPCSpawnInfo.playerFloorY

The y-coordinate of the tile the player is standing on.

◆ playerInTown

bool Terraria.ModLoader.NPCSpawnInfo.playerInTown

Whether or not the player is in a town. This is used for spawning critters instead of monsters.

◆ playerSafe

bool Terraria.ModLoader.NPCSpawnInfo.playerSafe

Whether or not the player is in front of a player-placed wall or in a large town. If this is true, enemies that can attack through walls should not spawn (unless an invasion is in progress).

◆ safeRangeX

bool Terraria.ModLoader.NPCSpawnInfo.safeRangeX

Whether or not the NPC is horizontally within the range near the player in which NPCs cannot spawn. If this is true, it also means that it is vertically outside of the range near the player in which NPCs cannot spawn.

◆ sky

bool Terraria.ModLoader.NPCSpawnInfo.sky

Whether or not the player is in the sky biome, where harpies and wyverns spawn.

◆ spawnTileX

int Terraria.ModLoader.NPCSpawnInfo.spawnTileX

The x-coordinate of the tile the NPC will spawn above.

◆ spawnTileY

int Terraria.ModLoader.NPCSpawnInfo.spawnTileY

The y-coordinate of the tile the NPC will spawn above.

◆ spiderCave

bool Terraria.ModLoader.NPCSpawnInfo.spiderCave

Whether or not the player is in a spider cave or the NPC will spawn near one.

◆ water

bool Terraria.ModLoader.NPCSpawnInfo.water

Whether or not the tile the NPC will spawn in contains water.