tModLoader  0.12 Alpha
A mod to make and play Terraria mods
Terraria.ModLoader.Default.ModAccessorySlotPlayer Class Reference

Inherits Terraria.ModLoader.ModPlayer.

Classes

class  NetHandler
 

Public Member Functions

override void clientClone (ModPlayer clientClone)
 Allows you to copy information about this player to the clientClone parameter. You should copy information that you intend to sync between server and client. This hook is called in the Player.clientClone method. See SendClientChanges for more info. More...
 
void DropItems ()
 
override void LoadData (TagCompound tag)
 Allows you to load custom data that you have saved for this player.
Try to write defensive loading code that won't crash if something's missing. More...
 
override void SaveData (TagCompound tag)
 Allows you to save custom data for this player.

NOTE: The provided tag is always empty by default, and is provided as an argument only for the sake of convenience and optimization.
NOTE: Try to only save data that isn't default values. More...
 
override void SendClientChanges (ModPlayer clientPlayer)
 Allows you to sync any information that has changed between the server and client. Here, you should check the information you have copied in the clientClone parameter; if they differ between this player and the clientPlayer parameter, then you should send that information using NetMessage.SendData or ModPacket.Send. More...
 
override void SyncPlayer (int toWho, int fromWho, bool newPlayer)
 Allows you to sync information about this player between server and client. The toWho and fromWho parameters correspond to the remoteClient/toClient and ignoreClient arguments, respectively, of NetMessage.SendData/ModPacket.Send. The newPlayer parameter is whether or not the player is joining the server (it is true on the joining client). More...
 
override void UpdateDyes ()
 Mirrors Player.UpdateDyes() for modded slots Runs On Player Select, so is Player instance sensitive!!! More...
 
override void UpdateEquips ()
 Runs a simplified version of Player.UpdateEquips for the Modded Accessory Slots More...
 
override void UpdateVisibleAccessories ()
 Updates functional slot visibility information on the player for Mod Slots, in a similar fashion to Player.UpdateVisibleAccessories() More...
 
override void UpdateVisibleVanityAccessories ()
 Updates vanity slot information on the player for Mod Slots, in a similar fashion to Player.UpdateVisibleAccessories() More...
 
- Public Member Functions inherited from Terraria.ModLoader.ModPlayer
virtual IEnumerable< ItemAddStartingItems (bool mediumCoreDeath)
 Called when the player is created in the menu. You can use this method to add items to the player's starting inventory, as well as their inventory when they respawn in mediumcore. More...
 
virtual void AnglerQuestReward (float rareMultiplier, List< Item > rewardItems)
 Allows you to add to, change, or remove from the items the player earns when finishing an Angler quest. The rareMultiplier is a number between 0.15 and 1 inclusively; the lower it is the higher chance there should be for the player to earn rare items. More...
 
virtual bool CanBeHitByNPC (NPC npc, ref int cooldownSlot)
 Allows you to determine whether the given NPC can hit this player. Return false to block this player from being hit by the NPC. Returns true by default. CooldownSlot determines which of the player's cooldown counters to use (-1, 0, or 1), and defaults to -1. More...
 
virtual bool CanBeHitByProjectile (Projectile proj)
 Allows you to determine whether the given hostile projectile can hit this player. Return false to block this player from being hit. Returns true by default. More...
 
virtual bool CanBuyItem (NPC vendor, Item[] shopInventory, Item item)
 Return false to prevent a transaction. Called before the transaction. More...
 
virtual bool CanConsumeAmmo (Item weapon, Item ammo)
 Whether or not ammo will be consumed upon usage. Return false to stop the ammo from being depleted. Returns true by default.
If false is returned, the OnConsumeAmmo hook is never called. More...
 
virtual ? bool CanHitNPC (Item item, NPC target)
 Allows you to determine whether a player can hit the given NPC by swinging a melee weapon. Return true to allow hitting the target, return false to block this player from hitting the target, and return null to use the vanilla code for whether the target can be hit. Returns null by default. More...
 
