mojira.dev
MC-194915

Spam lightning causes immense lag

On my realm, my friends and I created a joke that whenever something stands on a bone block, they get struck with lightning until they die or get off the block. In 1.15.x, this was all well and good as all it was was just a random noise here and there etc, but now in 1.16 and 1.16.1, whenever anything causes the spam lighting, even for a short period of time, it causes immense lag to the point of the server crashing sometimes. The exact command we used is listed below.

/execute at @e if block ~ ~-1 ~ minecraft:bone_block run summon minecraft:lightning_bolt

Comments 6

Can reproduce in 20w28a. It practically freezes the tick cycle.

Very effective lag machine

Not really, as you need a command block or similar to produce the lag

"Very effective lag machine"
/give @a minecraft:stone 99999
Extremely high lag machine

Wow, this is quite exciting! Until the server crashes.

This is actually Working As Intended. Here's why:

In 1.16 lightning_bolt entities can be selected using commands.

Your command spawns lightning when any entity (including lightning) stands on a bone block.

So when you step onto a bone block, one lightning bolt is spawned.
Next tick, there are two entities on the bone block (one player and one lightning bolt) so two more lightning bolts are spawned.
Next tick, there are 4 entities on the bone block, so 4 more are spawned... you get the idea!

Fix by making the command ignore lightning:

/execute at @e[type=!lightning_bolt] if block ~ ~-1 ~ minecraft:bone_block run summon minecraft:lightning_bolt

 

Seager Nentwig

(Unassigned)

Community Consensus

Important

Crash, Performance

1.16.1, 20w29a, 20w30a, 1.16.2 Pre-release 1, 1.16.2 Pre-release 3, 1.16.2 Release Candidate 1

Retrieved