
# -> Reset adv trigger
advancement revoke @s only overly_realistic:player/predicate_vars/falling/pred_var_disable

# -> Set value
scoreboard players set @s OverlyRealistic.PredicateValue.IsFalling 0

# -> Do fall damage operations
function overly_realistic:players/water_fall_damage/player_fell

# -> Reset FallSoundTime
scoreboard players reset @s OverlyRealistic.Player.FallSoundTime

# -> Stop wind sound
stopsound @s ambient minecraft:item.elytra.flying

# -> If player is flying then return
execute if entity @s[gamemode=creative] \
    if predicate overly_realistic:player/actions/player_is_flying run \
        return fail

# -> Fall sound
execute unless block ~ ~ ~ water run \
    playsound entity.player.small_fall player @s ~ ~ ~ 0.5 1
