Package org.geysermc.geyser.util
Class EntityUtils
java.lang.Object
org.geysermc.geyser.util.EntityUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.geysermc.mcprotocollib.protocol.data.game.entity.player.Hand[]A constant array of the two hands that a player can interact with an entity. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanattemptToBucket(GeyserItemStack itemInHand) Determine if an action would result in a successful bucketing of the given entity.static InteractionResultattemptToSaddle(Entity entityToSaddle, GeyserItemStack itemInHand) Attempt to determine the result of saddling the given entity.static String[]static inttoBedrockEffectId(org.geysermc.mcprotocollib.protocol.data.game.entity.Effect effect) Convert Java edition effect IDs to Bedrock editionstatic org.cloudburstmc.protocol.bedrock.data.GameTypetoBedrockGamemode(org.geysermc.mcprotocollib.protocol.data.game.entity.player.GameMode gamemode) Convert Java GameMode to Bedrock GameType Needed to account for ordinal differences (spectator is 3 in Java, 6 in Bedrock)static StringtranslatedEntityName(net.kyori.adventure.key.Key type, GeyserSession session) static StringtranslatedEntityName(org.geysermc.mcprotocollib.protocol.data.game.entity.type.EntityType type, GeyserSession session) static voidupdateMountOffset(Entity passenger, Entity mount, boolean rider, boolean riding, boolean moreThanOneEntity) Adjust an entity's height if they have mounted/dismounted an entity.static voidupdateRiderRotationLock(Entity passenger, Entity mount, boolean isRiding)
-
Field Details
-
HANDS
public static final org.geysermc.mcprotocollib.protocol.data.game.entity.player.Hand[] HANDSA constant array of the two hands that a player can interact with an entity.
-
-
Method Details
-
getAllEffectIdentifiers
- Returns:
- a new String array of all known effect identifiers
-
toBedrockEffectId
public static int toBedrockEffectId(org.geysermc.mcprotocollib.protocol.data.game.entity.Effect effect) Convert Java edition effect IDs to Bedrock edition- Parameters:
effect- Effect to convert- Returns:
- The numeric ID for the Bedrock edition effect
-
updateMountOffset
public static void updateMountOffset(Entity passenger, Entity mount, boolean rider, boolean riding, boolean moreThanOneEntity) Adjust an entity's height if they have mounted/dismounted an entity. -
updateRiderRotationLock
-
attemptToBucket
Determine if an action would result in a successful bucketing of the given entity. -
attemptToSaddle
Attempt to determine the result of saddling the given entity. -
toBedrockGamemode
public static org.cloudburstmc.protocol.bedrock.data.GameType toBedrockGamemode(org.geysermc.mcprotocollib.protocol.data.game.entity.player.GameMode gamemode) Convert Java GameMode to Bedrock GameType Needed to account for ordinal differences (spectator is 3 in Java, 6 in Bedrock) -
translatedEntityName
-
translatedEntityName
public static String translatedEntityName(org.geysermc.mcprotocollib.protocol.data.game.entity.type.EntityType type, GeyserSession session)
-