Minecraft – How to detect if a person takes fall damage

minecraft-commandsminecraft-java-edition

I am trying to make a command block creation that when you take fall damage, it gives you an effect.
I am not using any of the methods that detect for air -1 meter of the player ( 1 , 2 ) because people will end up getting the effect if they are sneaking over a block or start jumping.

thanks for any help.

Best Answer

Create two scoreboard objectives like following:

/scoreboard objectives add fall stat.fallOneCm 

And:

/scoreboard objectives add damage stat.damageTaken

Then on a fill clock run:

/effect @a[score_fall_min=1, score_damage_min=1] EFFECT_HERE
/scoreboard players reset @a fall
/scoreboard players reset @a damage

How this works is that it effects all players with a fall distance statistic score of the minimum 1 which also has a damage taken statistic score of the minimum 1. After that it resets the scores so that it can happen again.