Closed Xalcon closed 2 years ago
fixed in dev
I had a quick look and your fix didn't work.
You are still using the mojang symbol name lastHurtByPlayerTime
, which is defined in the mojang mappings. Those mappings are only applied in development environments. In production environments (i.e. when launching the game normally), forge uses SRG names since every mod can use their own set of mappings during development. Mods are re-obfuscated during the build process to use SRG names instead, but strings are not touched.
To fix this, you will either need to select the correct name depending on the runtime environment (MOJ for Dev, SRG for Prod) or switch to access transformers.
For my private modpack I've fixed the issue using the latter:
accesstransformer.cfg
:
public net.minecraft.world.entity.LivingEntity f_20889_ # lastHurtByPlayerTime
And then replace the whole try-catch block with
entity.lastHurtByPlayerTime = 100;
Describe the bug When an entity is hit by the golden spikes, the console is spamed with
java.lang.NoSuchFieldException: lastHurtByPlayerTime
and the entity does not drop any xp on death.To Reproduce Steps to reproduce the behavior:
Expected behavior No error, xp drop on death
Mod Info (please complete the following information):