virtual ? bool CanHitNPCWithProj (Projectile proj, NPC target)
 Allows you to determine whether a projectile created by this player can hit the given NPC. Return true to allow hitting the target, return false to block this projectile from hitting the target, and return null to use the vanilla code for whether the target can be hit. Returns null by default. More...
 
virtual bool CanHitPvp (Item item, Player target)
 Allows you to determine whether a melee weapon swung by this player can hit the given opponent player. Return false to block this weapon from hitting the target. Returns true by default. More...
 
virtual bool CanHitPvpWithProj (Projectile proj, Player target)
 Allows you to determine whether a projectile created by this player can hit the given opponent player. Return false to block the projectile from hitting the target. Returns true by default. More...
 
virtual bool CanSellItem (NPC vendor, Item[] shopInventory, Item item)
 Return false to prevent a transaction. Called before the transaction. More...
 
virtual bool CanShoot (Item item)
 Allows you to prevent an item from shooting a projectile on use. Returns true by default. More...
 
virtual bool CanUseItem (Item item)
 Return false to prevent an item from being used. By default returns true. More...
 
virtual void CatchFish (Item fishingRod, Item bait, int power, int liquidType, int poolSize, int worldLayer, int questFish, ref int caughtType)
 Allows you to change the item the player gains from catching a fish. The fishingRod and bait parameters refer to the said items in the player's inventory. The liquidType parameter is 0 if the player is fishing in water, 1 for lava, and 2 for honey. The poolSize parameter is the tile size of the pool the player is fishing in. The worldLayer parameter is 0 if the player is in the sky, 1 if the player is on the surface, 2 if the player is underground, 3 if the player is in the caverns, and 4 if the player is in the underworld. The questFish parameter is the item ID for the day's Angler quest. Modify the caughtType parameter to change the item the player catches. The junk parameter is whether the player catches junk; you can set this to true if you make the player catch a junk item, and is mostly used to pass information (has no effect on the game). More...
 
virtual void DrawEffects (PlayerDrawSet drawInfo, ref float r, ref float g, ref float b, ref float a, ref bool fullBright)
 Allows you to create special effects when this player is drawn, such as creating dust, modifying the color the player is drawn in, etc. The fullBright parameter makes it so that the drawn player ignores the modified color and lighting. Note that the fullBright parameter only works if r, g, b, and/or a is not equal to 1. Make sure to add the indexes of any dusts you create to drawInfo.DustCache, and the indexes of any gore you create to drawInfo.GoreCache. More...
 
virtual void FrameEffects ()
 Allows you to modify the armor and accessories that visually appear on the player. In addition, you can create special effects around this character, such as creating dust. More...
 
virtual void GetDyeTraderReward (List< int > rewardPool)
 Allows you to modify what items are possible for the player to earn when giving a Strange Plant to the Dye Trader. More...
 
virtual void GetFishingLevel (Item fishingRod, Item bait, ref float fishingLevel)
 Allows you to modify the player's fishing power. As an example of the type of stuff that should go here, the phase of the moon can influence fishing power. More...
 
virtual void GetHealLife (Item item, bool quickHeal, ref int healValue)
 Allows you to temporarily modify the amount of life a life healing item will heal for, based on player buffs, accessories, etc. This is only called for items with a healLife value. More...
 
virtual void GetHealMana (Item item, bool quickHeal, ref int healValue)
 Allows you to temporarily modify the amount of mana a mana healing item will heal for, based on player buffs, accessories, etc. This is only called for items with a healMana value. More...
 
virtual Texture2D GetMapBackgroundImage ()
 Allows you to change the background that displays when viewing the map. Return null if you do not want to change the background. Returns null by default. More...
 
virtual void HideDrawLayers (PlayerDrawSet drawInfo)
 Allows you to modify the visibility of layers about to be drawn More...
 
virtual void Hurt (bool pvp, bool quiet, double damage, int hitDirection, bool crit)
 Allows you to make anything happen right before damage is subtracted from the player's health. More...
 
virtual void Initialize ()
 Called whenever the player is loaded (on the player selection screen). This can be used to initialize data structures, etc. More...
 
