Solved Cancel rename specific item in an anvil

  • 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.
Uno second
[doublepost=1667468194,1667467898][/doublepost]
Code:
on inventory click:
    event-inventory's type is anvil inventory
   
    if event-item's name is "a":
        cancel event
        close player's inventory
        send "&cYou can't rename this item!"

Edit:
Code:
on inventory click:
    event-inventory's type is anvil inventory

    set {_slot1} to slot 0 of event-inventory
    set {_slot2} to slot 1 of event-inventory
    set {_slot3} to slot 2 of event-inventory
    set {_eslot} to index of event-slot
   
    if {_eslot} is 2:
        if {_slot1}'s name is "BlackListedName":
            cancel event
            send "&cYou cant rename this item!"

        else if {_slot3}'s name is "BlackListedName":
            cancel event
            send "&cYou cant rename the item to this!"
 
Last edited:
Uno second
[doublepost=1667468194,1667467898][/doublepost]
Code:
on inventory click:
    event-inventory's type is anvil inventory
  
    if event-item's name is "a":
        cancel event
        close player's inventory
        send "&cYou can't rename this item!"

Edit:
Code:
on inventory click:
    event-inventory's type is anvil inventory

    set {_slot1} to slot 0 of event-inventory
    set {_slot2} to slot 1 of event-inventory
    set {_slot3} to slot 2 of event-inventory
    set {_eslot} to index of event-slot
  
    if {_eslot} is 2:
        if {_slot1}'s name is "BlackListedName":
            cancel event
            send "&cYou cant rename this item!"

        else if {_slot3}'s name is "BlackListedName":
            cancel event
            send "&cYou cant rename the item to this!"

I did it like this, seems to work... thanks :emoji_slight_smile:

Code:
on anvil prepare:
    if event-item's lore contains "&9Custom-Item":
        send "&a&lSYSTEM &8▪ &7Du darfst dieses Item nicht umbenennen bzw&8. &7verzaubern&8, &7da es sich anscheinend um ein Custom&8-&7Item handelt&8."
        close player's inventory
 
I did it like this, seems to work... thanks :emoji_slight_smile:

Code:
on anvil prepare:
    if event-item's lore contains "&9Custom-Item":
        send "&a&lSYSTEM &8▪ &7Du darfst dieses Item nicht umbenennen bzw&8. &7verzaubern&8, &7da es sich anscheinend um ein Custom&8-&7Item handelt&8."
        close player's inventory
or so yes
 
Status
Not open for further replies.