Solved Can't enchant certain 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.

Hackusater

Active Member
Aug 5, 2017
74
2
8
I have had problems trying to enchant certain items. When I try to enchant fish or quartz it just gives me it back un-enchanted. Can anyone help me fix it or find a way around this.

The code I'm using:
code_language.skript:
give quartz of knockback 2 to player-argument
give fish of knockback 2 to player-argument
 
Last edited:
I have had problems trying to enchant certain items. When I try to enchant fish or quartz it just gives me it back un-enchanted. Can anyone help me fix it or find a way around this.

The code I'm using V
code_language.skript:
give quartz of knockback 2 to player-argument
give fish of knockback 2 to player-argument
It doesn't work with Skript for me either, but you could execute a console give command instead.
code_language.skript:
/give playername quartz 1 0 {display:{Name:"Test Name"},ench:[{id:19,lvl:2}]}
 
It doesn't work with Skript for me either, but you could execute a console give command instead.
code_language.skript:
/give playername quartz 1 0 {display:{Name:"Test Name"},ench:[{id:19,lvl:2}]}
Thanks for your response, and for now I am going to use your code but I am still wondering if there is a way around it without sending a console command because I am trying to avoid using console commands.
 
Try setting the item as a variable, give the item to the player, then enchant it.
code_language.skript:
enchant {_item} with knockback 2
 
Thanks. Btw, (Sorry if this is a noob question) but why do you put a _ in {_item} what is it for?
The _ indicates a local variable. A local variable is only accessible within it's trigger -- you can have 2 of the same in different triggers and they won't conflict with each other. This page explains it in a more noob friendly way.
 
The _ indicates a local variable. A local variable is only accessible within it's trigger -- you can have 2 of the same in different triggers and they won't conflict with each other. This page explains it in a more noob friendly way.
I thought something like that happened. I just wasn't completely sure. Thank you!
 
Status
Not open for further replies.