Package org.geysermc.geyser.entity.type
Class ItemFrameEntity
java.lang.Object
org.geysermc.geyser.entity.type.Entity
org.geysermc.geyser.entity.type.ItemFrameEntity
- All Implemented Interfaces:
org.geysermc.geyser.api.entity.type.GeyserEntity
Item frames are an entity in Java but a block entity in Bedrock.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionItemFrameEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, org.cloudburstmc.math.vector.Vector3f position, org.cloudburstmc.math.vector.Vector3f motion, float yaw, float pitch, float headYaw, com.github.steveice10.mc.protocol.data.game.entity.object.Direction direction) -
Method Summary
Modifier and TypeMethodDescriptionbooleanDespawns the entitycom.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStackThe item currently in the item frame.static ItemFrameEntitygetItemFrameEntity(GeyserSession session, org.cloudburstmc.math.vector.Vector3i position)Finds the Java entity ID of an item frame from its Bedrock position.protected voidCalled on entity spawn.interact(com.github.steveice10.mc.protocol.data.game.entity.player.Hand hand)Simulates interacting with an entity.voidsetItemInFrame(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata<com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack,?> entityMetadata)voidsetItemRotation(com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntityMetadata entityMetadata)voidvoidSends the Bedrock metadata to the clientvoidupdateBlock(boolean force)Updates the item frame as a blockMethods inherited from class org.geysermc.geyser.entity.type.Entity
addAdditionalSpawnData, as, getBedrockRotation, getBoundingBoxHeight, getBoundingBoxWidth, getDefinition, getDirtyMetadata, getEntityId, getFlag, getGeyserId, getHeadYaw, getMaxAir, getMotion, getNametag, getPassengers, getPitch, getPosition, getSession, getUuid, getVehicle, getYaw, interactAt, isAlive, isOnGround, isShaking, isSilent, isValid, javaId, moveAbsolute, moveAbsolute, moveRelative, moveRelative, playEntityEvent, playEntityEvent, setAir, setAirSupply, setBoundingBoxHeight, setBoundingBoxWidth, setClientSideSilent, setDefinition, setDimensions, setDisplayName, setDisplayNameVisible, setEntityId, setFlag, setFlags, setFlagsDirty, setFreezing, setGravity, setHeadYaw, setInvisible, setMotion, setOnGround, setPassengers, setPitch, setPose, setPosition, setRiderSeatPosition, setSilent, setUuid, setValid, setVehicle, setYaw, teleport, testInteraction, updateHeadLookRotation, updateInteractiveTag, updateMountOffset, updatePassengerOffsets, updatePositionAndRotation, updateRotation
-
Constructor Details
-
ItemFrameEntity
public ItemFrameEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, org.cloudburstmc.math.vector.Vector3f position, org.cloudburstmc.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:EntityCalled on entity spawn. Used to populate the entity metadata and flags with default values.- Overrides:
initializeMetadatain classEntity
-
spawnEntity
public void spawnEntity()- Overrides:
spawnEntityin classEntity
-
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:EntityDespawns the entity- Overrides:
despawnEntityin classEntity- Returns:
- can be deleted
-
updateBedrockMetadata
public void updateBedrockMetadata()Description copied from class:EntitySends the Bedrock metadata to the client- Overrides:
updateBedrockMetadatain classEntity
-
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:EntitySimulates 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). -
getItemFrameEntity
public static ItemFrameEntity getItemFrameEntity(GeyserSession session, org.cloudburstmc.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.
-