Package net.minestom.server.event.player
Class PlayerMoveEvent
java.lang.Object
net.minestom.server.event.Event
net.minestom.server.event.CancellableEvent
net.minestom.server.event.player.PlayerMoveEvent
public class PlayerMoveEvent extends CancellableEvent
Called when a player is modifying his position.
-
Constructor Summary
Constructors Constructor Description PlayerMoveEvent(Player player, Position newPosition)
-
Method Summary
Modifier and Type Method Description Position
getNewPosition()
Gets the target position.Player
getPlayer()
Gets the player who is moving.void
setNewPosition(Position newPosition)
Changes the target position.
-
Constructor Details
-
Method Details
-
getPlayer
Gets the player who is moving.- Returns:
- the player
-
getNewPosition
Gets the target position.- Returns:
- the new position
-
setNewPosition
Changes the target position.- Parameters:
newPosition
- the new target position
-