Interface IForgePlayer
- All Known Implementing Classes:
AbstractClientPlayer,FakePlayer,LocalPlayer,Player,RemotePlayer,ServerPlayer
public interface IForgePlayer
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanChecks if the player can attack the passed entity.
On the server, additional leniency is added to account for movement/lag.default booleancanInteractWith(BlockPos pos, double padding) Checks if the player can reach (right-click) a block.
On the server, additional leniency is added to account for movement/lag.default booleancanInteractWith(Entity entity, double padding) Checks if the player can reach (right-click) the passed entity.
On the server, additional leniency is added to account for movement/lag.default doubleThe attack range is increased by 3 for creative players, unless it is currently zero, which disables attacks.default doubleThe reach distance is increased by 0.5 for creative players, unless it is currently zero, which disables interactions.default booleanisCloseEnough(Entity entity, double dist) Utility check to see if the player is close enough to a target entity.private Playerself()
-
Method Details
-
self
-
getAttackRange
default double getAttackRange()The attack range is increased by 3 for creative players, unless it is currently zero, which disables attacks.- Returns:
- The attack range of this player.
-
getReachDistance
default double getReachDistance()The reach distance is increased by 0.5 for creative players, unless it is currently zero, which disables interactions.- Returns:
- The reach distance of this player.
-
canHit
Checks if the player can attack the passed entity.
On the server, additional leniency is added to account for movement/lag.- Parameters:
entity- The entity being range-checked.padding- Extra validation distance.- Returns:
- If the player can attack the passed entity.
-
canInteractWith
Checks if the player can reach (right-click) the passed entity.
On the server, additional leniency is added to account for movement/lag.- Parameters:
entity- The entity being range-checked.padding- Extra validation distance.- Returns:
- If the player can interact with the passed entity.
-
isCloseEnough
Utility check to see if the player is close enough to a target entity.- Parameters:
entity- The entity being checked againstdist- The max distance allowed- Returns:
- If the eye-to-center distance between this player and the passed entity is less than dist.
-
canInteractWith
Checks if the player can reach (right-click) a block.
On the server, additional leniency is added to account for movement/lag.- Parameters:
pos- The position being range-checked.padding- Extra validation distance.- Returns:
- If the player can interact with this location.
-