#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#
#    This function has been created by Skilendarz Group.
#             https://skilendarz.com
#
#      GIVE MAP MAKERS THE CREDIT THEY DESERVE!
#             COPYING IS PROHIBITED!
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

effect give @e[tag=pumpkin,team=!pumpkin] minecraft:glowing 999999 1 true
team join pumpkin @e[tag=pumpkin,team=!pumpkin]

title @a[scores={getpumpkin=1..,pumpkin_count=1..}] times 5 20 5
title @a[scores={getpumpkin=1..,pumpkin_count=1..}] title {"text":"✖","color":"red"}
title @a[scores={getpumpkin=1..,pumpkin_count=1..}] subtitle {"translate":"game.pumpkins.limit","color":"gray"}
playsound minecraft:entity.villager.no master @a[scores={getpumpkin=1..,pumpkin_count=1..}] ~ ~ ~ 300 0.8
execute at @a[scores={getpumpkin=1..,pumpkin_count=0}] as @e[tag=pumpkin,distance=..6,nbt={HurtTime:10s},scores={time=0}] run function f:game/pumpkin/get


title @a[scores={pumpkin_count=1..,stealing=39..}] times 5 20 5
title @a[scores={pumpkin_count=1..,stealing=39..}] title {"text":"✖","color":"red"}
title @a[scores={pumpkin_count=1..,stealing=39..}] subtitle {"translate":"game.pumpkins.limit","color":"gray"}
playsound minecraft:entity.villager.no master @a[scores={pumpkin_count=1..,stealing=39..}] ~ ~ ~ 300 0.8
scoreboard players set @a[scores={pumpkin_count=1..,stealing=39..}] stealing 0

item replace entity @a[scores={pumpkin_count=0}] armor.head with air
item replace entity @a[scores={pumpkin_count=1..}] armor.head with lime_dye{display:{Name:"{\"translate\":\"game.pumpkin\",\"color\":\"gold\",\"bold\":\"true\",\"italic\":\"false\"}"},CustomModelData:9,Enchantments:[{id:"binding_curse",lvl:1}]}
item replace entity @a[tag=invisible] armor.head with air