mojira.dev
MCPE-121688

Lightning strikes mobs through blocks

Lightning, multiple times, has struck mobs through a large amount of blocks.

Specifically: I had my cats sat down in an underground room, and was on the surface of that same area. Lightning struck THROUGH the blocks and unsat my cats, which didn't die/catch on fire but did immediately teleport to me. I assume they didn't die due to teleporting first. This has happened multiple times. 

It has also, in front of my eyes (unfortunately I wasn't recording), struck two different sets of chickens inside of a 1x1 block space, both of which had at least 1 block above them between them and the sky, killing both sets instantly.

Lightning has also struck multiple of my sheep through a trapdoor (I can only assume this as I didn't see it happen, but there was no other way to kill them, let alone any wolves or mobs around to harm them.)

Related issues

MCPE-120415 Villagers turn to witches while in caves 15 levels below ground MCPE-124170 Lightning Strikes & Murder MCPE-125815 Lightning striking through multiple blocks MCPE-126372 Lightning going through ground MCPE-126624 Lightning indoors MCPE-127061 Lightening is going through blocks and hitting inside covered and enclosed areas. MCPE-127746 Donkey spontaneously combusted MCPE-127920 Lightning strikes through buildings, solely at tamed entities. MCPE-127996 thunder storm glitch MCPE-128240 Friendly / unfriendly mobs dying for no good reason MCPE-129724 Lightning going through layers of blocks to hit mobs MCPE-135547 Lightning is striking underground when outside of the chunk MCPE-135917 Wodden ungerground base problem MCPE-136092 Iron Farm + Villagers = Witches Farm MCPE-138766 Lightning struck my house and killed two of my dogs. MCPE-141092 Lightning strikes through blocks and ignores lightning rods REALMS-8395 Parrot Struck by lightning while indoors

Attachments

Comments

migrated
[media][media]
migrated

I did find a similar bug report, but it was many versions ago and marked as resolved, so I thought a new report thread was a better idea.

migrated

Just happened again. Burnt a series (6) of my cats to death due to me being right next to where it struck, so they didn't teleport. I noticed it fast enough to see the flame in the corner of the room but not fast enough to take a screenshot. Struck through a LARGE amount of blocks AND an ocean.

migrated

Can you add the version you have observed the issue on lastly, to the affected versions?
Would it be possible to get a video of the issue and link/attach it here?

migrated

Hi - most recent observed version should be in the issue already as it was the most recent at the time of posting.

Unfortunately the issue is a lot too unpredictable for me to reliably be expecting it and wait/record for it, however I can show multiple different areas with varying blocks between them at the surface that have been affected (and haven't been altered since either), if that would be of any assistance. 

Will update again if I see it happen again but I try not to afk near my pets for their safety because of the bug.

migrated

Yes, please! Just export and attach the world - or elsewhere, if Jira won't handle the file, and link it here. And give me the coordinates of the place where that happened. 

migrated

It might be a little difficult for me to do, since it's a realm I'm not the owner of, but I'll ask the admin if he can download and send me the file for the bug report as I don't think he'd see an issue with it. Will update if I can/can't get it.

migrated

I’m told to export and upload my world to this thread, but your issue is opened for windows and mine is Xbox. I don’t even know how to export a world from Xbox to upload here. Any ideas??

migrated

Honestly, not sure mate. I'd recommend looking in your Xbox's files if you're able to access them.
For now though, I got permission from my admin! I have to link the file, since it's too big for Jira to handle: https://drive.google.com/file/d/1fjIst4mB9_IXvxwCPNfsJmjlGpbMOYeF/view?usp=sharing . We do use a couple datapacks but none of them should affect weather other than turning it to clear.

It's happened in a few places so I'll list each of them (Rough coordinates to teleport are -1770 20 1560.)
-Up the stairs on the surface, there's a pen with automatic sheep farms. The spots where sheep are missing is where it happened (The trapdoors were not open.)
-Also up the stairs, inside the chicken cooker. Both sets of chickens in this were struck in two separate lightning strikes.
-To the left of the portal, in the villager room, I've had multiple cats struck and teleport to me from being sat there, but no villagers struck.
-To the right of the portal, far down the corridor to your right, underneath the iron farm. Cats sat near the ladder were struck, I know because I caught a glimpse of the fire and cats running to me from there, burning.

As you'll see, all are under varying layers of blocks, but all are still below at least one full block or trapdoor. Oddly enough, I haven't seen this happen at other places, and haven't heard from other players of it happening to their mobs, but I wouldn't be surprised if it still could happen.
All incidents happened when I was afking in nearby chunks (I believe on top of/near a tree for the villager hall, sheep and chickens, and in the iron farm itself close enough that the cats didn't teleport when they got struck.)

GoldenHelmet

Well, I loaded Axyzel's world and looked around. Changed the weather to thunder while at the iron from, and immediately watched a lightning bolt pass through the layers of the farm and strike the cats at -1791, 20, 1698.

[media]

migrated

Glad it's not a personal/realms bug that would've been hard to test.

One thing I've noticed is, at least from what I've seen, it only ever seems to occur when striking mobs, never just random blocks. Perhaps its an issue in how it decides mobs are/arent eligible to be struck?

migrated

Now that I got the download, I was actually able to safely sit down for a while and record to get footage of it! I've clipped it to just the event, followed by proof of numerous blocks between the surface and where the strike happened.

It's too big to upload directly, so I'm linking it instead. 

https://youtu.be/NkRVaCBhcrY

migrated

 Also happened to my villagers in multiple occasions. My trading hall is over 10 solid blocks underground, with no sky access anywhere around 50+ blocks, and they constantly turn into witches. I had to enable cheats in my world and disable the weather cycle. Found this youtube evidence as well: https://m.youtube.com/watch?v=jEAfxLnaiic

 

migrated

Happened to me again today on 1.16.221 on Windows 10. I lost my 3rd parrot to this bug in a few weeks + my brown panda as well 😞 - all these animals were underground, below many blocks so they were supposed to be safe from lightning.

migrated

Oh wow, I did wonder if the cat got woke up by the sound of thunder. I guess it was a lightning strike through the ceiling. Sadly it appeared just as I triggered a charged creeper, so now I have string lol

GoldenHelmet

Removed "Clones" link to MCPE-9943 because this is not a regression of that issue. The issue on MCPE-9943 was that the area of effect from lightning strikes extended vertically 3 blocks, so it would affect mobs underneath low 1-block ceilings. The fix for that was still effective when I tested lightning mechanics a couple of months ago (maybe 1.16.200?). What is reported this ticket is that lightning strikes mobs directly far below the surface.

migrated

the lightning went through glass and turned a villager to a witch and it also went through a lot of blocks to ignite a fire and burn down the animal pens and killing my animals 

migrated

This has happened to me multiple times in my 1.17 Bedrock Realm, through at least 20 blocks, killing seven sheep in my wool farm. No reason to bother replacing them until this is fixed.

AristoLynx

All on separate occasions, I've lost all my sheep, my pigs, and a parrot... Even though they were all 32 blocks underground. I now pretty much resort to going miles away from my base or logging out when a thunderstorm happens so no more of my animals die.

Quite a few of my friends have also lost quite a few dogs as well. Some of the dogs were on their last heart, but you couldn't tell as their tails weren't down, so that's also something to be aware of.

mcconcma

PS4, 1.17.0.  During a thunderstorm, heard thunder nearby and then the sound of multiple cows on fire.  Went to underground animal pen and all 3 (newly acquired) cows were dead, hay bales and wood decoration blocks on ceiling and walls were on fire.  From the ground of the pen, there's 2 open air blocks, a top-half slab ceiling (2.5 height total) and a minimum of 6, max 10 solid blocks above the half slabs before you reach open air.  

Lightning rods now placed everywhere.  Also going to redesign bases with fire-breaks.  If I had not caught this fire, it would have taken out all of my early game storage.

migrated

Also had this same issue today, local co-op with two players. The only two lightning strikes that happened before we threw down beds to make the storm stop, specifically targeted our animals and nowhere else, even though all were indoors and the parrots were under two roofs. Nine parrots all dead at the first lightning strike. Second lightning strike hit inside the house in the room where we keep the cats and dogs, and specifically hit a cat, taking out the dog and cat on either side of her as well. Seems entirely not random at all that lightning is SPECIFICALLY targeting tamed animals. It’s extremely frustrating and upsetting. An aspect of the game entirely meant for pure enjoyment, having pets, that feels intentionally being obliterated. What’s the point in going through the effort to collect the cute little mobs we love, going through the hassle of acquiring name tags for them all, just to have lightning specifically target and burn them to death through multiple layers of blocks?

It honestly makes me not want to play until this is resolved. No, it’s not game-breaking, but it sure as heck ruins a lot of the fun. 

racartwright

Code Analysis
Between 1.16.100 and 1.17.0, the lightning code was refactored. In 1.16.100, lightning bolts and skeleton traps were simulated separatly. Lightning bolts only struck the surface, while traps could strike and entity or the surface. This separation was probably due to a patch made to fix the bug mentioned in this report. However, during the refactoring, bolts and traps are now linked in 1.17.0, causing this bug to reemerge.

Lightning is spawned by LevelChunk::tickBlocks(). This function does a lot of things, but I'll focus only on the lightning spawning algorithm. The algorithm looks roughly like this

if(isLightning() == false) {
  goto END
}
if(randInt(100000) != 0) {
  goto END
}
pos = randBlockpos()
target = findLightningTarget( pos )
target_biome = getBiome(target)
if( isRaining(target_biome) == true && isColdBiome(target_biome) == false ) {
  trySpawnSkeletonTrap(target)
  spawnLightning(target)
}

END:

Now findLightningTarget(pos) can find three different targets
(1) the top rain block in the same vertical column as pos.
(2) a random entity (with entity type 0x1300) in the chunk
(3) a lightning rod near position (1)

The "top rain block" is the block right above the highest block in the column with a material that blocks precipitation.

A lightning rod can only be found if it can see the sky and is getting rained on.

If a random entity is chosen the game does NOT check to see if it can see the sky and is getting rained on. This is why people's pets are getting struck by lightning deep under ground.

Before refactoring, the game would double check that the result of findLigntningTarget(pos) was valid, but this was eliminated in the refactoring, exposing the bug.

*Suggested Fix*
After a random entity is chosen, the game should check that it can see the sky and is getting rained on similar to a lightning rod. If the check fails, the game should fall back to using the random surface block defined by (1).

migrated

RE: what Reed said - 

Personally, I've never seen this bug fixed in any version my realm's gone through, so the separation probably didn't actually fix it.

 

Something tells me that skeleton horse traps probably shouldn't trigger on mobs that aren't skeleton horses. So perhaps a fix in the code should randomly chose an entity that is the CORRECT mob type, and also that hasn't already experienced the trap before (i.e. hasnt triggered the trap by going near to it).

Also, skeleton horse traps are usually triggered on proximity to a player - this bug isn't at all effected by how close you are to the mob, only that they're loaded within your render distance.

 

So there's a couple of fixes here that might be a better idea:

1) Check that the mob is in fact an unused skeleton horse. If it's not, don't strike it with lightning. 

2) Check that the mob can see the sky and rain, like Reed suggested. (Though the traps are intended to trigger without these conditions. I've seen it happen in clear skies under trees with the intended skeleton horse mob. It's completely not meant to affect ANY other mob.)

3) Check that the mob is in close proximity to the player in order to properly trigger it, instead of randomly if it's loaded. That's why it's a trap, it catches you off guard going near it.

GoldenHelmet

Azyzel: I think you've misunderstood Reed's comment. The function spawns skeleton trap horses. It would not make sense for it to only spawn one if there was one already present.

Lightning should strike in one of 3 ways: (1) strike a random spot on the surface (2) strike a random mob on the surface, or (3) strike a random spot and spawn a skeleton trap horse there (maybe only on the surface, not clear to me). The bug is just that it does not check for surface if it chooses the random mob target.

I do think Reed is incorrect about 1.16.100 trying to fix this bug, since this bug only started in 1.16.210. My guess would be that they refactored the lightning code to incorporate lightning rods, and decided to merge the two legacy functions instead of adding a third or modifying both separately, in order to give priority to lightning rods in the choice of position so that lightning rods would be reliable. (I.e. it would be bad if lightning rods only worked for regular strikes and not trap horse strikes.)

migrated

Ahhh, it makes more sense that it's to spawn them not strike them. Though, surely there's a unique strike code for when they're triggered - I wonder why that isn't grouped with the lightning itself?

 

In that case, the fix to check for the entity having sky access is probably the right one to take. Hopefully it gets fixed soon, it's a shame what seems (I know it may not be) like such a simple thing has taken so long to identify and resolve. 😞

migrated

I was in my stone brick 3 storey mansion, and my pet wolf on the bottom floor inside was hit by lightning and killed. I have more pets in the house, and am now scared for them. Is there anything we can do to protect them until this bug is fixed? This is so sad to be happening 😢

migrated

Unfortunately the only way I've found to be sure your pet won't get hit is don't be near the chunks they're in when it storms. That is, if you need the storm/to afk, if you don't you can sleep through any to force them to go away for now.

TheTamedWolf

This just happened to me on windows 10 and scared the crap out of me. First strike in the storm no warning. Underground. Inside a large hill. Most of my wolves caught fire and 2 died. I was on fire and literally thought it was a hacker. It was upsetting. I didn't know what happened until another strike happened near by when I went outside. It was crazy. Not sure this happened to me before. But it happened to my friend with their cats too. 1.17.10.

migrated

https://www.youtube.com/watch?v=5gW8c93p93Y&ab_channel=Satoshuni

One of my Realm Members managed to grab this clip, this bug needs to be addressed in the next update as its only gotten worse in 1.17.10.

migrated

We've observed this bug on a private server. Thus far it's wiped out 3/4's of a cow farm and lit the interior of someone's house on fire. House wasn't mob proofed until recently so I can't rule out a hostile mob having spawned inside and then having been struck by lightning but so far as we know the fire just spontaneously started from a lightning strike.

 

I've confirmed that channeling tridents can't summon lightning on to lightning rods below slabs although I haven't messed around with more than 1 air block above the lightning rod so ... Incomplete testing.

 

Either way for now it's a good thing we have lightning rods. Time to deploy a lot of them. Especially around our trading halls.

GoldenHelmet

This bug is fixed in beta (note the Fix Version in the report header) and the fix should be included in the next release version. No precise time can be given.

At this point we really do not need more information or test results.

migrated

Lightning rods do nothing for this bug. Hoped I found a fix in game presently yet it won't even redirect lightning strikes like 4 blocks away if it wants to hit a villager or sheep or anything. Please roll out the update ASAP this is the 8th time I've had to redo hours of work in the past 2 weeks I kid you not. Bedrock developers are so slow seriously hurry it up.

migrated

(Unassigned)

513789

Confirmed

Multiple

Windows 10

1.17.11 Hotfix, 1.17.20.22 Beta, 1.17.10, 1.16.220, 1.16.220.50 Beta, 1.16.210, 1.16.221 Hotfix, 1.17.0

1.17.20.23 Beta, 1.17.30

Retrieved