Class PlayerJumpEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
com.destroystokyo.paper.event.player.PlayerJumpEvent
- All Implemented Interfaces:
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Field Summary
Fields inherited from class org.bukkit.event.player.PlayerEvent
player
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetFrom()
Gets the location this player jumped fromstatic HandlerList
getTo()
Gets the location this player jumped toboolean
Gets the cancellation state of this event.void
setCancelled
(boolean cancel) Sets the cancellation state of this event.void
Sets the location to mark as where the player jumped fromMethods inherited from class org.bukkit.event.player.PlayerEvent
getPlayer
Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PlayerJumpEvent
-
-
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 pluginsIf 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 interfaceCancellable
- 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 interfaceCancellable
- Parameters:
cancel
-true
if you wish to cancel this event
-
getFrom
Gets the location this player jumped from- Returns:
- Location the player jumped from
-
setFrom
Sets the location to mark as where the player jumped from- Parameters:
from
- New location to mark as the players previous location
-
getTo
Gets the location this player jumped toThis 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
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-