Solved Can't find out how to give the player enchanted 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 community!

    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.

Cynacol

New Member
Jul 14, 2022
6
0
1
I am trying to make a skript that will give you a lightning wand, and i cant figure out how to make it have enchantments. I have tried other methods on the forum, but they are all from 2017-2019 and are not recent, so they do not work. So i am making my own post. Here is the code and I will also mark where I am having the problems.

Code:
command /lightningwand <player>:
    aliases: lw
    usage: &7[&6LW&7] &cWho do you want to give the wand?
    permission: lw.give
    trigger:
        if arg-1 is set:
            ## here is the first line
            give player 1 iron axe named "&f&lStormbreaker" with lore "&7You are now Thor. This axe has Sharpness 20 and can strike lightning." and "" and "&5&lMythic" of sharpness 20
        else:
            stop
            
on rightclick:
    ## here is the second line
    if player's tool is iron axe named "&f&lStormbreaker" with lore "&7You are now Thor. This axe has Sharpness 20 and can strike lightning." and "" and "&5&lMythic" of sharpness 20:
        strike lightning at the targeted block
    else:
        stop
 
hi
Code:
command /lightningwand <player>:
    aliases: lw
    usage: &7[&6LW&7] &cWho do you want to give the wand?
    permission: lw.give
    trigger:
        if arg-1 is set:
            # here is the first line
            set {_weapon} to iron axe of sharpness 20 #Just FYI, sharpness above 5 doesn't  shows "Sharpness VI" or + (PS: If you really want it to show "Sharpness XX" You will have to find a way to compare the enchant and change it accordingly)
            give {_weapon} named "&f&lStormbreaker" with lore "&7You are now Thor. This axe has Sharpness 20 and can strike lightning." and "" and "&5&lMythic" to player
        else:
            stop
      
on rightclick:
    # here is the second line
    if player's tool is iron axe named "&f&lStormbreaker" with lore "&7You are now Thor. This axe has Sharpness 20 and can strike lightning." and "" and "&5&lMythic": #I dont think you compare enchants like this, cba checking that.(PS: If you do things well, players shouldn't be able to replicate an iron axe with that name and that lore exactly, so you should be fine)
        strike lightning at the targeted block
    else:
        stop
 
Last edited:
Status
Not open for further replies.