Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to disable the nbt tag #79

Open
vkicpeross opened this issue Oct 22, 2022 · 6 comments
Open

Ability to disable the nbt tag #79

vkicpeross opened this issue Oct 22, 2022 · 6 comments

Comments

@vkicpeross
Copy link

I would like to request add the possibility to disable the nbt tag for a specific items or all of items

@iGabyTM
Copy link
Member

iGabyTM commented Oct 22, 2022

A NBT tag is set to differentiate gui items from other items. What's your reason for this?

@vkicpeross
Copy link
Author

When a player receives a set items this set do not merge with other items

@iGabyTM
Copy link
Member

iGabyTM commented Oct 22, 2022

Then create a new item, the nbt is applied only to items set in GUIs

@vkicpeross
Copy link
Author

Player gets this set from the menu with the nbt tag so I have to disable nbt tag for the items

@iGabyTM
Copy link
Member

iGabyTM commented Oct 22, 2022

you have to create new items, is not possible to disable this

@TheKinrar
Copy link

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
    // ...
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants