-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Minor
-
None
-
Affects Version/s: None
-
None
-
4564-Spigot-6e369ba-88f17af (MC: 1.21.10)
-
Yes
Issue
Items created via ItemFactory behave differently from normal ItemStacks: clearing lore using setLore(null) does not work. Instead of removing the lore, Spigot restores the old lore after calling setItemMeta(meta), making it impossible to clear an item's lore.
Reproduction Code
// Case 1: Works correctly ItemStack normalItem = new ItemStack(org.bukkit.Material.HOPPER); ItemMeta meta1 = normalItem.getItemMeta(); meta1.setLore(List.of("Test")); normalItem.setItemMeta(meta1); ItemMeta clear1 = normalItem.getItemMeta(); clear1.setLore(null); // Should clear lore normalItem.setItemMeta(clear1); Bukkit.broadcastMessage("Normal Item lore (expected null): " + normalItem.getItemMeta().getLore()); // Case 2: Fails on Spigot ItemStack factoryItem = Bukkit.getItemFactory().createItemStack("minecraft:hopper"); ItemMeta meta2 = factoryItem.getItemMeta(); meta2.setLore(List.of("Test")); factoryItem.setItemMeta(meta2); ItemMeta clear2 = factoryItem.getItemMeta(); clear2.setLore(null); // Should clear lore factoryItem.setItemMeta(clear2); Bukkit.broadcastMessage("Factory Item lore (should be null but is restored): " + factoryItem.getItemMeta().getLore());

- relates to
-
SPIGOT-7896 BlockStateMeta duplicates PersistentDataContainer into block_entity_data
-
- Open
-
-
SPIGOT-7664 After being placed in inventory some items are not anymore editable
-
- Resolved
-