Origins (Fabric)

Origins (Fabric)

15M Downloads

Power "modify_falling" in combination with Condition "fall_distance" doesnt work as intended

ChromexUnderscore opened this issue ยท 1 comments

commented
{
    "type": "origins:modify_falling",
    "velocity": 0.08,
    "take_fall_damage": false,
    "condition": {
        "type": "origins:fall_distance",
        "comparison": "<",
        "compare_to": 30
    }
}

For some reason, this is not working the way it should technically.
It is supposed to make it so you only take fall damage when you fell for more than 30 blocks, but it makes the player completely invulnerable to any fall damage whatsoever, from 10, 20, 30, 40, 50 and even 100 blocks.

commented

ModifyFallingPower is actually ticking, as it's function is realized by a mixin to LivingEntity#travel which is called every tick.
What's more, the take_fall_damage field is actually realized by setting entity's fall distance to 0.
So here's the problem: as you use fall distance < 30 as a condition, it will be satisfied from the very beginning of the fall, thus causing the fall distance to be set to 0 on the first tick. So, no more fall distance will be stacked in this occasion and it will never reach 30.
I think a possible solution from the mod's side is to add an optional extra field to modify the distance where one start taking fall damage (in vanilla the value is 3). I will make an PR to Apoli follow the possible solution, however it could take time to merge and is likely to join the game on a new release (don't know if this may help, as you aren't mentioning your game and mod version).