Class PlayerMoveEvent
java.lang.Object
fr.fidorial.event.player.PlayerMoveEvent
- All Implemented Interfaces:
Cancellable, Event, PlayerEvent
Fired when a player moves or turns, before the new position is applied.
Cancelling the event teleports the player back to from().
- Since:
- 0.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerMoveEvent(Player player, Location from, Location to) Creates an event. -
Method Summary
Modifier and TypeMethodDescriptionfrom()Returns the location before the move.booleanReturnstrueif the action this event describes will not happen.player()Returns the player involved in this event.voidsetCancelled(boolean cancelled) Prevents or re-allows the action this event describes.to()Returns the location the player is moving to.
-
Constructor Details
-
PlayerMoveEvent
-
-
Method Details
-
player
Description copied from interface:PlayerEventReturns the player involved in this event.- Specified by:
playerin interfacePlayerEvent- Returns:
- the player involved in this event
-
from
Returns the location before the move.- Returns:
- the location before the move
- Since:
- 0.1.0
-
to
Returns the location the player is moving to.- Returns:
- the location the player is moving to
- Since:
- 0.1.0
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableReturnstrueif the action this event describes will not happen.- Specified by:
isCancelledin interfaceCancellable- Returns:
trueif the action this event describes will not happen
-
setCancelled
public void setCancelled(boolean cancelled) Description copied from interface:CancellablePrevents or re-allows the action this event describes.- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancelled-trueto prevent it
-