Skip to content

PhaseState exception: Cat cannot be cast to Wolf #4220

@AlexandreArcil

Description

@AlexandreArcil

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs triageThis label is automatically applied to new issues and pull requests to indicate they require triagetype: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions