Crash on villager death by non-entity source
maxanier opened this issue ยท 1 comments
Describe the bug
The game crashes if a child of a player (or a married villager) is killed by a non player/mob caused damage source (fall damage, fire, magic, ...).
In EntityVillagerMCA#onDeath
source.getImmediateSource().getName()
is called. However, getImmediateSource
can be null (for non entity caused sources) and is even annotated nullable.
Therefore the game crashes here:
or here:
Steps to Reproduce
Please include steps we can take to reproduce the bug:
- Marry villager or create child
- Kill them by fall damage, or fire.
Minecraft Information (please complete all questions entirely):
- Minecraft Version: 1.12.2
- Forge Version: 14.23.5.2847
- MCA Version: 6.0.1
Additional context
Original issue was reported on the MC Forum for my mod Vampirism:
But Vampirism is only involved by calling entity.attackEntityFrom(DamageSource.MAGIC, 1000);
which should be absolutely fine.
TeamLapen/Vampirism#531
Crashlog: https://pastebin.com/SnPxvvdZ