virtual void Kill (double damage, int hitDirection, bool pvp, PlayerDeathReason damageSource)
 Allows you to make anything happen when the player dies. More...
 
virtual void MeleeEffects (Item item, Rectangle hitbox)
 Allows you to give this player's melee weapon special effects, such as creating light or dust. More...
 
virtual void ModifyDrawInfo (ref PlayerDrawSet drawInfo)
 Allows you to modify the drawing parameters of the player before drawing begins. More...
 
virtual void ModifyDrawLayerOrdering (IDictionary< PlayerDrawLayer, PlayerDrawLayer.Position > positions)
 Allows you to reorder the player draw layers. This is called once at the end of mod loading, not during the game. Use with extreme caution, or risk breaking other mods. More...
 
virtual void ModifyHitByNPC (NPC npc, ref int damage, ref bool crit)
 Allows you to modify the damage, etc., that an NPC does to this player. More...
 
virtual void ModifyHitByProjectile (Projectile proj, ref int damage, ref bool crit)
 Allows you to modify the damage, etc., that a hostile projectile does to this player. More...
 
virtual void ModifyHitNPC (Item item, NPC target, ref int damage, ref float knockback, ref bool crit)
 Allows you to modify the damage, knockback, etc., that this player does to an NPC by swinging a melee weapon. More...
 
virtual void ModifyHitNPCWithProj (Projectile proj, NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection)
 Allows you to modify the damage, knockback, etc., that a projectile created by this player does to an NPC. More...
 
virtual void ModifyHitPvp (Item item, Player target, ref int damage, ref bool crit)
 Allows you to modify the damage, etc., that a melee weapon swung by this player does to an opponent player. More...
 
virtual void ModifyHitPvpWithProj (Projectile proj, Player target, ref int damage, ref bool crit)
 Allows you to modify the damage, etc., that a projectile created by this player does to an opponent player. More...
 
virtual void ModifyLuck (ref float luck)
 Allows you to modify a player's luck amount. More...
 
virtual void ModifyManaCost (Item item, ref float reduce, ref float mult)
 Allows you to temporarily modify the amount of mana an item will consume on use, based on player buffs, accessories, etc. This is only called for items with a mana value. More...
 
virtual bool ModifyNurseHeal (NPC nurse, ref int health, ref bool removeDebuffs, ref string chatText)
 Called on the Client while the nurse chat is displayed. Return false to prevent the player from healing. If you return false, you need to set chatText so the user knows why they can't heal. More...
 
virtual void ModifyNursePrice (NPC nurse, int health, bool removeDebuffs, ref int price)
 Called on the Client while the nurse chat is displayed and after ModifyNurseHeal. Allows custom pricing for Nurse services. See https://terraria.gamepedia.com/Nurse for the default pricing. More...
 
virtual void ModifyScreenPosition ()
 Use this hook to modify Main.screenPosition after weapon zoom and camera lerp have taken place. More...
 
virtual void ModifyShootStats (Item item, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback)
 Allows you to modify the position, velocity, type, damage and/or knockback of a projectile being shot by an item. More...
 
virtual void ModifyStartingInventory (IReadOnlyDictionary< string, List< Item >> itemsByMod, bool mediumCoreDeath)
 Allows you to modify the items that will be added to the player's inventory. Useful if you want to stop vanilla or other mods from adding an item. You can access a mod's items by using the mod's internal name as the indexer, such as: additions["ModName"]. To access vanilla items you can use "Terraria" as the index. More...
 
virtual void ModifyWeaponCrit (Item item, ref int crit)
 Allows you to temporarily modify a weapon's crit chance based on player buffs, etc. More...
 
virtual void ModifyWeaponDamage (Item item, ref StatModifier damage, ref float flat)
 Allows you to temporarily modify this weapon's damage based on player buffs, etc. This is useful for creating new classes of damage, or for making subclasses of damage (for example, Shroomite armor set boosts). More...
 
