Class ItemFrameEntity

java.lang.Object
org.geysermc.geyser.entity.type.Entity
org.geysermc.geyser.entity.type.ItemFrameEntity

public class ItemFrameEntity extends Entity
Item frames are an entity in Java but a block entity in Bedrock.
  • Constructor Details

    • ItemFrameEntity

      public ItemFrameEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, com.nukkitx.math.vector.Vector3f position, com.nukkitx.math.vector.Vector3f motion, float yaw, float pitch, float headYaw, com.github.steveice10.mc.protocol.data.game.entity.object.Direction direction)
  • Method Details

    • initializeMetadata

      protected void initializeMetadata()
      Description copied from class: Entity
      Called on entity spawn. Used to populate the entity metadata and flags with default values.
      Overrides:
      initializeMetadata in class Entity
    • spawnEntity

      public void spawnEntity()
      Overrides:
      spawnEntity in class Entity
    • setItemInFrame

      public void setItemInFrame(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata<com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack,​?> entityMetadata)
    • setItemRotation

      public void setItemRotation(com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntityMetadata entityMetadata)
    • despawnEntity

      public boolean despawnEntity()
      Description copied from class: Entity
      Despawns the entity
      Overrides:
      despawnEntity in class Entity
      Returns:
      can be deleted
    • updateBedrockMetadata

      public void updateBedrockMetadata()
      Description copied from class: Entity
      Sends the Bedrock metadata to the client
      Overrides:
      updateBedrockMetadata in class Entity
    • updateBlock

      public void updateBlock(boolean force)
      Updates the item frame as a block
    • interact

      public InteractionResult interact(com.github.steveice10.mc.protocol.data.game.entity.player.Hand hand)
      Description copied from class: Entity
      Simulates interacting with an entity. The code here should mirror Java Edition code to the best of its ability, to ensure packet parity as well as functionality parity (such as sound effect responses).
      Overrides:
      interact in class Entity
    • getItemFrameEntity

      public static ItemFrameEntity getItemFrameEntity(GeyserSession session, com.nukkitx.math.vector.Vector3i position)
      Finds the Java entity ID of an item frame from its Bedrock position.
      Parameters:
      position - position of item frame in Bedrock.
      session - GeyserConnection.
      Returns:
      Java entity ID or -1 if not found.
    • getHeldItem

      public com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack getHeldItem()
      The item currently in the item frame. Used for block picking.