Lightning occasionally deals damage twice
The bug
Lightning sometimes does damage multiple times, instead of only once (which would be the expected behavior).
To reproduce
- Summon a zombie pigman
- Summon a Lightning bolt nearby with /summon minecraft:lightning_bolt
The pigman will sometimes take damage twice.
Code analysis
Based on 1.11 decompiled using MCP 9.35 rc1
Lightning bolts have two fields which are important for the following:
- lightningState: Initialized to 2
- boltLivingTime: Initialized to a random integer between 1 and 3 (both inclusive)
Every time a lightning bolt is updated it does the following:
- Reduce lightningState by 1
- If lightningState < 0
- If boltLivingTime: Set dead
- Else if lightningState < random integer between -9 and 0 (both inclusive)
- Reduce boltLivingTime by 1
- Set lightningState to 1
- If lightningState >= 0: Deal damage to entities
This means a lightning bolt can try to deal damage to entities up to 8 times with the last strike being in the 35th tick after the lightning bolt was created. This allows it to deal 20 damage to a player which would kill him.
- Unresolved
[Mod] Sonicwave- 24
- 11
- Confirmed
Normal
- Platform
- Entities
- damage lightning lightning_bolt
1.7.10 - 1.21.4-pre1
1.7.10 1.8 1.8.1-pre2 1.8.1-pre5 1.8.1 1.8.7 15w46a 15w47a 15w47b 15w47c 1.9.4 16w20a 1.10.2 1.11 1.11.2 17w14a 17w17a 1.12-pre2 1.12-pre3 1.12-pre5 1.12 1.12.1 1.12.2 17w43a 18w16a 18w21a 1.13-pre5 1.13 1.13.1 1.13.2 18w50a 1.14-pre5 1.14.4 19w40a 1.15-pre3 1.16-pre1 1.16.1 1.16.2 20w51a 21w03a 1.17 1.17.1 21w38a 21w40a 1.18-rc1 1.18 1.18.1 1.18.2 22w14a 22w18a 1.19-pre1 1.19 1.19.2 1.19.3 1.20.1-rc1 1.20.1 23w45a 1.20.3-rc1 24w03b 1.21 1.21.4-pre1
Created Issue:
Lightning Deals Damage Twice
After Lightning strikes and deals damage to mobs/players, after 1/2 a second it often does damage to mobs/players again, dealing a total of 10 damage (5 hearts) of damage, instead of 5 damage (2.5 hearts) as stated on the wiki.
http://minecraft.gamepedia.com/Thunderstorm#LightningThis is probably caused by the fact that lightning tries to do damage every tick, and since mobs/players have a "damage immunity" of 1/2 second (when the mob turns red after taking damage), the lightning damaged the mob right after the immunity ended.
http://minecraft.gamepedia.com/Damage#Damage_immunityEnvironment
Searched: Lightning, Lightning Damage
After Lightning strikes and deals damage to mobs/players, after 1/2 a second it often does damage to mobs/players again, dealing a total of 10 damage (5 hearts) of damage, instead of 5 damage (2.5 hearts) as stated on the wiki.
http://minecraft.gamepedia.com/Thunderstorm#LightningThis is probably caused by the fact that lightning tries to do damage every tick, and since mobs/players have a "damage immunity" of 1/2 second (when the mob turns red after taking damage), the lightning
damaged the mob right after the immunity ended.
http://minecraft.gamepedia.com/Damage#Damage_immunityAfter Lightning strikes and deals damage to mobs/players, after 1/2 a second it often does damage to mobs/players again, dealing a total of 10 damage (5 hearts) of damage, instead of 5 damage (2.5 hearts) as stated on the wiki.
http://minecraft.gamepedia.com/Thunderstorm#LightningThis is probably caused by the fact that lightning tries to do damage every tick, and since mobs/players have a "damage immunity" of 1/2 second (when the mob turns red after taking damage), and the lightning lasted longer than a 1/2 second, the lightning damaged the mob again.
http://minecraft.gamepedia.com/Damage#Damage_immunity
After Lightning strikes and deals damage to mobs/players, after 1/2 a second it often does damage to mobs/players again, dealing a total of 10 damage (5 hearts) of damage, instead of 5 damage (2.5 hearts) as stated on the wiki.
http://minecraft.gamepedia.com/Thunderstorm#LightningThis is probably
caused by the fact thatlightningtries to do damage every tick,and since mobs/players have a "damage immunity" of 1/2 second (when the mob turns red after taking damage), and the lightning lasted longer thana1/2 second, the lightning damaged the mob again.
http://minecraft.gamepedia.com/Damage#Damage_immunityAfter Lightning strikes and deals damage to mobs/players, after 1/2 a second it often does damage to mobs/players again, dealing a total of 10 damage (5 hearts) of damage, instead of 5 damage (2.5 hearts) as stated on the wiki.
http://minecraft.gamepedia.com/Thunderstorm#LightningThis is probably since lightning attempts to do damage every tick; and since mobs/players have a "damage immunity" of 1/2 second (when the mob turns red after taking damage), and the lightning lasted longer than the 1/2 second, the lightning damaged the mob again when its immunity ended.
http://minecraft.gamepedia.com/Damage#Damage_immunity
Lightning Occasionally Deals Damage Twice
Searched: Lightning, Lightning Damage
LightningOccasionallyDealsDamageTwiceLightning occasionally deals damage twice
After Lightning strikes and deals damage to mobs/players, after 1/2 a second it often does damage to mobs/players again, dealing a total of 10 damage (5 hearts) of damage, instead of 5 damage (2.5 hearts) as stated on the
wiki.
http://minecraft.gamepedia.com/Thunderstorm#LightningThis is probably since lightning attempts to do damage every tick; and since mobs/players have a
"damage immunity" of 1/2 second (when the mob turns red after taking damage), and the lightning lasted longer than the 1/2 second, the lightning damaged the mob again when its immunity ended.
http://minecraft.gamepedia.com/Damage#Damage_immunityThe bug
After Lightning strikes and deals damage to mobs/players, after 1/2 a second it often does damage to mobs/players again, dealing a total of 10 damage (5 hearts) of damage, instead of 5 damage (2.5 hearts) as stated on the wiki.
This is probably since lightning attempts to do damage every tick; and since mobs/players have a "damage immunity" of 1/2 second (when the mob turns red after taking damage), and the lightning lasted longer than the 1/2 second, the lightning damaged the mob again when its immunity ended.
Code analysis
Based on 1.11 decompiled using MCP 9.35 rc1
Lightning bolts have two fields which are important for the following:
- lightningState: Initialized to 2
- boltLivingTime: Initialized to a random integer between 1 and 3 (both inclusive)
Every time a lightning bolt is updated it does the following:
- Reduce lightningState by 1
- If lightningState < 0
- If boltLivingTime: Set dead
- Else if lightningState < random integer between -9 and 0 (both inclusive)
- Reduce boltLivingTime by 1
- Set lightningState to 1
- If lightningState >= 0: Deal damage to entities
This means a lightning bolt can try to deal damage to entities up to 8 times with the last strike being in the 35th tick after the lightning bolt was created. This allows it to deal 20 damage to a player which would kill him.
The bug
After Lightning strikes and deals damage to mobs/players, after 1/2 a second it often does damage to mobs/players again, dealing a total of 10 damage (5 hearts) of damage, instead of 5 damage (2.5 hearts) as stated on the wiki.
This is probably since lightning attempts to do damage every tick; and since mobs/players have a"damage immunity"of 1/2 second (when the mob turns red after taking damage), and the lightning lasted longer than the 1/2 second, the lightning damaged the mob again when its immunity ended.Code analysis
Based on 1.11 decompiled using MCP 9.35 rc1
Lightning bolts have two fields which are important for the following:
- lightningState: Initialized to 2
- boltLivingTime: Initialized to a random integer between 1 and 3 (both inclusive)
Every time a lightning bolt is updated it does the following:
- Reduce lightningState by 1
- If lightningState < 0
- If boltLivingTime: Set dead
- Else if lightningState < random integer between -9 and 0 (both inclusive)
- Reduce boltLivingTime by 1
- Set lightningState to 1
- If lightningState >= 0: Deal damage to entities
This means a lightning bolt can try to deal damage to entities up to 8 times with the last strike being in the 35th tick after the lightning bolt was created. This allows it to deal 20 damage to a player which would kill him.
The bug
Lightning sometimes does damage multiple times, instead of only once (which would be the expected behavior).
To reproduce
*Summon a zombie pigman
*Summon a Lightning bolt nearby with /summon minecraft:lightning_bolt
The pigman will sometimes take damage twice.Code analysis
Based on 1.11 decompiled using MCP 9.35 rc1
Lightning bolts have two fields which are important for the following:
- lightningState: Initialized to 2
- boltLivingTime: Initialized to a random integer between 1 and 3 (both inclusive)
Every time a lightning bolt is updated it does the following:
- Reduce lightningState by 1
- If lightningState < 0
- If boltLivingTime: Set dead
- Else if lightningState < random integer between -9 and 0 (both inclusive)
- Reduce boltLivingTime by 1
- Set lightningState to 1
- If lightningState >= 0: Deal damage to entities
This means a lightning bolt can try to deal damage to entities up to 8 times with the last strike being in the 35th tick after the lightning bolt was created. This allows it to deal 20 damage to a player which would kill him.
The bug
Lightning sometimes does damage multiple times, instead of only once (which would be the expected behavior).
To reproduce
*Summon a zombie pigman
*Summon a Lightning bolt nearby with /summon minecraft:lightning_bolt
The pigman will sometimes take damage twice.Code analysis
Based on 1.11 decompiled using MCP 9.35 rc1
Lightning bolts have two fields which are important for the following:
- lightningState: Initialized to 2
- boltLivingTime: Initialized to a random integer between 1 and 3 (both inclusive)
Every time a lightning bolt is updated it does the following:
- Reduce lightningState by 1
- If lightningState < 0
- If boltLivingTime: Set dead
- Else if lightningState < random integer between -9 and 0 (both inclusive)
- Reduce boltLivingTime by 1
- Set lightningState to 1
- If lightningState >= 0: Deal damage to entities
This means a lightning bolt can try to deal damage to entities up to 8 times with the last strike being in the 35th tick after the lightning bolt was created. This allows it to deal 20 damage to a player which would kill him.
The bug
Lightning sometimes does damage multiple times, instead of only once (which would be the expected behavior).
To reproduce
- Summon a zombie pigman
- Summon a Lightning bolt nearby with /summon minecraft:lightning_bolt
The pigman will sometimes take damage twice.Code analysis
Based on 1.11 decompiled using MCP 9.35 rc1
Lightning bolts have two fields which are important for the following:
- lightningState: Initialized to 2
- boltLivingTime: Initialized to a random integer between 1 and 3 (both inclusive)
Every time a lightning bolt is updated it does the following:
- Reduce lightningState by 1
- If lightningState < 0
- If boltLivingTime: Set dead
- Else if lightningState < random integer between -9 and 0 (both inclusive)
- Reduce boltLivingTime by 1
- Set lightningState to 1
- If lightningState >= 0: Deal damage to entities
This means a lightning bolt can try to deal damage to entities up to 8 times with the last strike being in the 35th tick after the lightning bolt was created. This allows it to deal 20 damage to a player which would kill him.

