Mojira Archive
MC-251936

Zombie EXP Value is mutated each get

Each time getExperience is called, the xpReward of Zombie increases, as a mutation is occuring in the getter.

protected int getExperienceReward(Player pPlayer) {
   if (this.isBaby()) {
      this.xpReward = (int)((double)this.xpReward * 2.5D);
   }

   return super.getExperienceReward(pPlayer);
} 

In the super call, xpReward is not mutated, just used as a base value for the xp calculations that occur, adding any relevant held items or armor bonuses. 

Because of this, you can infinitely increase the xpReward of a baby zombie each time this method is called if the entity does not immediately get removed from the world after. As far as I know, this does not currently impact vanilla gameplay, unless someone would be able to kill and un-kill an entity using some type of command block commands, but this is a bit of a sneaky bug that may be run into soon, and has to be accounted for in non-vanilla instances.

Invalid

baileyholl

2022-05-19, 06:02 PM

2023-07-14, 07:18 AM

2023-07-14, 07:18 AM

2

3

Plausible

(Unassigned)

1.18.2

-