I'm trying to make a custom food skript for my server. I can't figure out why the player isn't being given the item when it's harvested.
Thanks for your help
code_language.skript:
on rightclick on soil:
if name of player's tool is "&aCucumber Seed":
if block above clicked block is air:
remove 1 of player's tool from player
add location above clicked block to {cucumbers::*}
set block above clicked block to crops
every 20 ticks:
loop {cucumbers::*}:
if block at loop-value is crops: # This checks to see if it has been harvested
if data value of block at loop-value is greater than 6:
set block at loop-value to fern
else:
add 1 to data value of block at loop-value # The data value is the grow state in the case of crops
else:
remove loop-value from {cucumbers::*}
# Deletes the cucumber location variable if harvested or full grown
on break of crops:0-6:
if block below event-block is farmland:
cancel event
on break of crops:7:
if {farminglvl.%player%} is higher than or equal to 0:
give 1 melon_slice named "&aCucumber" to player's inventory
add 0.5 to {farminglvl.%player%}