Package org.geysermc.geyser.api.entity
Interface EntityData
public interface EntityData
Provides entity lookup and input-lock utilities for a specific connection.
Accessed via
GeyserConnection.entities().-
Method Summary
Modifier and TypeMethodDescription@Nullable GeyserEntitybyGeyserId(@org.checkerframework.checker.index.qual.NonNegative long geyserId) Returns theGeyserEntityfor the given Geyser runtime entity ID if it is tracked in this connection's entity cache, ornullif not found.@Nullable GeyserEntitybyJavaId(@org.checkerframework.checker.index.qual.NonNegative int javaId) Returns theGeyserEntityfor the given Java entity ID if it is tracked in this connection's entity cache, ornullif not found.@Nullable GeyserEntityReturns theGeyserEntityfor the given Java entity UUID if it is tracked in this connection's entity cache, ornullif not found.CompletableFuture<@Nullable GeyserEntity> entityByJavaId(@org.checkerframework.checker.index.qual.NonNegative int javaId) Deprecated, for removal: This API element is subject to removal in a future version.booleanReturns whether the client's movement is currently locked.booleanlockMovement(boolean lock, UUID owner) (Un)locks the client's movement inputs, so that they cannot move.Deprecated, for removal: This API element is subject to removal in a future version.UseGeyserConnection.playerEntity()instead.default voidshowEmote(GeyserPlayerEntity emoter, String emoteId) Deprecated, for removal: This API element is subject to removal in a future version.since 2.9.3: useGeyserConnection.showEmote(GeyserPlayerEntity, String)insteadvoidDeprecated, for removal: This API element is subject to removal in a future version.since 2.9.3: useGeyserConnection.requestOffhandSwap()instead
-
Method Details
-
entityByJavaId
@Deprecated(since="2.11.0", forRemoval=true) CompletableFuture<@Nullable GeyserEntity> entityByJavaId(@org.checkerframework.checker.index.qual.NonNegative int javaId) Deprecated, for removal: This API element is subject to removal in a future version.since 2.11.0: usebyJavaId(int)This method is deprecated for removal and will be removed in Geyser 2.13.0.- Since:
- 2.3.0
-
byJavaId
@Experimental @Nullable GeyserEntity byJavaId(@org.checkerframework.checker.index.qual.NonNegative int javaId) Returns theGeyserEntityfor the given Java entity ID if it is tracked in this connection's entity cache, ornullif not found.- Parameters:
javaId- the Java entity ID to look up- Returns:
- the entity, or
nullif not found - Since:
- 2.11.0
-
byUuid
Returns theGeyserEntityfor the given Java entity UUID if it is tracked in this connection's entity cache, ornullif not found.- Parameters:
javaUuid- the Java entity UUID to look up- Returns:
- the entity, or
nullif not found - Since:
- 2.11.0
-
byGeyserId
@Experimental @Nullable GeyserEntity byGeyserId(@org.checkerframework.checker.index.qual.NonNegative long geyserId) Returns theGeyserEntityfor the given Geyser runtime entity ID if it is tracked in this connection's entity cache, ornullif not found.- Parameters:
geyserId- the Geyser entity ID (as returned byGeyserEntity.geyserId())- Returns:
- the entity, or
nullif not found - Since:
- 2.11.0
-
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
Deprecated, for removal: This API element is subject to removal in a future version.since 2.9.3: useGeyserConnection.requestOffhandSwap()insteadThis method is deprecated for removal and will be removed in Geyser 2.13.0. -
showEmote
@Deprecated(since="2.9.3", forRemoval=true) default void showEmote(GeyserPlayerEntity emoter, String emoteId) Deprecated, for removal: This API element is subject to removal in a future version.since 2.9.3: useGeyserConnection.showEmote(GeyserPlayerEntity, String)insteadThis is the equivalent ofGeyserAvatarEntity.showEmote(String, boolean), with the emote chat announcement silencing set to false.This method is deprecated for removal and will be removed in Geyser 2.13.0.
-
playerEntity
Deprecated, for removal: This API element is subject to removal in a future version.UseGeyserConnection.playerEntity()instead.This method is deprecated for removal and will be removed in Geyser 2.13.0.
-
byJavaId(int)