mojira.dev
MC-307926

Items with conflicting components disappear entirely instead of attempting to resolve the conflict

Currently the only conflicting components are Max Stack Size and Max Damage. Items with both these components can exist, but in many cases where the conflict is detected, they are instantly deleted in a way that doesn’t really resolve the issue.

Spawning an item with conflicting components cannot be done using /give, but they can be obtained when they already exist in the world, or are spawned using /data modify to create them. To do so, you could drop any item with durability, such as a pickaxe, then run /data modify @n[type=item] Item.components.”minecraft:max_stack_size” set value 99. This behavior is Won’t Fix per MC-301423.

Other than durability decreasing in the whole stack at once, items spawned this way work just fine. If a validation check has to be run, such as the one added to the ItemStack and Item.Properties classes in 26.1, the expected result would be for the item to remove the conflicting parts of its data. If an item has Max_Stack_Size, automatically remove Max_Damage, or vice versa.

However, the current behavior is that, in the few contexts that the validation check is run, the item will be forcefully replaced with an empty itemstack of air, including when an empty stack isn’t supported. (For example this validation check can run in the bundle and leads to another bug, MC-306072, which causes the client to crash because bundles cannot contain air.)

This is much more destructive to preexisting worlds with custom component-modified items that don’t meet validation criteria. (It is also less consistent with the way other types of data are handled. When data modifying an entity to have an invalid tag, only that invalid tag is removed, not the entire entity.) Items shouldn’t just disappear on their own.

Linked issues

Comments 3

We do not have enough information to reproduce this issue.

Please include the following information to help us understand your problem:

Steps to Reproduce:

  1. (Explain what needs to be done for the issue to happen)

Observed Results:
(Briefly describe what happens)

Expected Results:
(Briefly describe what should happen)

Please also attach any needed commands, add-ons/behavior packs, data packs, resource packs, screenshots, videos, or worlds needed to help reproduce this issue.

Refer to the Bug Tracker Guidelines for more information about how to write helpful bug reports. Bug reports with insufficient information may be closed as Incomplete.

This issue is being temporarily resolved as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.
Quick Links:
📓 Bug Tracker Guidelines -- 💬 Community Support -- 📧 Mojang Support (Technical Issues) -- 📧 Microsoft Support (Account Issues) -- 📓 Project Summary -- ✍️ Feedback and Suggestions -- 📖 Game Wiki

To make my previous submission more brief:

Steps to reproduce:

  1. Drop damagable item, like a golden hoe.

  2. Run command /data modify entity @n[type=item] Item.components.”minecraft:max_stack_size” set value 99

  3. Pick up the item and attempt to place it in either a shulker box or bundle. View tooltip of the storage item.

Observed result: Item is replaced with air. (In bundles this can trigger a crash which was reported in MC-306072, but this report I am making is about the items being replaced with air, not the bundle crash that causes.)

Expected results: Rather than the entire item and all attached data being removed, only the component resulting in a conflict, such as max_damage, is removed.

Watermelon_Sir

(Unassigned)

Plausible

Platform

Normal

Commands, Items

26.1.2, 26.3

Retrieved