
# -> Check the fallDamage gamerule
execute store result score #or.fall_damage_gamerule OverlyRealistic.General.ArbitraryData run \
    gamerule fall_damage

# -> If fallDamage gamerule is disabled then return
execute if score #or.fall_damage_gamerule OverlyRealistic.General.ArbitraryData matches 0 run \
    return fail

# ---> Calculate fall damage

# -> Tag boat
tag @s add OverlyRealistic.FallingBoat

# -> Calculate fall damage for passengers
execute on passengers at @s run \
    function overly_realistic:general/boats/boats_calc_fall

# -> Untag boat
tag @s remove OverlyRealistic.FallingBoat