how to cancel inventory drag

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

rlatlsgn

Member
Aug 7, 2024
3
0
1
15
first im korean sorry to my english is bad

command /test:
trigger:
set {_a} to a chest inventory with 1 row named "just mapleeeee"
set slot 8 of {_a} to an anvil named "let's mapleeeee"
open {_a} to player
# when player try to move chest inventory item make it cancel
on inventory click:
if event-item is anvil:
cancel event

this works fine. But I also want to strengthen the item in slot 0 when I click on the anvil.
If a cancel event occurs when I click on the anvil, I can't strengthen it when I click on the anvil.
So I used on inventory drag syntax but this doesn't work
+ Thank you for reading my poor English.
 
first im korean sorry to my english is bad

command /test:
trigger:
set {_a} to a chest inventory with 1 row named "just mapleeeee"
set slot 8 of {_a} to an anvil named "let's mapleeeee"
open {_a} to player
# when player try to move chest inventory item make it cancel
on inventory click:
if event-item is anvil:
cancel event

this works fine. But I also want to strengthen the item in slot 0 when I click on the anvil.
If a cancel event occurs when I click on the anvil, I can't strengthen it when I click on the anvil.
So I used on inventory drag syntax but this doesn't work
+ Thank you for reading my poor English.
I think I know what you mean. Try:
Code:
on inventory click:
   if name of event-inventory is "just mapleeeee":
      if event-slot is 0 or 8:
         cancel event