TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches
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...

+ Collaboration diagram for Terraria.ModLoader.NPCSpawnInfo:

Public Attributes

int SpawnTileX
 The x-coordinate of the tile the NPC will spawn above.
 
int SpawnTileY
 The y-coordinate of the tile the NPC will spawn above.
 
int SpawnTileType
 
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: (ZoneGranite, ZoneMarble, ZoneHive, ZoneGemCave are not actually proper spawning related checks, they are for visuals only (RGB), determined by the backwall type)

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

 
int PlayerFloorX
 The x-coordinate of the tile the player is standing on.
 
int PlayerFloorY
 The y-coordinate of the tile the player is standing on.
 
bool Sky
 Whether or not the player is in the sky biome, where harpies and wyverns spawn.
 
bool Lihzahrd
 Whether or not the player is inside the jungle temple, where Lihzahrds spawn.
 
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).
 
bool Invasion
 Whether or not there is an invasion going on and the player is near it.
 
bool Water
 Whether or not the tile the NPC will spawn in contains water.
 
bool Granite
 Whether or not the NPC will spawn on a granite block or the player is near a granite biome.
 
bool Marble
 Whether or not the NPC will spawn on a marble block or the player is near a marble biome.
 
bool SpiderCave
 Whether or not the player is in a spider cave or the NPC will spawn near one.
 
bool PlayerInTown
 Whether or not the player is in a town. This is used for spawning critters instead of monsters.
 
bool DesertCave
 Whether or not the player is in front of a desert wall or the NPC will spawn near one.
 
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.
 

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.

Definition at line 6 of file NPCSpawnInfo.cs.


The documentation for this struct was generated from the following file: