1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Cancel rename specific item in an anvil

Discussion in 'Skript' started by Lutrex, Nov 3, 2022.

Thread Status:
Not open for further replies.
  1. Lutrex

    Lutrex Member

    Joined:
    Jul 20, 2022
    Messages:
    12
    Likes Received:
    0
    How can I cancel renaming a specific item in an anvil?

     
  2. Best Answer:
    Post #3 by Lutrex, Nov 3, 2022
  3. Pierrelasse

    Pierrelasse Active Member

    Joined:
    Apr 20, 2022
    Messages:
    116
    Likes Received:
    4
    Uno second
    --- Double Post Merged, Nov 3, 2022, Original Post Date: Nov 3, 2022 ---
    Code (Text):
    1. on inventory click:
    2.     event-inventory's type is anvil inventory
    3.    
    4.     if event-item's name is "a":
    5.         cancel event
    6.         close player's inventory
    7.         send "&cYou can't rename this item!"
    Edit:
    Code (Text):
    1.  
    2. on inventory click:
    3.     event-inventory's type is anvil inventory
    4.  
    5.     set {_slot1} to slot 0 of event-inventory
    6.     set {_slot2} to slot 1 of event-inventory
    7.     set {_slot3} to slot 2 of event-inventory
    8.     set {_eslot} to index of event-slot
    9.    
    10.     if {_eslot} is 2:
    11.         if {_slot1}'s name is "BlackListedName":
    12.             cancel event
    13.             send "&cYou cant rename this item!"
    14.  
    15.         else if {_slot3}'s name is "BlackListedName":
    16.             cancel event
    17.             send "&cYou cant rename the item to this!"
    18.  
     
    #2 Pierrelasse, Nov 3, 2022
    Last edited: Nov 3, 2022
  4. Lutrex

    Lutrex Member

    Joined:
    Jul 20, 2022
    Messages:
    12
    Likes Received:
    0
    I did it like this, seems to work... thanks :emoji_slight_smile:

    Code (Text):
    1. on anvil prepare:
    2.     if event-item's lore contains "&9Custom-Item":
    3.         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."
    4.         close player's inventory
     
  5. Pierrelasse

    Pierrelasse Active Member

    Joined:
    Apr 20, 2022
    Messages:
    116
    Likes Received:
    4
    or so yes
     
Thread Status:
Not open for further replies.

Share This Page

Loading...