6

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.

1 Answer 1

7

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.

4
  • @user3878893 No problem! Commented Jul 14, 2015 at 21:17
  • 1
    Won't it trigger if get hit while falling?
    – l4m2
    Commented May 12, 2018 at 13:39
  • Yes, altough that would be trivial to fix in 1.13, by adding nbt={OnGround:1} to the selector.
    – pppery
    Commented Aug 26, 2018 at 2:55
  • 1.13 syntax: minecraft.custom:minecraft.(fallOneCm|damageTaken) for the scoreboards, and the effect command needs to be changed to /effect give @a[scores={fall=1..,damage=1..}] ...
    – pppery
    Commented Aug 26, 2018 at 2:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.