The bug
While I was testing things with the sculk catalyst, I had noticed that killing baby animals caused the catalyst to spread sculk even though they don't drop any experience.
Expected result
Baby mobs dying wouldn't spread sculk, since they don't drop experience.
Code analysis
Code analysis can be found in this comment.
Attachments
Comments 3
Isn't this consistent with other deaths that don't drop XP, such as non-player kills and frogs eating slimes (MC-249255)?
Code analysis (Mojang mappings, 22w12a):
The logic for sculk catalysts spreading sculk can be found in
SculkCatalystBlockEntity#handleGameEvent(...). In order to spread sculk, it gets the mob's experience reward, but there is no check to see if the entity should drop experience (that is, if it is not a baby):A flawed fix would be replacing
with
However, this would cause a new issue: baby zombies drop 2.5 times more experience than regular zombies, and they would not cause sculk conversion with this change.