Console spam with on inventory click 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.

Kush

Member
Jan 29, 2017
29
2
3
Hey, so i'v been having this issue for a while, I get this message spammed in my console whenever you click on anything in your inventory...I figured out it's caused by checking the inventory name with the "on inventory click" event, yet the feature works completely fine.

I only added the message 1 time below because there is hundreds of them. This is also NOT an error of any sorts, my skripts are working flawlessly with checking the name of an inventory. I just can't read anything in console because of the spam.

Code:
[23:20:56] [Server thread/ERROR]: [Skript] In 1.13+ you cannot get the title name of an inventory outside of an InventoryClickEvent, Only if this inventory has an InventoryHolder may it be used in this state.

Skript Version: 2.4
Server Version: Paper version git-Paper-365 (MC: 1.15.2)

I'v searched every forum post and google result possible and I cannot find a fix to this. Any help would be greatly appreciated, thanks.
 
As far as I know you just want to check for the inventory type.
For example to block player inventories do this:
Code:
on inventory click:
  inventory type of event-inventory != "PLAYER"
 
As far as I know you just want to check for the inventory type.
For example to block player inventories do this:
Code:
on inventory click:
  inventory type of event-inventory != "PLAYER"

I have tried this as this was one of the answers in another forum post, but this doesn't stop the message and also makes the slot clickable in the player's inventory.
Maybe i'm using it wrong? I used it two different ways in my code below but it still spams the message while also breaking the GUI.

Code:
on inventory click:
    if inventory type of event-inventory is not player:
        cancel event
        if clicked slot is 29:
            #code
            
on inventory click:
    inventory type of event-inventory is not player
    cancel event
    if clicked slot is 29:
        #code
 
Status
Not open for further replies.