@minecraft
    正在准备搜索索引...

    类 ItemBlockEntityStorageComponent实验性

    Stores serialized non-player mobs on an item stack. Each calling behavior pack can only access its manifest UUID bucket. All buckets share a four-entity limit. Available on item stacks even when empty. Destroying the item discards its storage without spawning entities. Data is compatible with entity-storage block carry-over and placement.

    层级 (查看层级一览)

    索引
    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:block_entity_storage" = 'minecraft:block_entity_storage'
    • 世界修改

      参数

      • entityId: string

        A stored entity ID in the calling pack's bucket.

      • location: DimensionLocation

        The target DimensionLocation. Must be finite, within world bounds, and in a loaded, ticking chunk.

      返回 Entity

      The spawned entity.

      Releases a stored mob at the supplied dimension and world position. Does not require a block target. The serialized position is replaced before the actor is loaded. Removes the entry from this item after spawning it.

      Throws for an invalid item, ID, dimension, or location, a missing entity, or a load or spawn failure. Failed releases preserve serialized storage.

      Error

      InvalidItemStackError

      LocationInUnloadedChunkError

      LocationOutOfWorldBoundariesError

    • 返回 number

      The number of entities in this pack's bucket, or zero if empty.

      Returns the number of serialized entities in the calling pack's manifest UUID bucket.

      Throws if the item is invalid or its entity-storage format is unsupported.

      Error

      InvalidItemStackError

    • 世界修改

      参数

      • entity: Entity

        The live mob to store.

      返回 string

      The stored entity ID, used for inspection, release, or transfer.

      Serializes and despawns a non-player mob into the calling pack's item storage. Mounted entities and entities with passengers cannot be stored.

      Throws if the item or entity is invalid, storage is full, the entity is already stored, serialization fails, or the entity is not allowed. Rejected entities remain in the world.

      Error

      InvalidItemStackError

    • 世界修改

      参数

      • entityId: string

        A stored entity ID in the calling pack's bucket.

      • targetBlock: Block

        A loaded block with an entity-storage component and available capacity.

      返回 void

      Moves serialized ownership from the calling pack's item bucket into the same bucket of a block's entity-storage without loading or spawning the entity. The target can be in any dimension and must have entity storage.

      Throws for an invalid item, ID, or target, a missing entity, full target storage, or an ID already stored at the target. Failure preserves both owners.

      Error

      InvalidItemStackError

      LocationInUnloadedChunkError

      LocationOutOfWorldBoundariesError