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.

2 Answers 2

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! Jul 14, 2015 at 21:17
  • 1
    Won't it trigger if get hit while falling?
    – l4m2
    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
    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
    Aug 26, 2018 at 2:56
0

THIS ANSWER USE @JacquesMarais ANSWER

1.16 SYNTAX

Create two scoreboard objectives:

/scoreboard objectives add fall minecraft.custom:minecraft.fall_one_cm

and:

/scoreboard objectives add damage minecraft.custom:minecraft.damage_taken

Then on a fill clock run:

/effect give @a[scores={fall=1..,damage=1..}] EFFECT_HERE
/scoreboard players reset @a fall
/scoreboard players reset @a damage

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .