The bug
When lighting strucks a baby pig, it turns to an adult zombie pigman.
How to reproduce
Spawn a baby pig.
Run
/summon lightning_bolt
→ ❌ Baby pig turns into an adult zombie pigman
Code analysis
Code analysis / fix can be found in this comment by @unknown.
Linked issues
is duplicated by 3
Comments 15
Every version matters, and it helps to see if the bug changed in certain version, to see what code changed between them.
Since you're so unwilling, could you please tell me how to become a moderator so I can remove it myself?
Sigh
Nobody, not even mojang can remove archieved versions.
Remember Rules of Fight Club ? Same for becoming a moderator - Don't ask for it. The Bug Tracker will ask you.
Please link this in the description of the report.
The following is based on a decompiled version of Minecraft 1.12 using MCP 940.
In the method net.minecraft.entity.passive.onStruckByLightning()
where all the code is handled for if the pig gets hit by lighting, is no code to check if the pig is a child or adult and to set it if so.
To fix this problem, you gotta add this piece of code in the method.
entitypigzombie.setChild(this.isChild());
This will check if the pig is child or not, and if the pig is a child it will set it as a child when it becomes a zombie pigman.
Hope this helps 🙂
this is a feature request, the behaviour of a baby pig being struck and turning into a baby zombie pigman has never been introduced