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

◆ NewNPCDirect() [1/2]

static NPC Terraria.NPC.NewNPCDirect ( IEntitySource source,
int x,
int y,
int type,
int start = 0,
float ai0 = 0f,
float ai1 = 0f,
float ai2 = 0f,
float ai3 = 0f,
int target = 255 )
inlinestatic



This particular overload returns the actual NPC instance rather than the index of the spawned NPC within the F:Terraria.Main.npc array.
A short-hand for

Main.npc[NPC.NewNPC(...)]

Definition at line 112527 of file NPC.cs.

112528 {
112529 return Main.npc[NewNPC(source, x, y, type, start, ai0, ai1, ai2, ai3, target)];
112530 }
int type
The NPC ID of this NPC. The NPC ID is a unique number assigned to each NPC loaded into the game....
Definition NPC.cs:990
static int NewNPC(IEntitySource source, int X, int Y, int Type, int Start=0, float ai0=0f, float ai1=0f, float ai2=0f, float ai3=0f, int Target=255)
Spawns an NPC into the game world with the given type. This method should not be called on multipla...
Definition NPC.cs:91239
int target
Definition NPC.cs:1019

References Terraria.Main.npc.