Enchanting items

  • 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.

Dismade

New Member
Jul 23, 2017
6
0
0
20
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:
command /enchant [<enchantment type>]:
    description: Enchant your held item.
    permission: command.enchant
    permission message: {@nopermission}
    aliases: /enchantment
    trigger:
        if arg 1 is not set:
            message "&cUsage: /enchant <enchantment>"
            stop
        if player's tool is air:
            message "&cUsage: /enchant <enchantment>"
            stop
        else:
            enchant player's tool with arg 1
            send "&7Your item has been enchanted with &c%arg 1%."
            stop
 
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:
command /enchant [<enchantment type>]:
    description: Enchant your held item.
    permission: command.enchant
    permission message: {@nopermission}
    aliases: /enchantment
    trigger:
        if arg 1 is not set:
            message "&cUsage: /enchant <enchantment>"
            stop
        if player's tool is air:
            message "&cUsage: /enchant <enchantment>"
            stop
        else:
            enchant player's tool with arg 1
            send "&7Your item has been enchanted with &c%arg 1%."
            stop
I just used this code as a test, typed /enchant sharpness 3 ... and it enchanted my tool with sharpness 3
code_language.skript:
command /enchant <enchantment type>:
    trigger:
        enchant player's tool with arg-1
 
I just used this code as a test, typed /enchant sharpness 3 ... and it enchanted my tool with sharpness 3
code_language.skript:
command /enchant <enchantment type>:
    trigger:
        enchant player's tool with arg-1
Oh cool, I'll test it out. Didn't think of it that way! Lol
 
Status
Not open for further replies.