Problem
Before the change over to data components, the HideFlags nbt could be set without having to set any data that would be hidden by the flag. However, now that the show_in_tooltip
is part of the attributes data component (and a bunch of others), you have to actually set some attributes in order to change it to false.
Steps to Reproduce
/give @s wooden_pickaxe[minecraft:attribute_modifiers={show_in_tooltip:0b,modifiers:[]}]
This command gives you a wooden pickaxe that hides the modifiers, but in order to do so, you have to actually set the modifiers list to an empty list, which now removes the default modifiers.
Use the attached datapack with an item modifier and run that modifier on the item in your hand. The
toggle_tooltips
function does hide the tooltips while keeping the modifiers, but the implicit modifiers for that item type are copied over to the stack itself, so future changes to the default of the stack won't affect this stack.
Incorrect Solutions
You cannot just set an empty list of attributes because that overrides the implicit attributes (for non-armor items – see MC-271826). Setting an empty list of attributes just removes the attributes
Copying over the default attributes makes the item not inherit changes to the default attributes made by the game in different versions. If all I want to do is hide the attributes and ensure the default attributes are still used, I can't copy them over
This should, therefore, be considered a regression in behavior as you could do this pre-data components.
Other data components suffer from the same issue, however none of the other data components that have included tooltip toggles have implicit values for an item type while the attributes one does.
Possible Solution
Making the attribute modifier list an "optional" to signify that no modifiers have been set introduces a new state separate from an empty list. Setting an empty list still should mean you want no modifiers, but an empty optional means fallback to the possible implicit data components
Could split out the hide tooltip into a separate data component.
Attachments
Comments 7
Using the toggle_tooltips
item modifier does succesfully hide the attribute modifiers (I've linked a datapack with such a function), but it still behaves as described above. It has to manually copy over the default values into the stack's data (use /data get entity @s SelectedItem
to see the stack's components in NBT). This violates the 2nd of what I consider incorrect solutions because the itemstack no longer has the "default" attributes for a specific item type and any changes to those defaults would no longer be reflected in the itemstack.
This issue is being temporarily resolved as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.
> Use the attached datapack with an item modifier and run that modifier on the item in your hand
What's the command for this? Having every command needed to reproduce the issue would be good.
Can confirm. To be able to just hide the default values (e.g. hiding Attack Damage & Attack Speed of a Sword), you'll have to add the default values as a new attribute modifier.
A syntax like
/give @s netherite_sword[attribute_modifiers={show_in_tooltip:false}]
would help a lot. Currently you would need to add all default modifiers, which would be something like
/give @p netherite_sword[attribute_modifiers={modifiers:[{"type": "minecraft:generic.attack_damage","amount": 7.0,"id": "minecraft:base_attack_damage","operation": "add_value","slot": "mainhand"},{"type": "minecraft:generic.attack_speed","amount": -2.4000000953674316,"id": "minecraft:base_attack_speed","operation": "add_value","slot": "mainhand"}],show_in_tooltip:false}]
This is much more difficult and most importantly changes based of every item type.
Thank you for your report!
After consideration, the issue is being closed as Invalid.
You have posted a feature request or a suggestion. This site is for bug reports only.
For suggestions, please visit The official Minecraft feedback site or visit the Minecraft Feedback Discord server.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
Can you give an example of how using the toggle_tooltips item modifier fails here?