Custom Enchantment levels

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

Mattllama987

Active Member
Aug 5, 2018
225
7
18
24
Hello, I have a question about custom enchantments. Im currently making about 5-10 enchantments. But the issue im having is, when I try to add a enantment LvL 1-5, it just adds another lore instead of adding a level. Ill post the code I currently have now. But if someone can show me how to add many levels to a custom enchantment, it will be very much appreciated! I also tried to make a variable to show the level, but I couldn't get it to work.

Thanks!


code_language.skript:
command /Cursed [<player>]:
    permission: gooey.*
    trigger:
        give player a enchanted book named "&cCursed" with lore "&7&m---------------||&7- &bThere is a small chance||&7- &byou can wither your enemy!||&7&m---------------||&7- &cDrag and drop||&7- &cThe enchantment||&7- &cOnto your tool!||&7&m---------------"

on inventory click:
    if player's gamemode is survival or creative:
        if type of clicked slot is any chestplate:
            if player's cursor slot is an enchanted book:
                if name of player's cursor slot is "&cCursed":
                    if player is holding any chestplate:
                        set {_lore} to lore of player's cursor slot
                        if {_lore} contains colored "you can wither your enemy!":
                            cancel event
                            set player's cursor slot to air
                            execute player command "/cursedbook"

command /cursedbook2:
    trigger:
        set {_lore::*} to lore of player's held item
        set {_size} to size of {_lore::*} + 1
        set {_lore::%{_size}%} to "&cCursed II"
        set lore of player's held item to join {_lore::*} with "||"
 
If you still need help on this:

Try to delete the current item and create a new item with the updated lore in the same state.
 
Status
Not open for further replies.