Package org.geysermc.geyser.api.entity
Interface EntityData
public interface EntityData
This class holds all the methods that relate to entities.
Can be accessed through
GeyserConnection.entities().-
Method Summary
Modifier and TypeMethodDescription@NonNull CompletableFuture<@Nullable GeyserEntity> entityByJavaId(@org.checkerframework.checker.index.qual.NonNegative int javaId) Returns aGeyserEntityto e.g.booleanReturns whether the client's movement is currently locked.booleanlockMovement(boolean lock, @NonNull UUID owner) (Un)locks the client's movement inputs, so that they cannot move.@NonNull GeyserPlayerEntityGets theGeyserPlayerEntityof this connection.voidshowEmote(@NonNull GeyserPlayerEntity emoter, @NonNull String emoteId) Displays a player entity as emoting to this client.voidSends a request to the Java server to switch the items in the main and offhand.
-
Method Details
-
entityByJavaId
@NonNull CompletableFuture<@Nullable GeyserEntity> entityByJavaId(@org.checkerframework.checker.index.qual.NonNegative int javaId) Returns aGeyserEntityto e.g. make them play an emote.- Parameters:
javaId- the Java entity ID to look up- Returns:
- a
GeyserEntityif present in this connection's entity tracker
-
showEmote
Displays a player entity as emoting to this client.- Parameters:
emoter- the player entity emotingemoteId- the emote ID to send to this client
-
playerEntity
@NonNull GeyserPlayerEntity playerEntity()Gets theGeyserPlayerEntityof this connection.- Returns:
- the
GeyserPlayerEntityof this connection
-
lockMovement
(Un)locks the client's movement inputs, so that they cannot move. To ensure that movement is only unlocked when all locks are released, you must supply a UUID with this method, and use the same UUID to unlock the camera.- Parameters:
lock- whether to lock the movementowner- the owner of the lock- Returns:
- if the movement is locked after this method call
-
isMovementLocked
boolean isMovementLocked()Returns whether the client's movement is currently locked.- Returns:
- whether the movement is locked
-
switchHands
void switchHands()Sends a request to the Java server to switch the items in the main and offhand. There is no guarantee of the server accepting the request.
-