-
Type:
New Feature
-
Resolution: Unresolved
-
Priority:
Minor
-
None
-
Affects Version/s: None
-
None
-
This server is running CraftBukkit version 4430-Spigot-d421948-d20d4c1 (MC: 1.21.4) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
-
Yes
With the introduction of Item Components, Minecraft has added the ability to include a prefix in the NBT to remove a component, simply by including an exclamation mark.
/give @s minecraft:diamond_helmet[!minecraft:equippable]
The current ItemMeta system allows you to set a component to null, but this only sets the contents to null rather than removing the component from the item. Being able to remove components from an item can become very useful. One immediate example would be removing the "equippable" component from a player head, which prevents players from equipping the head without trying to come up with a "hacking solution" using a mixture of Inventory Events and click checks. Removing the "consumable" component from food items could likewise be useful for some servers.
As this mechanism is supported in the game, it would be nice if the ItemMeta or ItemStack APIs could reflect this same behaviour.