[SPIGOT-6783] AnvilGUI items invisiblle. Created: 16/Oct/21  Updated: 04/Nov/21  Resolved: 04/Nov/21

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: MondGnu Assignee: md_5
Resolution: Fixed Votes: 0
Labels: Inventory, itemstack
Environment:

SpigotBuildTools, Maven, IntelliJ Ultimate.


Version: 1.16.5
Plugin: PlayerController
Guidelines Read: Yes

 Description   

I am trying to create a custom Anvil GUI for user input but when i call setItem(0, itemstack) it doesnt apear in the anvil gui.

Inventory tmpinv = Bukkit.getServer().createInventory(usedBy, InventoryType.ANVIL, ChatColor.GREEN + "Enter Reason");
//Switches old inventory with new
PlayerManagerGuiHandler.getHandler().updateInventory(inventory, tmpinv);
inventory = tmpinv;
inventory.setItem(0, PlayerManagerGuiHandler.createGuiItem(Material.NAME_TAG, "Reason", "Enter your custom reason"));
usedBy.openInventory(inventory);
usedBy.updateInventory(); 

Generated at Fri Mar 14 09:44:45 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.