Damage that was dealt to mobs does not get applied after the damage immunity is over. If the game can't apply it at that moment, it never applies it.
Clarified the report:
Could it just be a simple random double strike? I tried testing it and it seems if any when I do hear a rapid dmg given its definitely at random times not consistent. I mean lightning does strike multiple times sometimes in the same bolt. And the best I can repeatedly try and repo this is about 1 in 20ish strikes. typical mobs are only taking 4 strikes to die (thats 20 hearts) with the occasional 3rd hit this was done in water so there is no fire dot possible to conflict with the dmg given.
No. If you summon a lightning bolt, you are summoning one entity. It should not deal damage multiple times. It is however possible that the lightning bolt constantly deals damage for a set amount of time.
I think it's intentional. Lightning in real life sometimes strikes multiple times, and I think that minecraft lightning is working the same way.
That's right, but in real life there is no way to control lightning, so there it doesn't really matter. But when you summon a single lightning bolt in Minecraft, you would also expect the impact of a single lightning bolt, and not of multiple ones.
Happens inconsistently in 1.11
To add on to this: Lightning seems to only set mob's HurtTime to 9 in the 1.13 snapshots, unlike 10 for everything else. So if lightning lasts for 0.5 seconds, there is a 1 tick window after the first damage instance in which stuff can take damage again.
Can confirm in 20w51a.
Can confirm in 21w03a.
Affects 1.17
I can confirm this behavior in both 1.17.1 and 21w38a.

MC-72028.mp4
MC-72028.png
Relates to MC-206922.
Also relates to MC-114217.
Can confirm in 21w40a.
Can confirm in 1.18.
Can confirm in 1.18.1.
Can confirm in 1.18.2.
Can confirm in 1.19.
Can confirm in 1.19.2.
Affects 1.20.1 Release Candidate 1