Solved On remove item from virtual treasure chest event?

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Sordrin

New Member
Apr 28, 2020
8
0
1
I am using the plugin TreasureChest which allows me to turn a chest and its contents into a virtual treasure chest which can be opened and accessed by anyone who clicks to open the chest, and then are presented with a virtual chest containing the items set for that treasure.

There is one particular item I have (a named ink sac) that I need to not stack. I know that all I need to do to prevent the item from stacking is to change the NBT data of the items and make them unique. Problem is, this item is stored as-is in the virtual chest, and everyone receives the same exact item with the same NBT data, and can receive it multiple times, so I need a sort of "on loot" method to change the NBT data for that particular item when it's looted, no matter how it was taken. Whether by clicking and dragging, or shift-clicking to loot it, I need it to be modified before they have a chance to stack it.

I can't seem to find an event that catches the action of removing the item from a virtual chest or receiving the item from the chest. Any suggestions?

Thanks.
 
you can use on inventory click to detect if someone clicks on an item inside a chest
 
Can you just add a whitespace after the name of the inc sack. Like go online and find a copy and paste whitespace site and paste that on the name of the item. (Use a anvil)
 
Can you just add a whitespace after the name of the inc sack. Like go online and find a copy and paste whitespace site and paste that on the name of the item. (Use a anvil)
I am actually generating the item with a command, and it has a green name. The problem is, once I put it in the treasure chest, it is essentially duplicated as-is every time someone loots that chest. They get an exact replica of that item no matter what name, lore or NBT data I assign it before setting the chest with that item in it. Which makes it stackable.

I will try on inventory click and see if I can catch it there. Just need to make sure that covers any possible method of obtaining the item. It's very important that it doesn't stack, because I discovered a dupe bug in my code based on the fact that they are stackable right now.
 
Status
Not open for further replies.