Sponge icon indicating copy to clipboard operation
Sponge copied to clipboard

PhaseState exception: Cat cannot be cast to Wolf

Open AlexandreArcil opened this issue 5 months ago • 0 comments

Affected Product(s)

SpongeVanilla

Version

1.21.4-14.0.0-RC2272

Operating System

Windows

Java Version

21.0.5

Plugins/Mods

None

Describe the bug

When a cat/ocelot attack a rabbit, a PhaseState exception is thrown. It seems that the method resolvePlayerResponsibleForDamage in LivingEntity modified by the mixin LivingEntityMixin_Vanilla_Damage contains a cast to Wolf:

Class var10001 = this.constant$bdf000$damage$onWolfCast($$1, Wolf.class);
if (var10001 == null) {
   throw new NullPointerException("@ModifyConstant instanceof handler net/minecraft/world/entity/LivingEntity::damage$onWolfCast returned null for class type");
} else {
   if ($$1 != null ? var10001.isAssignableFrom($$1.getClass()) : false) {
      Wolf $$3 = (Wolf)$$1;
...

Link to logs

https://gist.github.com/AlexandreArcil/50e48b3232217dee34f24d0579dc6d20

AlexandreArcil avatar Jul 25 '25 16:07 AlexandreArcil