Double Jump
Double Jump is an optional movement feature that grants players an extra air jump. When enabled, pressing SPACE while airborne triggers a second jump with configurable velocity modifiers.
Enablement
Double Jump is disabled by default. To enable it, add the server group(s) that should have access to double jump in your config.yml:
The feature is only active for players on server groups listed in double-jump-enable-groups. Attempts to trigger a double jump on a group not in this list are silently ignored.
Configuration
Double Jump is configured in plugins/AstralClasses/double-jump.yml:
Key | Type | Description |
|---|---|---|
| Vector (x, y, z) | Velocity multiplier applied when a directional key (forward, backward, left, right) is held during the jump. Each axis defaults to |
| Vector (x, y, z) | Velocity multiplier applied when no directional key is held (straight-up jump). Each axis defaults to |
| Duration | Time in milliseconds between consecutive air jumps. Applies to the second and subsequent jumps in an airborne sequence; the first jump (when grounded) has no cooldown. |
Example configuration
Behavior
The double jump mechanic tracks a per-player jump state:
Initial jump (grounded). When the player presses
SPACEwhile touching the ground, the jump state is reset and records one jump. No velocity is applied by the skill; the player's normal Minecraft jump applies.Second jump (airborne). When the player presses
SPACEwhile airborne,JumpState.canDoubleJump(now, cooldown, 1)gates the trigger: it requires the tracked jump count to be below the hardcoded maximum of1and (no air jump recorded yet this cycle, or at leastcooldownmilliseconds elapsed since the last one). Otherwise, the jump is blocked and no velocity is applied.
Directional velocity. The velocity applied depends on the player's held movement keys at the moment of jump:
No directional input: A base upward vector
(0, 1, 0)is multiplied byvertical-velocity-multiplier.Directional input held: The player's facing direction is used to compute forward/backward components, and the right vector (perpendicular to facing) is used for left/right components. The combined direction vector is multiplied by
horizontal-velocity-multiplier.
Jump state reset. When the player moves between blocks and touches the ground (detected via
PlayerMoveEvent), the jump state is reset, allowing a new jump cycle to begin.
Effects
When a double jump triggers:
A CLOUD particle burst spawns at the player's feet (10 particles, offset 0.5 horizontal / 0.2 vertical).
The
entity.breeze.jumpsound plays at the player's location (volume 0.7, pitch 1.0).
Wiring
Double Jump is triggered through the plugin's input system:
InputPacketListenerdecodes raw client packets and detectsSPACEkey presses viaPLAYER_INPUTpackets.Input events are deduplicated through
InputBufferso a held space key doesn't retrigger the jump on every packet — only the rising edge (false → true) triggers.SkillService.tryTriggerSpaceis called withInputType.SPACEand aSimpleInputwrapper of the client's input state.Inside
tryTriggerSpace, the method checksMainConfiguration.isDoubleJumpEnabledForGroup. If the player is on a group with double jump enabled, it callsDoubleJump.trigger(player, simpleInput, placeholderContainer)to apply the jump.
Implementation status
See also
Abilities & Input — packet-level input detection and the
InputTypeenumClasses — binding skills to player inputs within a class definition
Configuration — server-group enablement and main settings