
# -> If star is within a non-air block then return and remove
execute unless block ~ ~ ~ #air run \
    return run \
        function overly_realistic:general/celestial_bodies/shooting_star/remove_shooting_star

# -> Add to life
scoreboard players add @s OverlyRealistic.General.ArbitraryData 1

# -> If lifetime is over max then return and remove
execute if score @s OverlyRealistic.General.ArbitraryData matches 500.. run \
    return run \
        function overly_realistic:general/celestial_bodies/shooting_star/remove_shooting_star

# -> If position is unloaded then return and remove
execute unless loaded ~ ~ ~ run \
    return run \
        function overly_realistic:general/celestial_bodies/shooting_star/remove_shooting_star

# -> Particles
particle flame ~ ~0.165 ~ 0.1 0.1 0.1 0.01 5 force @a[distance=..512]
particle flame ^ ^ ^-3 0.1 0.1 0.1 0.01 5 force @a[distance=..512]
particle flame ^ ^ ^-6 0.1 0.1 0.1 0.01 5 force @a[distance=..512]
particle flame ^ ^ ^-10 0.1 0.1 0.1 0.01 5 force @a[distance=..512]

# -> Move star
tp @s ^ ^ ^0.5
