How to give a player tools with a custom name and enchanted

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

mxntie

New Member
Sep 4, 2021
5
0
1
24
This is my skript. Basically, I want it to be like a farming level system. All of the lines working, except for Line 25. I don't know why as it is the same as the other ones.
Code:
variables:
    {tilled} = 0
    {%player%.tilled} = 0

on drop:
    add 1 to {itemsdropped}
    add 1 to {%player%.itemsdropped}
   
on right click on grass:
    player is holding hoe
    add 1 to {tilled}
    add 1 to {%player%.tilled}
    wait 1 second
    if {%player%.tilled} = 100:
        give player 1 of stone hoe of unbreaking 1 named "&8Level 1 Hoe"
    if {%player%.tilled} = 500:
        give player 1 of gold hoe of unbreaking 2 named "&6Level 2 Hoe"
    if {%player%.tilled} = 1500:
        give player 1 of iron hoe of unbreaking 3 named "&7Level 3 Hoe"
    if {%player%.tilled} = 3000:
        give player 1 of diamond hoe of unbreaking 4, knockback 1 named "&bLevel 4 Hoe"
    if {%player%.tilled} = 5000:
        give player 1 of diamond hoe of unbreaking 5, knockback 2, sharpnesss 1 named "&3Level 5 Hoe"
    if {%player%.tilled} = 10000:
        give player 1 of diamond hoe of unbreaking 10, knockback 5, sharpness 5 named "&3Level 6 Hoe"

This is the error message in the parser.
Line 25: ('1 of diamond hoe of unbreaking 5', 'knockback 2' and 'sharpnesss 1 named "&3Level 5 Hoe"') can't be added to a player because the former is neither an item type, an inventory nor an experience point (script.sk, line 25: give player 1 of diamond hoe of unbreaking 5, knockback 2, sharpnesss 1 named "&3Level 5 Hoe"')

Thanks in advance, whether it can be solved or not.
 
instead of applying unbreaking 10, i suggest using

Code:
give player 1 unbreakable (your item)
 
Status
Not open for further replies.