Interface GeyserConnection
- All Superinterfaces:
CommandSource,org.geysermc.api.connection.Connection
Represents a player connection used in Geyser.
-
Method Summary
Modifier and TypeMethodDescription@NonNull CompletableFuture<@Nullable GeyserEntity>entityByJavaId(@org.checkerframework.checker.index.qual.NonNegative int javaId) Returns an immutable copy of all fog affects currently applied to this client.voidRemoves the given fog IDs from the fog cache, then sends all fog IDs in the cache to the client.voidAdds the given fog IDs to the fog cache, then sends all fog IDs in the cache to the client.voidshakeCamera(float intensity, float duration, @NonNull CameraShake type) Shakes the client's camera.
If the camera is already shaking with the sameCameraShaketype, then the additional intensity will be layered on top of the existing intensity, with their own distinct durations.
If the existing shake type is different and the new intensity/duration are not positive, the existing shake only switches to the new type.voidshowEmote(@NonNull GeyserPlayerEntity emoter, @NonNull String emoteId) Displays a player entity as emoting to this client.voidStops all camera shake of any type.Methods inherited from interface org.geysermc.geyser.api.command.CommandSource
hasPermission, isConsole, locale, name, sendMessage, sendMessageMethods inherited from interface org.geysermc.api.connection.Connection
bedrockUsername, inputMode, isLinked, javaUsername, javaUuid, languageCode, platform, sendForm, sendForm, transfer, uiProfile, version, xuid
-
Method Details
-
entityByJavaId
@NonNull CompletableFuture<@Nullable GeyserEntity> entityByJavaId(@org.checkerframework.checker.index.qual.NonNegative int javaId) - 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 emoting.emoteId- the emote ID to send to this client.
-
shakeCamera
Shakes the client's camera.
If the camera is already shaking with the sameCameraShaketype, then the additional intensity will be layered on top of the existing intensity, with their own distinct durations.
If the existing shake type is different and the new intensity/duration are not positive, the existing shake only switches to the new type. Otherwise, the existing shake is completely overridden.- Parameters:
intensity- the intensity of the shake. The client has a maximum total intensity of 4.duration- the time in seconds that the shake will occur fortype- the type of shake
-
stopCameraShake
void stopCameraShake()Stops all camera shake of any type. -
sendFog
Adds the given fog IDs to the fog cache, then sends all fog IDs in the cache to the client.Fog IDs can be found here
- Parameters:
fogNameSpaces- the fog IDs to add. If empty, the existing cached IDs will still be sent.
-
removeFog
Removes the given fog IDs from the fog cache, then sends all fog IDs in the cache to the client.- Parameters:
fogNameSpaces- the fog IDs to remove. If empty, all fog IDs will be removed.
-
fogEffects
Returns an immutable copy of all fog affects currently applied to this client.
-