TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ SpawnChance()

virtual float Terraria.ModLoader.ModNPC.SpawnChance ( NPCSpawnInfo spawnInfo)
inlinevirtual

Whether or not this NPC can spawn with the given spawning conditions. Return the weight for the chance of this NPC to spawn compared to vanilla mobs. All vanilla mobs combined have a total weight of 1. Returns 0 by default, which disables natural spawning. Remember to always use spawnInfo.player and not Main.LocalPlayer when checking Player or ModPlayer fields, otherwise your mod won't work in Multiplayer.

Parameters
spawnInfo
Returns

Definition at line 644 of file ModNPC.cs.

645 {
646 return 0f;
647 }

Referenced by Terraria.ModLoader.NPCLoader.ChooseSpawn().

+ Here is the caller graph for this function: