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.

Enchanting items

Discussion in 'Skript' started by Dismade, Sep 8, 2018.

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

    Dismade New Member

    Joined:
    Jul 23, 2017
    Messages:
    6
    Likes Received:
    0
    Hello, I have a /enchant command on my server, but I'd rather it be more complex, because right now the usage is just

    /enchant <enchantment>

    I'd rather you be able to specify the level of enchantment as well, for example "Sharpness 5" or "Protection 4". Can someone help me?
    Here's my code:

    Code (Text):
    1.  
    2. command /enchant [<enchantment type>]:
    3.     description: Enchant your held item.
    4.     permission: command.enchant
    5.     permission message: {@nopermission}
    6.     aliases: /enchantment
    7.     trigger:
    8.         if arg 1 is not set:
    9.             message "&cUsage: /enchant <enchantment>"
    10.             stop
    11.         if player's tool is air:
    12.             message "&cUsage: /enchant <enchantment>"
    13.             stop
    14.         else:
    15.             enchant player's tool with arg 1
    16.             send "&7Your item has been enchanted with &c%arg 1%."
    17.             stop
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    227
    I just used this code as a test, typed /enchant sharpness 3 ... and it enchanted my tool with sharpness 3
    Code (Skript):
    1. command /enchant <enchantment type>:
    2.     trigger:
    3.         enchant player's tool with arg-1
     
  3. Dismade

    Dismade New Member

    Joined:
    Jul 23, 2017
    Messages:
    6
    Likes Received:
    0
    Oh cool, I'll test it out. Didn't think of it that way! Lol
     
Thread Status:
Not open for further replies.

Share This Page

Loading...