virtual void ModifyWeaponKnockback (Item item, ref StatModifier knockback, ref float flat)
 Allows you to temporarily modify a weapon's knockback based on player buffs, etc. This allows you to customize knockback beyond the Player class's limited fields. More...
 
virtual void ModifyZoom (ref float zoom)
 Use this to modify the zoom factor for the player. The zoom correlates to the percentage of half the screen size the zoom can reach. A value of -1 passed in means no vanilla scope is in effect. A value of 1.0 means the scope can zoom half a screen width/height away, putting the player on the edge of the game screen. Vanilla values include .8, .6666, and .5. More...
 
virtual void NaturalLifeRegen (ref float regen)
 Allows you to modify the power of the player's natural life regeneration. This can be done by multiplying the regen parameter by any number. For example, campfires multiply it by 1.1, while walking multiplies it by 0.5. More...
 
virtual void OnConsumeAmmo (Item weapon, Item ammo)
 Allows you to make things happen when ammo is consumed.
Called before the ammo stack is reduced. More...
 
virtual void OnConsumeMana (Item item, int manaConsumed)
 Allows you to make stuff happen when a player consumes mana on use of an item. More...
 
virtual void OnEnterWorld (Player player)
 Called on the LocalPlayer when that player enters the world. SP and Client. Only called on the player who is entering. A possible use is ensuring that UI elements are reset to the configuration specified in data saved to the ModPlayer. Can also be used for informational messages. More...
 
virtual void OnHitAnything (float x, float y, Entity victim)
 This hook is called when a player damages anything, whether it be an NPC or another player, using anything, whether it be a melee weapon or a projectile. The x and y parameters are the coordinates of the victim parameter's center. More...
 
virtual void OnHitByNPC (NPC npc, int damage, bool crit)
 Allows you to create special effects when an NPC hits this player (for example, inflicting debuffs). More...
 
virtual void OnHitByProjectile (Projectile proj, int damage, bool crit)
 Allows you to create special effects when a hostile projectile hits this player. More...
 
virtual void OnHitNPC (Item item, NPC target, int damage, float knockback, bool crit)
 Allows you to create special effects when this player hits an NPC by swinging a melee weapon (for example how the Pumpkin Sword creates pumpkin heads). More...
 
virtual void OnHitNPCWithProj (Projectile proj, NPC target, int damage, float knockback, bool crit)
 Allows you to create special effects when a projectile created by this player hits an NPC (for example, inflicting debuffs). More...
 
virtual void OnHitPvp (Item item, Player target, int damage, bool crit)
 Allows you to create special effects when this player's melee weapon hits an opponent player. More...
 
virtual void OnHitPvpWithProj (Projectile proj, Player target, int damage, bool crit)
 Allows you to create special effects when a projectile created by this player hits an opponent player. More...
 
virtual void OnMissingMana (Item item, int neededMana)
 Allows you to make stuff happen when a player doesn't have enough mana for the item they are trying to use. If the player has high enough mana after this hook runs, mana consumption will happen normally. Only runs once per item use. More...
 
virtual void OnRespawn (Player player)
 Called when a player respawns in the world. More...
 
virtual void PlayerConnect (Player player)
 Called on clients when a player connects. More...
 
virtual void PlayerDisconnect (Player player)
 Called when a player disconnects. More...
 
virtual void PostBuyItem (NPC vendor, Item[] shopInventory, Item item)
 Called whenever the player buys an item from an NPC. More...
 
virtual void PostHurt (bool pvp, bool quiet, double damage, int hitDirection, bool crit)
 Allows you to make anything happen when the player takes damage. More...
 
virtual void PostItemCheck ()
 Allows you to do anything after the update code for the player's held item is run. Hooks for the middle of the held item update code have more specific names in ModItem and ModPlayer. More...
 
virtual void PostNurseHeal (NPC nurse, int health, bool removeDebuffs, int price)
 Called on the Client after the player heals themselves with the Nurse NPC. More...
 
virtual void PostSavePlayer ()
 PreSavePlayer and PostSavePlayer wrap the vanilla player saving code (both are before the ModPlayer.Save). Useful for advanced situations where a save might be corrupted or rendered unusable by the values that normally would save. More...
 
