Script API - v26.70.22
    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.

    export class BlockItemFrameComponent extends BlockComponent {
    private constructor();
    static readonly componentId = 'minecraft:item_frame';
    dropFramedItem(): void;
    getFramedItem(): ItemStack | undefined;
    getRotation(): ItemFrameRotation;
    setFramedItem(itemStack?: ItemStack): void;
    setRotation(rotation: ItemFrameRotation): void;
    }

    Hierarchy (View Summary)

    Index
    block: Block

    Block instance that this component pertains to.

    This property can't be read in early-execution mode.

    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.

    This property can't be read in early-execution mode.

    typeId: string

    Identifier of the component.

    This property can't be read in early-execution mode.

    componentId: "minecraft:item_frame" = 'minecraft:item_frame'
    • 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

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

    • 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

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

    • 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

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