About anvil 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 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!

_PAPER_PLANE_

Member
Jan 21, 2022
41
0
6
I want to prevent players from renaming custom items, but Skript doesn’t seem to have any syntax that can be used for this. I tried detecting when a player puts an item in the inventory and then closing the inventory directly
Code:
on inventory click:
    type of event-inventory is anvil inventory
    name of cursor slot of player is "special axe"
    close inventory of player
    send "no" to player


but it doesn’t work when the player uses shift+left-click because the previous condition is in the anvil’s inventory. Therefore, Skript seems unable to detect when a player clicks on the contents of their own backpack. How can I detect this? Or are there any other alternative solutions?
 
I want to prevent players from renaming custom items, but Skript doesn’t seem to have any syntax that can be used for this. I tried detecting when a player puts an item in the inventory and then closing the inventory directly
Code:
on inventory click:
    type of event-inventory is anvil inventory
    name of cursor slot of player is "special axe"
    close inventory of player
    send "no" to player


but it doesn’t work when the player uses shift+left-click because the previous condition is in the anvil’s inventory. Therefore, Skript seems unable to detect when a player clicks on the contents of their own backpack. How can I detect this? Or are there any other alternative solutions?
I did a bit of quick research, this can be achieved with TuSke. It allows you the usage of an 'on anvil rename' event which should be what you're looking for.
 
  • Like
Reactions: _PAPER_PLANE_
Thank you for providing me with an alternative solution, but tuske is no longer supported and cannot be used on my server : (