tag @e[r=12,family=mob] add PlayerGardenerTarget
tag @e[r=12,family=goat] add PlayerGardenerTarget
tag @e[r=12,family=fish] add PlayerGardenerTarget
tag @e[r=12,family=panda] add PlayerGardenerTarget
tag @e[r=12,family=piglin] add PlayerGardenerTarget
tag @e[r=12,family=monster] add PlayerGardenerTarget
tag @e[r=12,family=ender] add PlayerGardenerTarget
tag @s remove PlayerGardenerTarget

execute at @e[r=12,tag=PlayerGardenerTarget] unless block ~ ~-1~ air run summon ldz:gardener_flower ~ ~ ~
execute at @e[r=12,tag=PlayerGardenerTarget] unless block ~ ~-1~ air run summon ldz:ender_gardener_projectile ~ ~-0.5 ~ ~ ~ add_flower_attack
execute at @s unless entity @e[r=12,tag=PlayerGardenerTarget] run summon ldz:gardener_flower ~ ~ ~
execute as @e[r=16,type=ldz:gardener_flower] at @s run function bring_closer_to_ground