Class PlayerJumpEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
com.destroystokyo.paper.event.player.PlayerJumpEvent
All Implemented Interfaces:
Cancellable

public class PlayerJumpEvent extends PlayerEvent implements Cancellable
Called when the server detects the player is jumping.

Added to avoid the overhead and special case logic that many plugins use when checking for jumps via PlayerMoveEvent, this event is fired whenever the server detects that the player is jumping.

  • Constructor Details

  • Method Details

    • isCancelled

      public boolean isCancelled()
      Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins

      If a jump event is cancelled, the player will be moved or teleported back to the Location as defined by getFrom(). This will not fire an event

      Specified by:
      isCancelled in interface Cancellable
      Returns:
      true if this event is cancelled
    • setCancelled

      public void setCancelled(boolean cancel)
      Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.

      If a jump event is cancelled, the player will be moved or teleported back to the Location as defined by getFrom(). This will not fire an event

      Specified by:
      setCancelled in interface Cancellable
      Parameters:
      cancel - true if you wish to cancel this event
    • getFrom

      @NotNull public @NotNull Location getFrom()
      Gets the location this player jumped from
      Returns:
      Location the player jumped from
    • setFrom

      public void setFrom(@NotNull @NotNull Location from)
      Sets the location to mark as where the player jumped from
      Parameters:
      from - New location to mark as the players previous location
    • getTo

      @NotNull public @NotNull Location getTo()
      Gets the location this player jumped to

      This information is based on what the client sends, it typically has little relation to the arc of the jump at any given point.

      Returns:
      Location the player jumped to
    • getHandlers

      @NotNull public @NotNull HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      @NotNull public static @NotNull HandlerList getHandlerList()