[SPIGOT-7664] After being placed in inventory some items are not anymore editable Created: 08/May/24 Updated: 06/Dec/25 Resolved: 10/May/24 |
|
| Status: | Resolved |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Ssomar | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Version: | 4156-Spigot-e2c1eee-428aefe (MC: 1.20.6) (Implementing API version 1.20.6-R0.1-SNAPSHOT) | ||||||||
| Guidelines Read: | Yes | ||||||||
| Description |
|
Hello for some items List at the bottom (it seems to be the items with custom meta), after being placed in an inventory there are not anymore editable.
Method of the check: for (Material mat : Material.values()) { ItemStack item = new ItemStack(mat); ItemMeta meta = item.getItemMeta(); if (meta != null) meta.setDisplayName("&aaaaaaaaaaaaaaaaaaaaaaaa"); item.setItemMeta(meta); Inventory inv = Bukkit.createInventory(null, 18); inv.addItem(item); for (ItemStack it : inv.getContents()) { if (it == null) continue; else { ItemMeta meta2 = it.getItemMeta(); if (meta2 == null) continue; meta2.setDisplayName("&cbbbbbbbbbbbbbbbbbbbb"); it.setItemMeta(meta2); String currentName = it.getItemMeta().getDisplayName(); if (currentName.contains("aaaaaaaaaaaaaaaaaaaa")) System.out.println("MATERIAL >> " + mat + "meta AFTER>>>>>>>>>: " + currentName); } } } Normally the name after the completion of this code should be bbbbbbbbbb..
Here are the items with the problem: [18:59:28] [Server thread/INFO]: MATERIAL >> CHISELED_BOOKSHELFmeta AFTER>>>>>>>>>: §aaaaaaaaaaaaaaaaaaaaaaaaa |
| Comments |
| Comment by Ssomar [ 10/May/24 ] |
|
Thank you md_5 |
| Comment by Ssomar [ 09/May/24 ] |
|
I just simplified the code a bit before sending it and forgot to change correctly : I edited the code in the report to not have confusion |
| Comment by YourCoal [ 09/May/24 ] |
|
You changed the meta of the original item again, not the item in the inventory. |