Want a better Minecraft server? Read about SpigotMC here!
Separate names with a comma.
Discussion in 'Spigot Plugin Development' started by TheFuzzyHead5, May 31, 2017.
How can I reset the location of an itemstack in a GUI without reopening it?
What do you mean by resetting the location?
Set it to null? As in
Or you can just completely replace it without setting it to null by just setting it to another item.
You can create a new inventory with a different position of the item, and make the player open it.
Honestly you can just keep a reference to the Inventory object, and manipulate it using (as @Virizion said) setItem(oldSlot, null) and setItem(newSlot, the item). The inventory should update itself without having to close/reopen.
From what I leanred you can't just change the item in the gui you have to change it in the players opened gui. Like so: