Problem with inventory click

  • 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.

MaxB

Member
Jun 1, 2022
4
0
1
53
Hello i have a problem with inventory click
I just want my skript to give me the name (or the lore ) of a clicked item
All chests has different names set by yml file
I have tested many things without results


Code:
command /conv:
    trigger:
        if player is op:
            set {home} to 0
            load yaml "/plugins/Skript/list.yml" as "%list%"
            open chest with 6 rows named "Menu1" to player
            loop yaml nodes with keys "homes" from "%list%":
                format slot {home} of player with chest named loop-value with lore loop-value to close
                add 1 to {home}

on inventory click:
    wait 2 ticks
    if name of player's current inventory contains "Menu1":
        send "click ok" to player
        send "1 - %name of clicked slot% " to player
        send "2 - %lore of event-item% " to player
        send "3 - %name of event-item% " to player

When i click on empty slot i have messages in the chat

Capture d’écran (377)_LI.jpg
Capture d’écran (377).png

But when i click on a chest, there is nothing at all in the chat
names or lores are all different,, no one is working

Capture d’écran (375)_LI.jpg

Someone can help me please ?
 
The "on inventory click" event only have the following event-values:
Code:
event-clicktype, event-itemtype, event-slot, event-world, event-inventory, event-player, event-inventoryaction, event-string

But you can use one of the following methods to get a ItemStack from the event.

You can use this Expression from skellet:
https://skripthub.net/docs/?id=520
https://skripthub.net/docs/?id=1189 (You can also use this from skLib)

the second way is to use skript-reflect:
Code:
event.getCurrentItem()
 
Status
Not open for further replies.