Summary
Currently, ItemStack in the Python API does not expose item components,
making it impossible to read the contents of bundles (minecraft:bundle,
minecraft:red_bundle, etc.).
Problem
Bundles store their contents server-side via a bundle_id reference in NBT:
{bundle_id: 76}
The actual item contents are not accessible through item.nbt, item.item_meta,
or any other currently exposed API.
Bedrock Scripting API equivalent
The Bedrock addon API already exposes this functionality:
item.getComponent(ItemComponentTypes.Inventory).container.getItem(0)
Requested API
component = item.get_component("minecraft:inventory") # or ItemComponentTypes.Inventory
container = component.container
for i in range(container.size):
slot_item = container.get_item(i)
Use case
Inventory backup plugins need to serialize and restore full player inventories
including bundle contents for cross-server transfer and death recovery systems.
Environment
Endstone version: latest
Platform: Windows (BDS)
Summary
Currently,
ItemStackin the Python API does not expose item components,making it impossible to read the contents of bundles (
minecraft:bundle,minecraft:red_bundle, etc.).Problem
Bundles store their contents server-side via a
bundle_idreference in NBT:{bundle_id: 76}
The actual item contents are not accessible through
item.nbt,item.item_meta,or any other currently exposed API.
Bedrock Scripting API equivalent
The Bedrock addon API already exposes this functionality: