mojira.dev
MCPE-244268

Script API - Item Inventory Shulker Tooltip Count

A shulker box item whose contents were written through the beta script API (ItemInventoryComponent.container, shulker box support added in Preview 26.70.24) shows a wrong item count in its hover tooltip. With a single diamond inside, the tooltip reads "Diamond x1" followed by "and 22 more...". The contents themselves are correct: placed and opened, the box holds only the diamond. Breaking the placed box and picking it up again gives an item whose tooltip is correct ("Diamond x1" only), and writing to that item from script again brings the wrong count back. The count is always 22, whatever the box holds. A box filled by hand with six stacks correctly reads "and 1 more..."; a box holding five stacks of planks that then gets one diamond from script (six stacks in total) reads "and 22 more..." instead of "and 1 more...". 22 is 27 - 5: the tooltip lists up to five stacks and then counts the rest, so it appears to be counting all 27 slots of the box, including the empty ones, once the contents have been written from script.

Steps to reproduce

  1. Import the attached script_api_item_inventory_shulker_tooltip_count.mcaddon and create a flat creative world with both packs applied and the **Beta APIs** experiment enabled.

  2. Run /ss_iis:bug_report without a shulker box in your main hand. The script creates an empty white shulker box, adds one diamond to it with box.getComponent('minecraft:inventory').container.addItem(...), and puts the box in your main hand. (If you are already holding a shulker box, the script adds one diamond to that box instead.)

  3. Open your inventory and hover the shulker box.

  1. Place the box, open it to check its contents, then break it, pick it up and hover it again.

  2. Hold that box and run /ss_iis:bug_report again, which adds a second diamond to the held box, then hover it.

  3. Optional: fill a shulker box by hand with five stacks, break it, hold it and run /ss_iis:bug_report, then hover it.

Expected result

The tooltip lists only the stacks in the box: "Diamond x1" after step 2, and "Diamond x2" after step 5.

Observed result

  • Step 3: "Diamond x1" followed by "and 22 more...", although the command output reports 26 empty slots and a single 1x minecraft:diamond.

  • Step 4: the placed box contains only the diamond, and after it is broken and picked up the tooltip correctly reads "Diamond x1".

  • Step 5: "Diamond x2" followed by "and 22 more..." again. Placing and breaking the box corrects the tooltip to "Diamond x2".

  • Step 6: the five stacks followed by "and 22 more..." where "and 1 more..." is expected. The command output lists six occupied slots and 21 empty ones.

Attachments

Comments 2

Thank you for helping us improve Minecraft! We saved your files:

[media]

Mojira didn’t allow me to attach this video the first time around.

SmokeyStack

(Unassigned)

Unconfirmed

Windows

11

26.70.24 Preview

Retrieved