# se uită într-o direcție random apropiată
execute unless entity @e[type=player,distance=..15] as @e[type=bat,tag=samsung_ad_drone] at @s run tp @s ~ ~ ~ facing entity @e[distance=1..15,sort=random,limit=1,tag=!ad_recived,type=#samsung:drone_cannot_look_at] eyes
execute if entity @e[type=player,distance=..15] as @e[type=bat,tag=samsung_ad_drone] at @s run tp @s ~ ~ ~ facing entity @p[distance=1..15] eyes

# se deplasează înainte (zbor)
execute as @e[type=bat,tag=samsung_ad_drone] at @s if block ^ ^ ^1 #samsung:entities_can_go_trough run tp @s ^ ^ ^1

# menține altitudinea (nu cade)
execute as @e[type=bat,tag=samsung_ad_drone] at @s if block ~ ~-2 ~ #samsung:entities_can_go_trough run tp @s ~ ~0.05 ~

# dacă e prea jos → urcă
execute as @e[type=bat,tag=samsung_ad_drone] at @s unless block ~ ~-2 ~ #samsung:entities_can_go_trough run tp @s ~ ~0.3 ~

#execute as @e[type=bat,tag=samsung_ad_drone] unless entity @e[type=player,distance=..15] at @s if entity @e[type=villager,distance=..15.,tag=!ad_recived] run tp @s ~ ~ ~ facing entity @e[type=villager,limit=1,sort=nearest,tag=!ad_recived] eyes

# daca e prea sus → coboara
#execute as @e[type=bat,tag=samsung_ad_drone] at @s if predicate samsung:above_256 run tp @s ~ ~-25 ~

# Programare
schedule function samsung:ad_drone/move 2.5t