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
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
ConstructorsConstructorDescriptionPlayerDoubleJumpEvent(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 TypeMethodDescriptionstatic org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListvoidsetCooldownSeconds(double cooldownSeconds) Replaces the cooldown that will be applied after the double jump.voidsetVelocity(@NotNull org.bukkit.util.Vector velocity) Replaces the velocity that will be applied to the player.Methods inherited from class PlayerEvent
getUser, toStringMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronousMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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 jumpgame- the game in which the double jump is being performedjumpsLeft- the number of double jumps left after this jumpcooldownSeconds- the cooldown to apply after the jumpvelocity- 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:
getHandlersin classorg.bukkit.event.Event
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()
-