The Bug
When a villager is struck by lightning, the event is logged to the console, despite this being unnecessary.
The log message is logged with log level INFO
, and is something like this (it will vary):
Villager cmk['Villager'/189, l='ServerLevel[New World]', x=13.32, y=-59.64, z=12.55] was struck by lightning btm['Lightning Bolt'/193, l='ServerLevel[New World]', x=13.11, y=-60.00, z=12.11].
Is there a need to do this? In the case of MC-165985 (Villager deaths are logged), it was (and still is) used to catch the bug of MC-153904.
How to Reproduce
Summon a villager.
Strike it with lightning using a trident enchanted with Channeling, or by summoning a lightning bolt near it.
When it turns into a witch, look into the game logs.
β Note how the event is logged.
Code Analysis
First time doing an code analysis; please correct any mistakes! π
Decompiled source code of Minecraft 1.20.6 using Yarn mappings.
In the function onStruckByLightning
in VillagerEntity.class
located in /net/minecraft/entity/passive
Β on line 756:
LOGGER.info("Villager {} was struck by lightning {}.", this, lightning);
Removing this line of code should fix the issue.
Additional Notes
Related to MC-165985.
Also, I'm not sure if this has been reported yet or not. I'm reporting it just in case.
Linked issues
duplicates 1
Comments 2
Thank you for your report!
We're tracking this issue in MC-165985, so this ticket is being resolved and linked as a duplicate.
That ticket has already been resolved as working as intended, which means this is not considered a bug and won't be fixed. Please do not leave a comment on the linked ticket.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
π Bug Tracker Guidelines β π¬ Community Support β π§ Mojang Support (Technical Issues) β π§ Microsoft Support (Account Issues)
π Project Summary β βοΈ Feedback and Suggestions β π Game Wiki
This is intentional. It is also a measure taken to help find the cause of MC-153904, since villagers being struck by lightning and turning into witches is also something that makes villagers disappear, just like death.