How to set enchant level for my /enchant command?

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

Norsumara_

Member
Oct 22, 2021
1
0
1
24
I found a way to enchant item in players hand, but it can enchant that item only for level 1. I want to enchant that item to higher level. Please help me.

Code:
command /emeenchant <enchantment type> [<text>]:
    description: Enchants item in player's hand.
    permission: eme.rename
    trigger:
        if player's held item is not air:
            if arg-1 is set:
                enchant player's tool with arg-1
[doublepost=1634907521,1634895793][/doublepost]
I found a way to enchant item in players hand, but it can enchant that item only for level 1. I want to enchant that item to higher level. Please help me.

Code:
command /emeenchant <enchantment type> [<text>]:
    description: Enchants item in player's hand.
    permission: eme.rename
    trigger:
        if player's held item is not air:
            if arg-1 is set:
                enchant player's tool with arg-1

EDIT: I found way to enchant with just testing things for 2h! :emoji_slight_smile: My command works now like this:

command /emeenchant <text> [<enchantment type>] [<text>]:
description: Enchants item in player's hand.
permission: eme.rename
trigger:
set {enchant_} to "%arg-2% %arg-3%" parsed as enchantment type
if arg-1 is set:
if arg-1 is "add":
if player's held item is not air:
if arg-2 is set:
enchant player's tool with {enchant_}
if arg-1 is "set":
if player's held item is not air:
if arg-2 is set:
disenchant player's tool
enchant player's tool with {enchant_}
if arg-1 is "disenchant":
if player's held item is not air:
disenchant player's tool
else:
message "/emeenchant <add|set|disenchant> <enchant> <level>"
 
Status
Not open for further replies.