Item with tag HIDE_ATTRIBUTES should not show attributes:
Observed/Actual behavior
Item with tag 'HIDE_ATTRIBUTES' shows attributes:
Steps/models to reproduce
final ItemStack item = new ItemStack(Material.IRON_PICKAXE);
final ItemMeta meta = item.getItemMeta();
meta.setDisplayName("Test Item");
meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
item.setItemMeta(meta);
player.getInventory().addItem(item);
Plugin and Datapack List
> plugins
[11:50:28 INFO]: Server Plugins (1):
[11:50:28 INFO]: Bukkit Plugins:
[11:50:28 INFO]: - PaperProject
> datapack list
[11:51:11 INFO]: There are 3 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)], [paper (built-in)]
[11:51:11 INFO]: There are no more data packs available
Paper version
> version
[11:51:37 INFO]: Checking version, please wait...
[11:51:39 INFO]: This server is running Paper version 1.21-127-master@4e6a2a1 (2024-08-07T12:50:10Z) (Implementing API version 1.21-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21-81-ceeb8c1 (MC: 1.21)
Other
This works as intended on latest Spigot:
If there are no modifiers and HIDE_ATTRIBUTES tag is present, it will add a dummy empty modifier.
Paper will only hide default attributes if there is any modifier and the tag is set, but will not add a dummy modifier:
final ItemStack item = new ItemStack(Material.IRON_PICKAXE);
final ItemMeta meta = item.getItemMeta();
meta.setDisplayName("Test Item with dummy modifier");
meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
meta.addAttributeModifier(Attribute.GENERIC_LUCK, new AttributeModifier(
new NamespacedKey(this, "dummy"),
0,
AttributeModifier.Operation.ADD_NUMBER
));
item.setItemMeta(meta);
player.getInventory().addItem(item);
Expected behavior
Item with tag
HIDE_ATTRIBUTES
should not show attributes:Observed/Actual behavior
Item with tag 'HIDE_ATTRIBUTES' shows attributes:
Steps/models to reproduce
Plugin and Datapack List
Paper version
Other
This works as intended on latest Spigot:
HIDE_ATTRIBUTES
tag is present, it will add a dummy empty modifier.Paper will only hide default attributes if there is any modifier and the tag is set, but will not add a dummy modifier: