triumph-gui
triumph-gui copied to clipboard
Ability to disable the nbt tag
I would like to request add the possibility to disable the nbt tag for a specific items or all of items
A NBT tag is set to differentiate gui items from other items. What's your reason for this?
When a player receives a set items this set do not merge with other items
Then create a new item, the nbt is applied only to items set in GUIs
Player gets this set from the menu with the nbt tag so I have to disable nbt tag for the items
you have to create new items, is not possible to disable this
For anyone looking here for a solution to this problem (which is, to my understanding, about removing the NBT tag added by triumph-gui to items so that you can let players remove items from the inventory and put them in their own inventory), you can do that by changing the ItemStack in the InventoryClickEvent listener.
For example, assuming original
is the initial ItemStack:
GuiItem gui = ItemBuilder.from(original.clone()).asGuiItem();
gui.setAction(event -> {
// ...
event.setCurrentItem(original); // the important part
event.setCancelled(false); // assuming you're cancelling all events in the default action
// ...
});