execute if block ~ ~-1 ~ air run tp @s ~ ~-1 ~
execute if block ~ ~-1 ~ air as @s at @s run function survivalplus:tools/farming/place_wild

#execute if entity @e[tag=wildp,distance=..6] run tag @e[tag=place_wild,distance=..5] add wildp
#execute if entity @s[tag=wildc,distance=..6] run tag @e[tag=place_wild,distance=..5] add wildc

#execute unless entity @e[tag=wildc,distance=..6] unless entity @e[tag=wildp,distance=..6] store result score random itemcount run random value 1..2
#execute if score random itemcount matches 1 run tag @s add wildc
#execute if score random itemcount matches 2 run tag @s add wildp

execute if predicate survivalplus:can_see_sky if block ~ ~-1 ~ #dirt run setblock ~ ~-1 ~ rooted_dirt
execute if predicate survivalplus:can_see_sky if block ~ ~-1 ~ #dirt if entity @s[tag=wildp] run setblock ~ ~ ~ potatoes[age=7]
execute if predicate survivalplus:can_see_sky if block ~ ~-1 ~ #dirt if entity @s[tag=wildc] run setblock ~ ~ ~ carrots[age=7]
kill @s