virtual void PostSellItem (NPC vendor, Item[] shopInventory, Item item)
 Called whenever the player sells an item to an NPC. More...
 
virtual void PostUpdate ()
 This is called at the very end of the Player.Update method. Final general update tasks can be placed here. More...
 
virtual void PostUpdateBuffs ()
 This is called right after all of this player's buffs update on the player. This can be used to modify the effects that the buff updates had on this player, and can also be used for general update tasks. More...
 
virtual void PostUpdateEquips ()
 This is called right after all of this player's equipment and armor sets update on the player, which is sometime after PostUpdateBuffs is called. This can be used to modify the effects that the equipment had on this player, and can also be used for general update tasks. More...
 
virtual void PostUpdateMiscEffects ()
 This is called after miscellaneous update code is called in Player.Update, which is sometime after PostUpdateEquips is called. This can be used for general update tasks. More...
 
virtual void PostUpdateRunSpeeds ()
 This is called after the player's horizontal speeds are modified, which is sometime after PostUpdateMiscEffects is called, and right before the player's horizontal position is updated. Use this to modify maxRunSpeed, accRunSpeed, runAcceleration, and similar variables before the player moves forwards/backwards. More...
 
virtual bool PreHurt (bool pvp, bool quiet, ref int damage, ref int hitDirection, ref bool crit, ref bool customDamage, ref bool playSound, ref bool genGore, ref PlayerDeathReason damageSource)
 This hook is called before every time the player takes damage. The pvp parameter is whether the damage was from another player. The quiet parameter determines whether the damage will be communicated to the server. The damage, hitDirection, and crit parameters can be modified. Set the customDamage parameter to true if you want to use your own damage formula (this parameter will disable automatically subtracting the player's defense from the damage). Set the playSound parameter to false to disable the player's hurt sound, and the genGore parameter to false to disable the dust particles that spawn. (These are useful for creating your own sound or gore.) The deathText parameter can be modified to change the player's death message if the player dies. Return false to stop the player from taking damage. Returns true by default. More...
 
virtual bool PreItemCheck ()
 Allows you to do anything before the update code for the player's held item is run. Return false to stop the held item update code from being run (for example, if the player is frozen). Returns true by default. More...
 
virtual bool PreKill (double damage, int hitDirection, bool pvp, ref bool playSound, ref bool genGore, ref PlayerDeathReason damageSource)
 This hook is called whenever the player is about to be killed after reaching 0 health. Set the playSound parameter to false to stop the death sound from playing. Set the genGore parameter to false to stop the gore and dust from being created. (These are useful for creating your own sound or gore.) Return false to stop the player from being killed. Only return false if you know what you are doing! Returns true by default. More...
 
virtual bool PreModifyLuck (ref float luck)
 Called before vanilla makes any luck calculations. Return false to prevent vanilla from making their luck calculations. Returns true by default. More...
 
virtual void PreSaveCustomData ()
 Currently never gets called, so this is useless. More...
 
virtual void PreSavePlayer ()
 PreSavePlayer and PostSavePlayer wrap the vanilla player saving code (both are before the ModPlayer.Save). Useful for advanced situations where a save might be corrupted or rendered unusable by the values that normally would save. More...
 
virtual void PreUpdate ()
 This is called at the beginning of every tick update for this player, after checking whether the player exists. More...
 
virtual void PreUpdateBuffs ()
 This is called sometime after SetControls is called, and right before all the buffs update on this player. This hook can be used to add buffs to the player based on the player's state (for example, the Campfire buff is added if the player is near a Campfire). More...
 
virtual void PreUpdateMovement ()
 This is called right before modifying the player's position based on velocity. Use this to make direct changes to the velocity. More...
 
virtual void ProcessTriggers (TriggersSet triggersSet)
 Use this to check on keybinds you have registered. While SetControls is set even while in text entry mode, this hook is only called during gameplay. More...
 
virtual void ResetEffects ()
 This is where you reset any fields you add to your ModPlayer subclass to their default states. This is necessary in order to reset your fields if they are conditionally set by a tick update but the condition is no longer satisfied. More...
 
virtual void SetControls ()
 Use this to modify the control inputs that the player receives. For example, the Confused debuff swaps the values of player.controlLeft and player.controlRight. This is called sometime after PreUpdate is called. More...
 
sealed override void SetupContent ()
 If you make a new ModType, seal this override, and call SetStaticDefaults in it. More...
 
virtual bool ShiftClickSlot (Item[] inventory, int context, int slot)
 Called whenever the player shift-clicks an item slot. This can be used to override default clicking behavior (ie. selling, trashing, moving items). More...
 
virtual bool Shoot (Item item, ProjectileSource_Item_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
 Allows you to modify an item's shooting mechanism. Return false to prevent vanilla's shooting code from running. Returns true by default. More...
 
bool TypeEquals (ModPlayer other)
 
virtual void UpdateAutopause ()
 Allows you to modify the player's stats while the game is paused due to the autopause setting being on. This is called in single player only, some time before the player's tick update would happen when the game isn't paused. More...
 
virtual void UpdateBadLifeRegen ()
 Allows you to give the player a negative life regeneration based on its state (for example, the "On Fire!" debuff makes the player take damage-over-time). This is typically done by setting player.lifeRegen to 0 if it is positive, setting player.lifeRegenTime to 0, and subtracting a number from player.lifeRegen. The player will take damage at a rate of half the number you subtract per second. More...
 
virtual void UpdateDead ()
 Similar to UpdateDead, except this is only called when the player is dead. If this is called, then ResetEffects will not be called. More...
 
virtual void UpdateLifeRegen ()
 Allows you to increase the player's life regeneration based on its state. This can be done by incrementing player.lifeRegen by a certain number. The player will recover life at a rate of half the number you add per second. You can also increment player.lifeRegenTime to increase the speed at which the player reaches its maximum natural life regeneration. More...
 
virtual float UseAnimationMultiplier (Item item)
 Allows you to change the effective useAnimation of an item.
Note that this hook may cause items' actions to run less or more times than they should per a single use. More...
 
virtual float UseSpeedMultiplier (Item item)
 Allows you to safely change both useTime and useAnimation while keeping the values relative to each other.
Useful for status effects. More...
 
virtual float UseTimeMultiplier (Item item)
 Allows you to change the effective useTime of an item.
Note that this hook may cause items' actions to run less or more times than they should per a single use. More...
 
- Public Member Functions inherited from Terraria.ModLoader.ModType
virtual bool IsLoadingEnabled (Mod mod)
 Allows you to stop Mod.AddContent from actually adding this content. Useful for items that can be disabled by a config. More...
 
virtual void Load ()
 Allows you to perform one-time loading tasks. Beware that mod content has not finished loading here, things like ModContent lookup tables or ID Sets are not fully populated. More...
 
virtual void SetStaticDefaults ()
 Allows you to modify the properties after initial loading has completed. More...
 
virtual void Unload ()
 Allows you to safely unload things you added in Load. More...
 

Properties

override bool CloneNewInstances [get]
 
int LoadedSlotCount [get]
 
int SlotCount [get]
 
int UnloadedSlotCount = 0 [get]
 
- Properties inherited from Terraria.ModLoader.ModPlayer
virtual bool CloneNewInstances [get]
 Whether each player gets a ModPlayer by cloning the ModPlayer added to the Mod or by creating a new ModPlayer object with the same type as the ModPlayer added to the Mod. The accessor returns true by default. Return false if you want to assign fields through the constructor. More...
 
Player Player [get, set]
 The Player instance that this ModPlayer instance is attached to. More...
 
- Properties inherited from Terraria.ModLoader.ModType
string FullName [get]
 The internal name of this, including the mod it is from. More...
 
Mod Mod [get, set]
 The mod this belongs to. More...
 
virtual string Name [get]
 The internal name of this. More...
 
- Properties inherited from Terraria.ModLoader.IModType
string FullName [get]
 => $"{Mod.Name}/{Name}" More...
 
Mod Mod [get]
 The mod this belongs to. More...
 
string Name [get]
 The internal name of this instance. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Terraria.ModLoader.ModPlayer
sealed override void Register ()
 If you make a new ModType, seal this override. More...
 

Member Function Documentation

◆ clientClone()

override void Terraria.ModLoader.Default.ModAccessorySlotPlayer.clientClone ( ModPlayer  clientClone)
virtual

Allows you to copy information about this player to the clientClone parameter. You should copy information that you intend to sync between server and client. This hook is called in the Player.clientClone method. See SendClientChanges for more info.

Parameters
clientClone

Reimplemented from Terraria.ModLoader.ModPlayer.

◆ LoadData()

override void Terraria.ModLoader.Default.ModAccessorySlotPlayer.LoadData ( TagCompound  tag)
virtual

Allows you to load custom data that you have saved for this player.
Try to write defensive loading code that won't crash if something's missing.

Parameters
tagThe TagCompound to load data from.

Reimplemented from Terraria.ModLoader.ModPlayer.

◆ SaveData()

override void Terraria.ModLoader.Default.ModAccessorySlotPlayer.SaveData ( TagCompound  tag)
virtual

Allows you to save custom data for this player.

NOTE: The provided tag is always empty by default, and is provided as an argument only for the sake of convenience and optimization.
NOTE: Try to only save data that isn't default values.

Parameters
tagThe TagCompound to save data into. Note that this is always empty by default, and is provided as an argument only for the sake of convenience and optimization.

Reimplemented from Terraria.ModLoader.ModPlayer.

◆ SendClientChanges()

override void Terraria.ModLoader.Default.ModAccessorySlotPlayer.SendClientChanges ( ModPlayer  clientPlayer)
virtual

Allows you to sync any information that has changed between the server and client. Here, you should check the information you have copied in the clientClone parameter; if they differ between this player and the clientPlayer parameter, then you should send that information using NetMessage.SendData or ModPacket.Send.

Parameters
clientPlayer

Reimplemented from Terraria.ModLoader.ModPlayer.

◆ SyncPlayer()

override void Terraria.ModLoader.Default.ModAccessorySlotPlayer.SyncPlayer ( int  toWho,
int  fromWho,
bool  newPlayer 
)
virtual

Allows you to sync information about this player between server and client. The toWho and fromWho parameters correspond to the remoteClient/toClient and ignoreClient arguments, respectively, of NetMessage.SendData/ModPacket.Send. The newPlayer parameter is whether or not the player is joining the server (it is true on the joining client).

Parameters
toWho
fromWho
newPlayer

Reimplemented from Terraria.ModLoader.ModPlayer.

◆ UpdateDyes()

override void Terraria.ModLoader.Default.ModAccessorySlotPlayer.UpdateDyes ( )
virtual

Mirrors Player.UpdateDyes() for modded slots Runs On Player Select, so is Player instance sensitive!!!

Reimplemented from Terraria.ModLoader.ModPlayer.

◆ UpdateEquips()

override void Terraria.ModLoader.Default.ModAccessorySlotPlayer.UpdateEquips ( )
virtual

Runs a simplified version of Player.UpdateEquips for the Modded Accessory Slots

Reimplemented from Terraria.ModLoader.ModPlayer.

◆ UpdateVisibleAccessories()

override void Terraria.ModLoader.Default.ModAccessorySlotPlayer.UpdateVisibleAccessories ( )
virtual

Updates functional slot visibility information on the player for Mod Slots, in a similar fashion to Player.UpdateVisibleAccessories()

Reimplemented from Terraria.ModLoader.ModPlayer.

◆ UpdateVisibleVanityAccessories()

override void Terraria.ModLoader.Default.ModAccessorySlotPlayer.UpdateVisibleVanityAccessories ( )
virtual

Updates vanity slot information on the player for Mod Slots, in a similar fashion to Player.UpdateVisibleAccessories()

Reimplemented from Terraria.ModLoader.ModPlayer.