Terraria.Player Notes

Fields

Field

Type

Description

adjHoney, adjLava, adjWater

bool

Indicates whether the player is close enough to the corresponding type of liquid to use it for crafting. Updated only for the local player while the inventory screen is open.

adjTile

bool[419]

Each element indicates whether the player is close enough to the corresponding type of tile to use it for crafting. Updated only for the local player while the inventory screen is open.
Some elements correspond to more than one tile type: for example, adjTile[(int) TileID.Hellforge] is also true while the player is near an adamantite forge.

oldAdjHoney, oldAdjLava, oldAdjWater

bool

Indicates whether the player was close enough to the corresponding type of liquid on the last frame.

oldAdjTile

bool[419]

Each element indicates whether the player was close enough to the corresponding type of tile on the last frame.

anglerQuestsFinished

int

Self-explanatory.

attackCD

int

The number of frames until the player can again strike with a swung weapon. Does not apply to projectiles such as spears.

autoJump

bool

Indicates whether the player can jump by holding the jump button. Reset every frame.

autoPaint

bool

Indicates whether the player will automatically paint placed objects. Reset every frame.

babyFaceMonster

bool

Indicates whether the player has a baby face monster. If set to false, the pet vanishes after 2 frames. Reset every frame.

handon, handoff, back, front, shoe, waist, shield, neck, face, balloon

int

Determines which accessory sprite for the corresponding slot is drawn on the player.

bank

Chest

The contents of their piggy bank.

bank2

Chest

The contents of their safe.

bee

bool

If true, a swarm of bees will be released when the player is hit. Reset every frame.

beetleBuff

bool

Indicates whether the player has either Beetle buff. Reset every frame; not used.

beetleCountdown

int

The amount of time since the player struck a monster with a melee attack. Affects how quickly beetleCounter counts down. Only updated while the Beetle Might set is worn.

beetleCounter

int

A counter that increases as you deal damage with melee attacks and decreases with time depending on how long you spend without hitting something. If above certain thresholds, you gain the Beetle Might buff. Only updated while the Beetle Might set is worn; set to 0 otherwise.

beetleFrame

int

Affects beetle buff visual effects. Normally between 0 and 2.

beetleFrameCounter

int

Incremented every frame; if it reaches 1 or higher, it's reset to zero and beetleFrame is ticked.

skinVariant

int

Determines the style of the player model. If skinVariant is < 4, the player is considered male. If skinVariant is >= 4 the player is considered female.
This value is clamped between 0 and 7, inclusive.

statLife

int

Represents the current amount of health (life) the player has.
This value should never be higher than statLifeMax.

statLifeMax

int

Represents the maximum amount of health the player has.

Methods

Method

Type

Description

AdjTiles()

void

Scans the area around the player for crafting stations, and updates adjTile and similar fields, and the list of available recipes. Normally run every frame on the local player while the inventory screen is open.