3

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...

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

2 Answers 2

1

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
-1

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.

You must log in to answer this question.

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