Solved Removing specific enchantments on a player's held item

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

IHaveNoName

New Member
Feb 1, 2018
9
0
0
Skript Version: 2.2-dev25
Minecraft Version: 1.8
Skript Addons: TuSKe, SkRayFall, SkQuery

I want to remove specific enchantments on an item whilst keeping the rest.
Methods I have tried:
code_language.skript:
disenchant sharpness from player's tool
gives me the error:
Q0le8tGgQyWsB38ZH8G__A.png


I've tried
code_language.skript:
remove sharpness from player's tool
gives me the error:
2uOWIwSPQ5q_6gYNquRz5g.png


I've tried using a function I found in this thread https://forums.skunity.com/threads/removing-specific-enchantment.3979/ (with corrected indents):

KXvYsq95R-SmuCYzwnmDeQ.png

code_language.skript:
function removeEnch(i: item, e: enchantment):
    loop enchantments of {_i}:
        add "%loop-value% %level of loop-value of {_i}%" parsed as an enchantment type to {_e::*}
        disenchant {_i}

#Only the part of the function which gives me the error

I would really appreciate your help.
Thanks,


 
It's alright, I didnt find a way of disenchanting a specific enchantment but I found an alternative way to do the thing I wanted to, thanks anyway
 
Status
Not open for further replies.