@minecraft/server
    Preparing search index...

    Class BlockItemFrameComponentBeta

    Represents the frame holding an item of a block in the world. You can replace the item, remove it, drop it into the world, or get and set its rotation.

    Hierarchy (View Summary)

    Index

    Properties

    block: Block

    Block instance that this component pertains to.

    isValid: boolean

    Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component.

    typeId: string

    Identifier of the component.

    componentId: "minecraft:item_frame" = 'minecraft:item_frame'

    Methods

    • Beta

      Returns void

      Removes the framed item and drops it into the world.

      no-restricted-execution - This function can't be called in restricted-execution mode.

      This function can throw errors.

      InvalidBlockComponentError

    • Beta

      Returns ItemStack | undefined

      The framed item stack, or undefined if the frame is empty.

      Gets the item stack currently displayed in the frame.

      This function can throw errors.

      InvalidBlockComponentError

    • Beta

      Parameters

      • OptionalitemStack: ItemStack

        The item stack to display in the frame, or undefined to clear it without dropping it.

      Returns void

      Sets or replaces the item displayed in the frame. Pass undefined to remove the item without dropping it.

      no-restricted-execution - This function can't be called in restricted-execution mode.

      This function can throw errors.

      InvalidBlockComponentError

    • Beta

      Parameters

      Returns void

      Sets the rotation of the item frame.

      no-restricted-execution - This function can't be called in restricted-execution mode.

      This function can throw errors.

      InvalidBlockComponentError