mojira.dev
MC-82235

Baby pigs turn into adult zombie pigmen when struck by lightning

The bug

When lighting strucks a baby pig, it turns to an adult zombie pigman.

How to reproduce

  1. Spawn a baby pig.

  2. 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

Comments 15

this is a feature request, the behaviour of a baby pig being struck and turning into a baby zombie pigman has never been introduced

This could be a feature, but could be "fixed" and added as a feature.

yet this has never been introduced, so it's a feature request

Incorrect resolution. Please reopen immediately.

Did you even read my comments above? This is a feature request, not a bug.

5 more comments

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.

Confirmed for 1.13.1.

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 🙂

Renaming

Felix Jones

Confirmed

(Unassigned)

Minecraft 1.8.7, Minecraft 1.10.2, Minecraft 16w38a, Minecraft 1.11, Minecraft 1.11.2, ..., Minecraft 19w03a, Minecraft 19w03b, Minecraft 19w03c, 1.14.4, 19w39a

20w06a

Retrieved