
# -> Randomize position
spreadplayers ~ ~ 16 128 false @s

# -> Move to surface
execute at @s \
    positioned over motion_blocking_no_leaves run \
        tp @s ~ ~ ~

# -> If block is not air then return and remove marker
execute at @s unless block ~ ~ ~ air run \
    return run \
        kill @s

# -> If block below cant have a puddle atop it then return and remove marker
execute at @s if block ~ ~-1 ~ #overly_realistic:cant_have_puddle_on run \
    return run \
        kill @s

# -> If biome has no rain then return
execute at @s if biome ~ ~ ~ #overly_realistic:has_no_rainfall run \
    return run \
        kill @s

# -> Create puddle
execute at @s run \
    setblock ~ ~ ~ water[level=7] strict

# -> If block below is dirt then turn it into mud
execute at @s if block ~ ~-1 ~ dirt run \
    setblock ~ ~-1 ~ mud strict

# -> Untag ent
tag @s remove OverlyRealistic.TempEnt