Package io.papermc.paper.event.player
Class PlayerFailMoveEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
io.papermc.paper.event.player.PlayerFailMoveEvent
Runs when a player attempts to move, but is prevented from doing so by the server
-
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
ConstructorDescriptionPlayerFailMoveEvent
(Player player, PlayerFailMoveEvent.FailReason failReason, boolean allowed, boolean logWarning, Location from, Location to) -
Method Summary
Modifier and TypeMethodDescriptionGets the reason this movement was prevented by the servergetFrom()
Gets the location this player moved fromstatic HandlerList
boolean
Gets if warnings will be printed to console.getTo()
Gets the location this player tried to move toboolean
Gets if the check should be bypassed, allowing the movementvoid
setAllowed
(boolean allowed) Set if the check should be bypassed and the movement should be allowedvoid
setLogWarning
(boolean logWarning) Set if a warning is printed to console.Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayer
Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PlayerFailMoveEvent
@Internal public PlayerFailMoveEvent(Player player, PlayerFailMoveEvent.FailReason failReason, boolean allowed, boolean logWarning, Location from, Location to)
-
-
Method Details
-
getFailReason
Gets the reason this movement was prevented by the server- Returns:
- The reason the movement was prevented
-
getFrom
Gets the location this player moved from- Returns:
- Location the player moved from
-
getTo
Gets the location this player tried to move to- Returns:
- Location the player tried to move to
-
isAllowed
public boolean isAllowed()Gets if the check should be bypassed, allowing the movement- Returns:
- whether to bypass the check
-
setAllowed
public void setAllowed(boolean allowed) Set if the check should be bypassed and the movement should be allowed- Parameters:
allowed
- whether to bypass the check
-
getLogWarning
public boolean getLogWarning()Gets if warnings will be printed to console. e.g. "Player123 moved too quickly!"- Returns:
- whether to log warnings
-
setLogWarning
public void setLogWarning(boolean logWarning) Set if a warning is printed to console. e.g. "Player123 moved too quickly!"- Parameters:
logWarning
- whether to log warnings
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-