|
TModLoader v1.4.4.9
TModLoader source code documentation
|
The player's armor and accessories. Indexes 0-2 hold head, chest, and legs armor while 10-12 hold the respective social armor items. Indexes 3-9 hold the accessories and 13-19 hold the social accessory items. Modded accessory slots are stored separately.
Generally speaking, modders should not be accessing this array to check for specific accessories, that is not how Terraria is designed and is not scalable, especially since modded accessory slots exist and each can have special logic. Modders should be using M:Terraria.ModLoader.ModItem.UpdateAccessory(Terraria.Player,System.Boolean) to set fields in a T:Terraria.ModLoader.ModPlayer class, then use those values for gameplay effects. SimpleModPlayer.csshows the proper approach and explains this pattern.
The corresponding dye items are found in F:Terraria.Player.dye. The player's inventory is F:Terraria.Player.inventory. For equipment, see F:Terraria.Player.miscEquips and F:Terraria.Player.miscDyes. F:Terraria.Player.trashItem is the trash slot.
Definition at line 1651 of file Player.cs.
Referenced by Terraria.Player.Player(), Terraria.UI.ItemSlot.AccessorySwap(), Terraria.Player.ApplyArmorSoundAndDustChanges(), Terraria.UI.ItemSlot.ArmorSwap(), Terraria.Player.CanDemonHeartAccessoryBeShown(), Terraria.Player.CanMasterModeAccessoryBeShown(), Terraria.Player.CheckDrowning(), Terraria.Player.clientClone(), Terraria.Player.CloneLoadouts(), Terraria.Player.CopyVisuals(), Terraria.ModLoader.AccessorySlotLoader.Draw(), Terraria.Player.DropAnglerAccByMissing(), Terraria.Player.DropItems(), Terraria.Player.FixLoadedData(), Terraria.MessageBuffer.GetData(), Terraria.Player.GetPreferredGolfBallToUse(), Terraria.GameContent.Achievements.AchievementsHelper.HandleOnEquip(), Terraria.Player.HasItemInAnyInventory(), Terraria.ModLoader.IO.PlayerIO.Load(), Terraria.Player.LoadPlayer_LastMinuteFixes(), Terraria.ModLoader.AccessorySlotLoader.ModSlotCheck(), Terraria.GameContent.Achievements.AchievementsHelper.OnPlayerEnteredWorld(), Terraria.Player.PlayerFrame(), Terraria.Player.RefreshInfoAccs(), Terraria.Player.RefreshItems(), Terraria.ModLoader.IO.PlayerIO.SaveData(), Terraria.EquipmentLoadout.Swap(), Terraria.UI.ItemSlot.SwapVanityEquip(), Terraria.Player.Update(), Terraria.Player.UpdateArmorSets(), Terraria.Player.UpdateDyes(), Terraria.Player.UpdateEquips(), and Terraria.Player.UpdateVisibleAccessories().