5

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.

6

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.

| improve this answer | |
  • @user3878893 No problem! – Jacques Marais Jul 14 '15 at 21:17
  • 1
    Won't it trigger if get hit while falling? – l4m2 May 12 '18 at 13:39
  • Yes, altough that would be trivial to fix in 1.13, by adding nbt={OnGround:1} to the selector. – pppery Aug 26 '18 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 Aug 26 '18 at 2:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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