Solved Inventory click 1.13+

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

BrownMee

Active Member
Apr 16, 2018
126
6
18
23
Im using skript mirror to disable clicking event on certain inventory name

Code:
on InventoryClickEvent:
    if event.getView().getTitle() contains "      Survival Book":
        cancel event

But it disable my on inv click event as well...

On inventory click:
if name of clicked item contains "test":
send "hi"

the skript mirror disabled my click event inside the inventory as well.
I want to make the menu can be clickable and player inventory cannot be clicked or drag
[doublepost=1613884921,1613804391][/doublepost]bump
[doublepost=1614000945][/doublepost]please help
[doublepost=1614087561][/doublepost]still need help
[doublepost=1614179510][/doublepost]bump... I still can't find solution for this. Using the syntax does works to prevent clicking item in player inventory but the menu interacts doesnt works afterwards
[doublepost=1614440903][/doublepost]bump
 
Im using skript mirror to disable clicking event on certain inventory name

Code:
on InventoryClickEvent:
    if event.getView().getTitle() contains "      Survival Book":
        cancel event

But it disable my on inv click event as well...

On inventory click:
if name of clicked item contains "test":
send "hi"

the skript mirror disabled my click event inside the inventory as well.
I want to make the menu can be clickable and player inventory cannot be clicked or drag
[doublepost=1613884921,1613804391][/doublepost]bump
[doublepost=1614000945][/doublepost]please help
[doublepost=1614087561][/doublepost]still need help
[doublepost=1614179510][/doublepost]bump... I still can't find solution for this. Using the syntax does works to prevent clicking item in player inventory but the menu interacts doesnt works afterwards
[doublepost=1614440903][/doublepost]bump
Well... this does that you want, but i didnt do it in skript-mirror as you want. But its skript vanilla so you dont need addons.

code_language.skript:
command /test:
    trigger:
        set {_m} to "Test01"
        set metadata tag "%{_m}%" of player to chest inventory with 3 rows named "&5Test 1"
        set slot 19 of metadata tag "%{_m}%" of player to grass block named "&dTest 1"
        open (metadata tag "%{_m}%" of player) to player
        set {inv.open.%player%} to true

on inventory click:
    clicked inventory is player's inventory:
        {inv.open.%player%} is true:
            cancel event
    clicked inventory = (metadata tag "Test01" of player):
        send "&dTest 1"

on inventory close:
    name of player's current inventory is "&5Test 1":
        delete {inv.open.%player%}
 
Well... this does that you want, but i didnt do it in skript-mirror as you want. But its skript vanilla so you dont need addons.

code_language.skript:
command /test:
    trigger:
        set {_m} to "Test01"
        set metadata tag "%{_m}%" of player to chest inventory with 3 rows named "&5Test 1"
        set slot 19 of metadata tag "%{_m}%" of player to grass block named "&dTest 1"
        open (metadata tag "%{_m}%" of player) to player
        set {inv.open.%player%} to true

on inventory click:
    clicked inventory is player's inventory:
        {inv.open.%player%} is true:
            cancel event
    clicked inventory = (metadata tag "Test01" of player):
        send "&dTest 1"

on inventory close:
    name of player's current inventory is "&5Test 1":
        delete {inv.open.%player%}

THANKS
 
  • Like
Reactions: couger44
Status
Not open for further replies.