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 booleanequipmentUsableByEntity(GeyserSession session, org.geysermc.mcprotocollib.protocol.data.game.item.component.Equippable equippable, org.geysermc.mcprotocollib.protocol.data.game.entity.type.EntityType entity) static String[]static 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(@NonNull net.kyori.adventure.key.Key type, @NonNull GeyserSession session) static StringtranslatedEntityName(@Nullable org.geysermc.mcprotocollib.protocol.data.game.entity.type.EntityType type, @NonNull GeyserSession session) static voidupdateMountOffset(Entity passenger, Entity mount, boolean rider, boolean riding, int index, int passengers) Adjust an entity's height if they have mounted/dismounted an entity.static voidupdateRiderRotationLock(Entity passenger, Entity mount, boolean isRiding) static UUIDuuidFromIntArray(int[] uuid)
-
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
-
updateMountOffset
public static void updateMountOffset(Entity passenger, Entity mount, boolean rider, boolean riding, int index, int passengers) 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
public static String translatedEntityName(@NonNull net.kyori.adventure.key.Key type, @NonNull GeyserSession session) -
translatedEntityName
public static String translatedEntityName(@Nullable org.geysermc.mcprotocollib.protocol.data.game.entity.type.EntityType type, @NonNull GeyserSession session) -
equipmentUsableByEntity
public static boolean equipmentUsableByEntity(GeyserSession session, org.geysermc.mcprotocollib.protocol.data.game.item.component.Equippable equippable, org.geysermc.mcprotocollib.protocol.data.game.entity.type.EntityType entity) -
uuidFromIntArray
-