tModLoader v2024.03
A mod to make and play Terraria mods
ExtraJumpState Struct Reference

A structure containing fields used to manage extra jumps

More...

Public Member Functions

void Disable ()
 Forces this extra jump to be disabled, consuming it and preventing the usage of it during the current game tick in the process.
If you want to disable all extra jumps, using Player.blockExtraJumps is preferred.
 
void Enable ()
 Sets this extra jump to usable for this game tick.
If you want to disable this extra jump, use Disable
 

Properties

bool Active [get]
 Whether any effects (e.g. spawning dusts) should be performed after consuming the extra jump, but before its duration runs out.
This property returns true while the extra jump is in progress, and returns false otherwise.
While an extra jump is in progress, ExtraJump.UpdateHorizontalSpeeds and ExtraJump.ShowVisuals will be executed.
This property also checks Enabled when read.
 
bool Available [get, set]
 true if the extra jump has not been consumed. Will be set to false when the extra jump starts.
Setting this field to false will effectively make the game think that the player has already used this extra jump.
This property also checks Enabled when read.
For a reusable jump (e.g. MultipleUseExtraJump from ExampleMod), this property should only be set to true in ExtraJump.OnStarted.
 
bool Enabled [get]
 Whether the extra jump can be used. This property is set by Enable and Disable.
This property is automatically set to false in ResetEffects.
When false, Available and Active will also be false.

 

Detailed Description

A structure containing fields used to manage extra jumps

Valid states for an extra jump are as follows:

  • Enabled = false | The extra jump cannot be used. Available and Active will be false
  • Enabled = true, Available = true, Active = false | The extra jump is ready to be consumed, but hasn't been consumed yet
  • Enabled = true, Available = false, Active = true | The extra jump has been consumed and is currently in progress
  • Enabled = true, Available = true, Active = true | The extra jump is currently in progress, but can be re-used again after it ends
  • Enabled = true, Available = false, Active = false | The extra jump has been consumed and cannot be used again until extra jumps are refreshed