I'm making a game that requires for a lightning bolt to be spawned above everyone's heads every 3 seconds (so that they can be tracked). However, if a player is standing directly below another player when the lightning strikes, the lightning deals damage to the player above. Is there any NBT tag I could use to negate lightning damage? If not, can you think of any other possible workarounds?
Minecraft – ny way to make lightning bolts deal no damage
minecraft-commandsminecraft-java-edition
Related Topic
- Minecraft – Add multiple NBT tag Tags
- Minecraft – Making crafted items usable in adventure mode
- Minecraft Java Edition – Unraveling the Mystery of the Dead Sheep
- Minecraft Java Edition – How to Make Lightning Bolts Deal More Damage Using Minecraft Commands
- Minecraft Java Edition – How to Make Fireworks Deal No Damage in Version 1.15
- Minecraft Java Edition – How to Detect Diamond Deposits in Chest Using Command Blocks
- Minecraft – the correct way of using /data merge on entity tags such as Passengers and Tags and Team
Best Answer
When summoning a LightningBolt with
/summon
, NBT input is ignored, so there is no NBT data you can provide.As an alternative, 1.9 introduces a new block called the End Gateway, which produces beams of light similar to beacons. Unlike beacons, there is no need for a specific structure and the beam will go through all blocks (both upwards and downwards).
You could potentially setblock an end gateway at Y0 via
/execute
to produce the same sort of effect without damaging the player. TheAge
long tag for end gateways will create a magenta beam of light so long as the value is below 200, so you can use that to specify the duration the beam should last for.Note that end gateway blocks will not teleport entities if the
ExitPortal
compound is not defined, but its beam will still become yellow if an entity enters it whileAge
is 200 or higher. If you wanted yellow beams instead of magenta, you could create the end gateway as well as summon an entity that will despawn after a set amount of time.For example, the following creates an end gateway with an AreaEffectCloud entity inside it that will despawn after 100 ticks (5 seconds):