public class PlayerJumpEvent extends PlayerEvent implements Cancellable
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.
Event.Result
player
Constructor and Description |
---|
PlayerJumpEvent(@NotNull Player player,
@NotNull Location from,
@NotNull Location to) |
Modifier and Type | Method and Description |
---|---|
@NotNull Location |
getFrom()
Gets the location this player jumped from
|
static @NotNull HandlerList |
getHandlerList() |
@NotNull HandlerList |
getHandlers() |
@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.
|
boolean |
isCancelled()
Gets the cancellation state of this event.
|
void |
setCancelled(boolean cancel)
Sets the cancellation state of this event.
|
void |
setFrom(@NotNull Location from)
Sets the location to mark as where the player jumped from
|
getPlayer
callEvent, getEventName, isAsynchronous
public boolean isCancelled()
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
isCancelled
in interface Cancellable
public void setCancelled(boolean cancel)
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
setCancelled
in interface Cancellable
cancel
- true if you wish to cancel this event@NotNull public @NotNull Location getFrom()
public void setFrom(@NotNull @NotNull Location from)
from
- New location to mark as the players previous location@NotNull public @NotNull Location getTo()
@NotNull public @NotNull HandlerList getHandlers()
getHandlers
in class Event
@NotNull public static @NotNull HandlerList getHandlerList()
Copyright © 2021. All rights reserved.