Skip to main content
The Double Jump feature allows players to perform a second jump while in the air, providing enhanced mobility and making navigation through your hub more dynamic and fun.

Overview

When enabled, players in Adventure or Survival mode can double-jump by pressing the jump key twice. The second jump launches them forward and upward with configurable power values.

Configuration

config.yml
double_jump:
  enabled: true
  power: 1.5
  power_y: 0.5
  # INTEGERS ONLY
  cooldown: 2

Configuration Options

Enable or disable the double jump feature.Type: Boolean
Default: true
The horizontal power of the double jump.Type: Number
Default: 1.5
Note: Higher values = stronger forward momentum
The vertical (upward) power of the double jump.Type: Number
Default: 0.5
Note: Controls how high the second jump launches the player
Cooldown in seconds between double jumps.Type: Integer
Default: 2
Important: Must be an integer value (no decimals)

How It Works

1

Player jumps normally

The player performs a regular jump and is now in the air.
2

Player attempts to fly

While in the air, the player presses the jump key again (double-tap jump).
3

System checks conditions

The plugin verifies the player is in Adventure/Survival mode, has the movement key in their data, cooldown has expired, and double jump is enabled.
4

Double jump executes

The player is launched forward and upward with the configured power values.

Technical Implementation

The double jump feature leverages Minecraft’s flight toggle event to detect the mid-air jump attempt:
DoubleJumpListener.java
@EventHandler
public void onToggleFlight(PlayerToggleFlightEvent event) {
    Player player = event.getPlayer();

    // Skip if in disabled world
    if(plugin.getDisabledWorldsManager().inDisabledWorld(player.getLocation())) {
        return;
    }

    // Only work in Adventure/Survival mode
    if(player.getGameMode() == GameMode.CREATIVE || 
       player.getGameMode() == GameMode.SPECTATOR) return;

    PersistentDataContainer dataContainer = player.getPersistentDataContainer();
    if(!dataContainer.has(PluginKeys.MOVEMENT_KEY.getKey())) return;

    if(config.getBoolean("double_jump.enabled")) {
        new PlayerMovementHandler(player, plugin).handleMovement(event);
    }
}

Flight Permission System

Double jump uses the flight allowance system creatively. When players join or change gamemode, they’re granted flight permission:
DoubleJumpListener.java
@EventHandler
private void onGamemodeChange(PlayerGameModeChangeEvent event) {
    Player player = event.getPlayer();
    
    if(event.getNewGameMode() == GameMode.ADVENTURE || 
       event.getNewGameMode() == GameMode.SURVIVAL) {
        
        if(config.getBoolean("double_jump.enabled")) {
            new BukkitRunnable() {
                @Override
                public void run() {
                    player.setAllowFlight(true);
                }
            }.runTaskLater(plugin, 1L);
        }
    }
}
The flight permission is only used to detect the double-tap jump input. Players won’t actually fly - they’ll just get the boost from the double jump.

Player Movement Modes

Double jump integrates with Hubbly’s player movement system. Players must have movement data stored in their PersistentDataContainer for double jump to work. This is automatically managed when:
  • Players join the server
  • Players change their movement mode through the movement menu
  • Database integration is enabled

Best Practices

1

Balance power values

Test different power and power_y combinations to find the right feel for your hub. Start with defaults and adjust based on player feedback.
2

Set appropriate cooldown

A 2-second cooldown prevents spam while keeping movement fluid. Adjust based on your hub’s size and layout.
3

Test with your hub layout

Ensure double jump doesn’t allow access to restricted areas or break parkour challenges.
4

Combine with other features

Double jump works great alongside launchpads and movement items for a comprehensive mobility system.

Permissions

Double jump functionality is tied to the player’s movement mode and data, not a specific permission. However, players need to be in Adventure or Survival gamemode for it to work.
Double jump will NOT work for players in Creative or Spectator mode, as these gamemodes already have native flight capabilities.

Disabled Worlds

Double jump respects the disabled worlds configuration:
config.yml
disabled-worlds:
  - 'world_nether'

invert: false
If a player is in a disabled world, double jump will not function.

Advanced Configuration

High-Power Double Jump

For larger hubs where players need to cover more distance:
double_jump:
  enabled: true
  power: 2.5  # Strong horizontal boost
  power_y: 0.8  # Higher vertical boost
  cooldown: 3  # Longer cooldown to balance power

Subtle Double Jump

For a more subtle movement enhancement:
double_jump:
  enabled: true
  power: 1.0  # Gentle forward boost
  power_y: 0.3  # Small vertical boost
  cooldown: 1  # Short cooldown for frequent use

Vertical-Focused Double Jump

For parkour or vertical navigation:
double_jump:
  enabled: true
  power: 0.5  # Minimal horizontal movement
  power_y: 1.2  # Strong upward boost
  cooldown: 2

Troubleshooting

Common causes:
  • Player is in Creative or Spectator mode
  • Player doesn’t have movement data in PersistentDataContainer
  • double_jump.enabled is set to false
  • Player is in a disabled world
  • Cooldown hasn’t expired yet
This shouldn’t happen. Check:
  • Ensure players are not in Creative mode
  • Verify no other plugins are granting flight
  • Check that PlayerMovementHandler is properly canceling the flight event
Adjust the values:
  • Increase power for more horizontal distance
  • Increase power_y for more height
  • Test in small increments (0.2-0.5 adjustments)
If players are getting spammed with cooldown messages:
  • Increase the cooldown duration
  • Check that cooldown messages are properly suppressed
  • Verify CooldownManager is functioning correctly

Build docs developers (and LLMs) love