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

◆ type

int Terraria.NPC.type

The NPC ID of this NPC. The NPC ID is a unique number assigned to each NPC loaded into the game. This will be equal to either an T:Terraria.ID.NPCID entry or M:Terraria.ModLoader.ModContent.NPCType``1, for example F:Terraria.ID.NPCID.AngryBones or ModContent.NPCType<MyModNPC>(). To check if an NPC instance is a specific NPC, check NPC.type == NPCID.VanillaNPCHere or NPC.type == ModContent.NPCType<ModdedNPCHere>() in an if statement.

<negativenote>There are a few NPC that share the same F:Terraria.NPC.type number, usually slight variations of enemies. F:Terraria.ID.NPCID.GreenSlime and F:Terraria.ID.NPCID.RedSlime have values of -3 and -8, respectively, but after they are spawned they will have the type equal to 1, which is the same value as F:Terraria.ID.NPCID.BlueSlime. If code logic requires differentiating between these variations, use F:Terraria.NPC.netID instead.</negativenote>

Definition at line 990 of file NPC.cs.

Referenced by Terraria.GameContent.ShopHelper.AddHappinessReportText(), Terraria.NPC.AI_001_Slimes(), Terraria.NPC.AI_002_FloatingEye(), Terraria.NPC.AI_003_Fighters(), Terraria.NPC.AI_005_EaterOfSouls(), Terraria.NPC.AI_006_Worms(), Terraria.NPC.AI_007_AttemptToPlayIdleAnimationsForPets(), Terraria.NPC.AI_007_FindGoodRestingSpot(), Terraria.NPC.AI_007_TownEntities(), Terraria.NPC.AI_007_TownEntities_GetWalkPrediction(), Terraria.NPC.AI_007_TownEntities_IsInAGoodRestingSpot(), Terraria.NPC.AI_007_TownEntities_TeleportToHome(), Terraria.NPC.AI_007_TryForcingSitting(), Terraria.NPC.AI_026_Unicorns(), Terraria.NPC.AI_037_Destroyer(), Terraria.NPC.AI_047_GolemFist(), Terraria.NPC.AI_065_Butterflies(), Terraria.NPC.AI_084_LunaticCultist(), Terraria.NPC.AI_107_ImprovedWalkers(), Terraria.NPC.AI_108_DivingFlyer(), Terraria.NPC.AI_109_DarkMage(), Terraria.NPC.AI_111_DD2LightningBug(), Terraria.NPC.AI_112_FairyCritter(), Terraria.NPC.AI_122_PirateGhost(), Terraria.NPC.AI_AttemptToFindTeleportSpot(), Terraria.ModLoader.ModNPC.AutoStaticDefaults(), Terraria.NPC.BannerID(), Terraria.GameContent.CoinLossRevengeSystem.CacheEnemy(), Terraria.Player.CanNPCBeHitByPlayerOrPlayerProjectile(), Terraria.NPC.CanReflectProjectile(), Terraria.ModLoader.NPCLoader.CanTownNPCSpawn(), Terraria.NPC.CheckActive(), Terraria.NPC.CheckCatchNPC(), Terraria.NPC.checkDead(), Terraria.NPC.CheckProgressFrostMoon(), Terraria.NPC.CheckProgressPumpkinMoon(), Terraria.ModLoader.NPCLoader.ChooseSpawn(), Terraria.NPC.CloneDefaults(), Terraria.NPC.DoDeathEvents(), Terraria.NPC.DoDeathEvents_AdvanceSlimeRain(), Terraria.NPC.DoDeathEvents_BeforeLoot(), Terraria.NPC.DoDeathEvents_CelebrateBossDeath(), Terraria.NPC.DoDeathEvents_DropBossPotionsAndHearts(), Terraria.NPC.DoDeathEvents_SummonDungeonSpirit(), Terraria.NPC.DoesntDespawnToInactivity(), Terraria.NPC.DoesntDespawnToInactivityAndCountsNPCSlots(), Terraria.GameContent.Bestiary.UnlockableNPCEntryIcon.Draw(), Terraria.GameContent.Animations.Segments.NPCSegment.Draw(), Terraria.NPC.DropTombstoneTownNPC(), Terraria.NPC.FairyEffects(), Terraria.NPC.FindFrame(), Terraria.ModLoader.NPCLoader.FindFrame(), Terraria.ID.ContentSamples.BestiaryHelper.GetBestiaryStarsPriority(), Terraria.NPC.GetBossHeadRotation(), Terraria.NPC.GetBossHeadSpriteEffects(), Terraria.NPC.GetBossHeadTextureIndex(), Terraria.NPC.getGoodAdjustments(), Terraria.GameContent.TownNPCProfiles.GetHeadIndexSafe(), Terraria.NPC.GetMagicAuraColor(), Terraria.NPC.GetMechQueenCenter(), Terraria.NPC.getNewNPCName(), Terraria.GameContent.TownNPCProfiles.GetProfile(), Terraria.NPC.GetShootingFrame(), Terraria.NPC.getTenthAnniversaryAdjustments(), Terraria.NPC.getZenithSeedAdjustmentsBeforeEverything(), Terraria.NPC.IsDamageDodgeable(), Terraria.GameContent.UI.BigProgressBar.MoonLordProgressBar.IsInBadAI(), Terraria.GameContent.ShopHelper.IsNotReallyTownNPC(), Terraria.NPC.IsNPCValidForBestiaryKillCredit(), Terraria.ModLoader.IO.WorldIO.LoadNPCs(), Terraria.GameContent.ShopHelper.LoveNPCByTypeName(), Terraria.NPC.MechSpawn(), Terraria.ModLoader.NPCLoader.ModifyActiveShop(), Terraria.GameContent.ItemDropRules.CommonCode.ModifyItemDropFromNPC(), Terraria.Utilities.NPCUtils.SearchFilters.NonBeeNPCs(), Terraria.ModLoader.NPCLoader.NPCAI(), Terraria.NPC.NPCLoot(), Terraria.NPC.NPCLoot_DropHeals(), Terraria.ModLoader.NPCLoader.OnChatButtonClicked(), Terraria.Utilities.NPCUtils.SearchFilters.OnlyCrystal(), Terraria.ModLoader.Default.Patreon.OrianSetEffectPlayer.PostUpdate(), Terraria.GameContent.ShopHelper.ProcessMood(), Terraria.ModLoader.ModNPC.Register(), Terraria.ModLoader.NPCLoader.RegisterTownNPCMoodLocalizations(), Terraria.ModLoader.IO.WorldIO.SaveNPCs(), Terraria.ModLoader.NPCLoader.SavesAndLoads(), Terraria.NPC.ScaleStats(), Terraria.NPC.ScaleStats_ApplyExpertTweaks(), Terraria.NPC.ScaleStats_ApplyGameMode(), Terraria.NPC.ScaleStats_ApplyMultiplayerStats(), Terraria.NPC.ScaleStats_UseStrengthMultiplier(), Terraria.NPC.SetDefaults(), Terraria.ModLoader.NPCLoader.SetDefaults(), Terraria.NPC.SetFrameSize(), Terraria.NPC.SetTargetTrackingValues(), Terraria.NPC.ShouldFaceTarget(), Terraria.Lang.SlimeChat(), Terraria.ModLoader.ModNPC.SpawnNPC(), Terraria.Player.StatusFromNPC(), Terraria.NPC.StingerExplosion(), Terraria.NPC.TargetClosestUpgraded(), Terraria.NPC.TryTrackingTarget(), Terraria.NPC.TypeToDefaultHeadIndex(), Terraria.GameContent.Bestiary.UnlockableNPCEntryIcon.Update(), Terraria.NPC.UsesPartyHat(), Terraria.GameContent.UI.BigProgressBar.BrainOfCthuluBigProgressBar.ValidateAndCollectNecessaryInfo(), Terraria.NPC.VanillaAI_Inner(), and Terraria.NPC.VanillaFindFrame().