Detect when item is added in chest(gui)

  • 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 comminuty!

    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.

Scan

Member
Feb 20, 2021
10
1
3
17
Hi,

I want to detect when item is added in chest to make gui linked in real time.
And I tried "on inventory click", but since what i wanted accurately is detecting put item or taken item.

Let me take an example.
upload_2021-10-10_21-15-35.png
upload_2021-10-10_21-16-12.png


When i put item in a chest or a gui, I want to get (slot: 0, item: 64 of stone) and when I take that 64 of stone in slot 0 in a chest or a gui, I want to get (slot: 0, item: air)

If I use "slot clicked raw slot of current inventory of player" in "on inventory click:", it returns each 64 of stone and slot: 0, item: 64 of stone.
I realized that it is because "on inventory click" returns value when it called.
But I need after item when stone taken("air" not stone). Also I need (stone in slot 0) when stone put
It can be solved when I use delay, but I can't use it because purpose of this skript is linked gui.


Ultimately, what I want is linked gui. Replying how to make liked gui instead of after item(air) when item(stone) taken will be also helped me a lot.

I'm really sorry because I'm not good at English and I couldn't tell you what I want to say accurately.

Thank you.
 
Hi,

I want to detect when item is added in chest to make gui linked in real time.
And I tried "on inventory click", but since what i wanted accurately is detecting put item or taken item.

Let me take an example.
View attachment 6390 View attachment 6392

When i put item in a chest or a gui, I want to get (slot: 0, item: 64 of stone) and when I take that 64 of stone in slot 0 in a chest or a gui, I want to get (slot: 0, item: air)

If I use "slot clicked raw slot of current inventory of player" in "on inventory click:", it returns each 64 of stone and slot: 0, item: 64 of stone.
I realized that it is because "on inventory click" returns value when it called.
But I need after item when stone taken("air" not stone). Also I need (stone in slot 0) when stone put
It can be solved when I use delay, but I can't use it because purpose of this skript is linked gui.


Ultimately, what I want is linked gui. Replying how to make liked gui instead of after item(air) when item(stone) taken will be also helped me a lot.

I'm really sorry because I'm not good at English and I couldn't tell you what I want to say accurately.

Thank you.
Use the inventory click event as you said, player's inventory would be the bottom inventory and event-inventory the top one. also check the type of the inventory with type of event-inventory is chest inventory
 
Use the inventory click event as you said, player's inventory would be the bottom inventory and event-inventory the top one. also check the type of the inventory with type of event-inventory is chest inventory
It could be solved by using 'raw slot' since raw slot 0~26 is event-inventory(top) and 27~53 is player's inventory(bottom).
But what I want is to check what item is in chest after item is taken.
When 64 of stone in raw slot 0(slot 0 of event-inventory) was taken from the chest, there is an air in the slot 0 of event-inventory.
Because 'inventory click' returns value(raw slot of event-inventory is not air but 64 of stone) just before click, I want situation after click(air).

I just want to detect the situation after the event is called.
As I said at the question, it could be solved by adding delay. But adding delay accurs other many error with using linked gui
 
Status
Not open for further replies.