Class PlayerDoubleJumpEvent

java.lang.Object
org.bukkit.event.Event
dev.despical.tntrun.api.event.TNTRunEvent
dev.despical.tntrun.api.event.player.PlayerEvent
dev.despical.tntrun.api.event.player.PlayerDoubleJumpEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class PlayerDoubleJumpEvent extends PlayerEvent implements org.bukkit.event.Cancellable
Called before a player consumes and performs a double jump.

The player has already passed the built-in game, spectator, cooldown, and remaining-jump checks when this event is fired. Cancelling the event prevents the jump from being consumed and stops the velocity, sound, cooldown, and scoreboard updates from being applied.

Listeners may modify setVelocity(Vector) and setCooldownSeconds(double) to customize the launch force or the next double-jump cooldown.

  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bukkit.event.Event

    org.bukkit.event.Event.Result
  • Constructor Summary

    Constructors
    Constructor
    Description
    PlayerDoubleJumpEvent(org.bukkit.entity.Player player, Game game, int jumpsLeft, double cooldownSeconds, @NotNull org.bukkit.util.Vector velocity)
    Constructs a new PlayerDoubleJumpEvent.
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.bukkit.event.HandlerList
     
    @NotNull org.bukkit.event.HandlerList
     
    void
    setCooldownSeconds(double cooldownSeconds)
    Replaces the cooldown that will be applied after the double jump.
    void
    setVelocity(@NotNull org.bukkit.util.Vector velocity)
    Replaces the velocity that will be applied to the player.

    Methods inherited from class PlayerEvent

    getUser, toString

    Methods inherited from class org.bukkit.event.Event

    callEvent, getEventName, isAsynchronous

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.bukkit.event.Cancellable

    isCancelled, setCancelled
  • Constructor Details

    • PlayerDoubleJumpEvent

      public PlayerDoubleJumpEvent(org.bukkit.entity.Player player, Game game, int jumpsLeft, double cooldownSeconds, @NotNull @NotNull org.bukkit.util.Vector velocity)
      Constructs a new PlayerDoubleJumpEvent.
      Parameters:
      player - the player performing the double jump
      game - the game in which the double jump is being performed
      jumpsLeft - the number of double jumps left after this jump
      cooldownSeconds - the cooldown to apply after the jump
      velocity - the velocity to apply to the player
  • Method Details

    • setCooldownSeconds

      public void setCooldownSeconds(double cooldownSeconds)
      Replaces the cooldown that will be applied after the double jump.
      Parameters:
      cooldownSeconds - the new cooldown in seconds
    • setVelocity

      public void setVelocity(@NotNull @NotNull org.bukkit.util.Vector velocity)
      Replaces the velocity that will be applied to the player.
      Parameters:
      velocity - the new velocity
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Specified by:
      getHandlers in class org.bukkit.event.Event
    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()