Interface GeyserConnection
- All Superinterfaces:
CommandSource
,org.geysermc.api.connection.Connection
Represents a player connection used in Geyser.
-
Method Summary
Modifier and TypeMethodDescription@NonNull CameraData
camera()
Exposes theCameraData
for this connection.void
Closes the currently open form on the client.@NonNull EntityData
entities()
Exposes theEntityData
for this connection.@NonNull CompletableFuture<@Nullable GeyserEntity>
entityByJavaId
(@org.checkerframework.checker.index.qual.NonNegative int javaId) Deprecated.Deprecated.UseCameraData.fogEffects()
instead.int
ping()
Returns the current ping of the connection.int
Gets the Bedrock protocol version of the player.void
Deprecated.UseCameraData.removeFog(String...)
instead.void
Deprecated.UseCameraData.sendFog(String...)
instead.void
shakeCamera
(float intensity, float duration, @NonNull CameraShake type) Deprecated.UseCameraData.shakeCamera(float, float, CameraShake)
instead.void
showEmote
(@NonNull GeyserPlayerEntity emoter, @NonNull String emoteId) Deprecated.useEntityData.showEmote(GeyserPlayerEntity, String)
insteadvoid
Deprecated.UseCameraData.stopCameraShake()
instead.Methods inherited from interface org.geysermc.geyser.api.command.CommandSource
connection, hasPermission, isConsole, locale, name, playerUuid, sendMessage, sendMessage
Methods inherited from interface org.geysermc.api.connection.Connection
bedrockUsername, inputMode, isLinked, javaUsername, javaUuid, languageCode, platform, sendForm, sendForm, transfer, uiProfile, version, xuid
-
Method Details
-
camera
@NonNull CameraData camera()Exposes theCameraData
for this connection. It allows you to send fogs, camera shakes, force camera perspectives, and more.- Returns:
- the CameraData for this connection.
-
entities
@NonNull EntityData entities()Exposes theEntityData
for this connection. It allows you to get entities by their Java entity ID, show emotes, and get the player entity.- Returns:
- the EntityData for this connection.
-
ping
int ping()Returns the current ping of the connection. -
closeForm
void closeForm()Closes the currently open form on the client. -
protocolVersion
int protocolVersion()Gets the Bedrock protocol version of the player. -
entityByJavaId
@Deprecated @NonNull CompletableFuture<@Nullable GeyserEntity> entityByJavaId(@org.checkerframework.checker.index.qual.NonNegative int javaId) Deprecated.UseEntityData.entityByJavaId(int)
instead- Parameters:
javaId
- the Java entity ID to look up.- Returns:
- a
GeyserEntity
if present in this connection's entity tracker.
-
showEmote
Deprecated.useEntityData.showEmote(GeyserPlayerEntity, String)
insteadDisplays a player entity as emoting to this client.- Parameters:
emoter
- the player entity emoting.emoteId
- the emote ID to send to this client.
-
shakeCamera
Deprecated.UseCameraData.shakeCamera(float, float, CameraShake)
instead.Shakes the client's camera.If the camera is already shaking with the same
CameraShake
type, 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
Deprecated.UseCameraData.stopCameraShake()
instead.Stops all camera shake of any type. -
sendFog
Deprecated.UseCameraData.sendFog(String...)
instead.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
Deprecated.UseCameraData.removeFog(String...)
instead.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
Deprecated.UseCameraData.fogEffects()
instead.Returns an immutable copy of all fog affects currently applied to this client.
-
EntityData.entityByJavaId(int)
instead