So, I would like to summon Lightnings on players so that they receive roughly 2 hearts of damage.

With my current system, it looks like if you stay for a moment in the fire you receive double damage.

I don't care to remove all fire blocks from the map in order to fix this...

Here's how I set up the command blocks:

/testfor @e[type=Item] {Item:{id:minecraft:nether_star}}

comparator with repeaters to add a delay and then

/scoreboard players set @e[type=Item] Light 1 {Item:{id:minecraft:nether_star}}
/execute @e[score_Light_min=1] ~ ~ ~ execute @a[r=6] ~ ~ ~ effect @p fire_resistance 6 1 true
/execute @e[score_Light_min=1] ~ ~ ~ execute @e[r=6] ~ ~ ~ summon LightningBolt

As you can see I tried giving the hit players fire resistance, but they still get that weird damage right after the get struck by the bolt...

  • It's possible they're getting struck twice by the same bolt. – MBraedley Sep 26 '15 at 22:42

Lightning, regardless of whether or not you are standing in fire, will often hit an entity twice in a row. You can see this by standing in water and summoning a bunch of LightningBolts and watching your health.

To get around this, you could give the player a high level of resistance 1 tick after the lightning strikes so that they take no damage from the second hit (if it occurs). For example:

execute @p ~ ~ ~ summon LightningBolt

A 1 tick delay so the first hit counts, and then:

effect @p minecraft:resistance 1 5

To solve this problem, you can do this command after the lightning is summoned:

execute @e[score_Light_min=1] ~ ~ ~ execute @e[r=6] ~ ~ ~ kill @e[type=Fire]

This will kill the fire entity in a six block radius.

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.