-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some items with empty attribute list receive additional data after interacting with them in the inventory #10697
Comments
I just tested it. Shields, shulker_boxes, chests and potions appear to be fixed. Bee_nests, beehives and decorated_pots (and possibly other items) still gain some additional data after interacting with them:
So at least bee_nests and beehives don't get the empty bees list and decorated_pots don't get the default pot_decorations list anymore, which happened without this fix. This of course is a really unusual use case, because who would even put empty attribute lists on beehives or decorated pots. But yeah, items probably still shouldn't change their data after interacting with them, even if the data is very weird. |
A new (maybe unreleated) issue with changing data I just found: A lodestone compass with empty lodestone_tracker={} loses this component after interacting with the item. Interestingly, this component only appears to disappear for a compass and it stays on other kinds of items. And this empty list also causes additional data to appear on bee_nests/hives and decorated pots. |
While it shows up more in Paper, I think this is actually a vanilla issue. I opened an issue on the mojira and hopefully they pick it up. Not super great for us to fix it. I pushed a fix for the bee_nest issue, and a separate PR for the compass stuff (since it's a little more involved). |
Ok, so #10731 has a new build with what I think is a better fix that should handle extra data being added to items that are block entities (which was the source of several of these). There probably are still other places where extra data is added. |
Expected behavior
Moving an item in an inventory shouldn't change the item data
Observed/Actual behavior
Moving a shield with attribute_modifiers:{show_in_tooltip: 0b, modifiers:[]} adds banner_patterns:[] to the item components
Steps/models to reproduce
As requested in this bug report (#10686), here is the new bug report for the shield issue.
/give @p minecraft:shield[minecraft:attribute_modifiers={show_in_tooltip:0b,modifiers:[]}]
/data get entity @s SelectedItem
to confirm that the shield just has this component/data get entity @s SelectedItem
again and notice how the shield now also has the component banner_patterns:[]Plugin and Datapack List
No plugins or data packs
Paper version
This server is running Paper version git-Paper-64 (MC: 1.20.6) (Implementing API version 1.20.6-R0.1-SNAPSHOT) (Git: 6c02dbc)
You are running the latest version
Previous version: git-Paper-62 (MC: 1.20.6)
Other
An (incomplete) list of other affected items:
shulker_box, chest: receive empty container:[] component
potion: receives empty potion_contents:{} component
bee_nest, beehive: receive block_entity_data:{id:beehive,Bukkit.MaxEntities:3},bees:[]
decorated_pot: receives pot_decorations:[brick,brick,brick,brick],container:[]
The text was updated successfully, but these errors were encountered: