Skip to content

PlayerDoubleJumpEvent

The PlayerDoubleJumpEvent is triggered after the built-in game, spectator, cooldown, and remaining-jump checks pass, but before the double jump is consumed. Developers can cancel the jump or modify the launch velocity and cooldown.


  • Package: dev.despical.tntrun.api.event.player
  • Parent Class: PlayerEvent
  • Cancellable: Yes

Since this event extends PlayerEvent, you have access to getPlayer() and getUser() in addition to the following:

MethodReturn TypeDescription
getGame()GameReturns the game where the double jump happens.
getJumpsLeft()intReturns the jumps left after this jump is consumed.
getCooldownSeconds()doubleReturns the cooldown that will be applied.
setCooldownSeconds(double)voidReplaces the cooldown that will be applied.
getVelocity()VectorReturns the velocity that will be applied.
setVelocity(Vector)voidReplaces the velocity that will be applied.
isCancelled()booleanChecks if the double jump has been blocked.
setCancelled(boolean)voidSet to true to prevent the double jump.

  • Custom Boosters: Increase launch velocity for VIP players or special arenas.
  • Cooldown Rules: Lower or raise the cooldown based on permissions.
  • Anti-Abuse Checks: Cancel jumps during restricted phases or custom server events.
  • Cosmetic Effects: Trigger particles, sounds, or announcements when a jump is used.

This example gives players a stronger final double jump.

import dev.despical.tntrun.api.event.player.PlayerDoubleJumpEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
public class DoubleJumpListener implements Listener {
@EventHandler
public void onDoubleJump(PlayerDoubleJumpEvent event) {
if (event.getJumpsLeft() <= 1) {
event.setVelocity(event.getVelocity().multiply(1.25));
event.setCooldownSeconds(2.0);
}
}
}