Skip to content

[feature] Expose ItemInventoryComponent for ItemStack (bundle/bag contents access) #404

@fruit-jazz

Description

@fruit-jazz

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions