Class EntityUtils

java.lang.Object
org.geysermc.geyser.util.EntityUtils

public final class EntityUtils extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static com.github.steveice10.mc.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 Type
    Method
    Description
    static boolean
    Determine if an action would result in a successful bucketing of the given entity.
    attemptToSaddle​(Entity entityToSaddle, GeyserItemStack itemInHand)
    Attempt to determine the result of saddling the given entity.
    static String[]
     
    static int
    toBedrockEffectId​(com.github.steveice10.mc.protocol.data.game.entity.Effect effect)
    Convert Java edition effect IDs to Bedrock edition
    static org.cloudburstmc.protocol.bedrock.data.GameType
    toBedrockGamemode​(com.github.steveice10.mc.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 void
    updateMountOffset​(Entity passenger, Entity mount, boolean rider, boolean riding, boolean moreThanOneEntity)
    Adjust an entity's height if they have mounted/dismounted an entity.
    static void
    updateRiderRotationLock​(Entity passenger, Entity mount, boolean isRiding)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • HANDS

      public static final com.github.steveice10.mc.protocol.data.game.entity.player.Hand[] HANDS
      A constant array of the two hands that a player can interact with an entity.
  • Method Details

    • getAllEffectIdentifiers

      public static String[] getAllEffectIdentifiers()
      Returns:
      a new String array of all known effect identifiers
    • toBedrockEffectId

      public static int toBedrockEffectId(com.github.steveice10.mc.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

      public static void updateRiderRotationLock(Entity passenger, Entity mount, boolean isRiding)
    • attemptToBucket

      public static boolean attemptToBucket(GeyserItemStack itemInHand)
      Determine if an action would result in a successful bucketing of the given entity.
    • attemptToSaddle

      public static InteractionResult attemptToSaddle(Entity entityToSaddle, GeyserItemStack itemInHand)
      Attempt to determine the result of saddling the given entity.
    • toBedrockGamemode

      public static org.cloudburstmc.protocol.bedrock.data.GameType toBedrockGamemode(com.github.steveice10.mc.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)