API interface for interacting with EssentialsC's fly system. EssentialsC persists
fly state across sessions — players who were flying when they disconnected will
have flight restored on their next join, unless they hold the
essentialsc.fly.disable-on-join permission.
Retrieve an instance via EssentialsCAPI.getFlyApi().
FlyApi fly = APIProvider.getAPI().getFlyApi();
if (!fly.isFlying(player)) {
fly.setFlying(player, true);
}
Method Summary
| boolean |
isFlying(Player player) Returns whether the given player currently has flight enabled. |
| boolean |
hasPersistentFly(UUID uuid) Returns whether the given player is flagged to have fly restored on next join. |
| Set<UUID> |
getPersistentFlyPlayers() Returns a snapshot of all UUIDs queued for fly restoration on next join. |
| void |
setFlying(Player player, boolean flying) Enables or disables flight for the given player. |
| void |
toggleFlying(Player player) Toggles flight for the given player. |
| void |
setPersistentFly(UUID uuid, boolean persistent) Sets whether the given player's fly state will be restored on their next join. |
Returns whether the given player currently has flight enabled.
This checks both allowFlight and the active flying state on the player, so it returns true only when the player can and is actively flying.
| player | the player to check; must not be null |
| boolean | true if the player is currently flying |
Returns whether the given player is flagged to have their fly state restored on their next join.
Players are added to this set when they disconnect while flying. The flag is cleared once they reconnect and flight is restored.
Parameters:| uuid | the UUID of the player; must not be null |
| boolean | true if flight will be restored for this player on next join |
Returns a snapshot of the UUIDs of all players whose fly state is queued for restoration on next join.
The returned set is not backed by the internal state — modifications have no effect.
Returns:| Set<UUID> | an unmodifiable set of UUIDs; never null, may be empty |
Enables or disables flight for the given player.
When enabling, both allowFlight and the active fly state are set. When disabling, both are cleared. This does not affect the persistent fly flag — use setPersistentFly(UUID, boolean) if you also want to control session restoration.
| player | the player to modify; must not be null and must be online |
| flying | true to enable flight, false to disable it |
Toggles flight for the given player.
Equivalent to setFlying(player, !isFlying(player)).
| player | the player to toggle; must not be null and must be online |
Sets whether the given player's fly state will be restored on their next join.
Set to true to add the player to the persistence set, false to remove them. Changes are written to disk immediately.
| uuid | the UUID of the player; must not be null |
| persistent | true to persist fly across the next session, false to clear the flag |