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.

Replace held item properly

Discussion in 'Skript' started by ItsAssasin, Nov 27, 2021.

  1. ItsAssasin

    ItsAssasin New Member

    Joined:
    Jul 22, 2021
    Messages:
    6
    Likes Received:
    0
    Hi, im making a hypixel skyblock Atomsplit Katana recreation, well, when you right click with that diamond sword, it changes to a golden sword for 4 seconds and then changes again to diamond. Ive managed to make the diamond sword change and change back, but if i change the weapon slot, the golden sword stays as golden and the diamond sword appears in the slot that you initially right clicked, making the sword dupe. Here is my code:

    Code (Text):
    1.  
    2. on right click:
    3.    if player's held item is diamond sword named "&6Atomsplit Katana":
    4.        set {_nbt} to nbt of player's held item
    5.        set player's held item to golden sword with nbt "%{_nbt}%"
    6.        wait 4 seconds
    7.        set player's held item to diamond sword with nbt "%{_nbt}%"
    8.  
    Any help is welcome :emoji_slight_smile:
     

Share This Page

Loading...