Mob Origins

Mob Origins

4M Downloads

Crash when camera entity is not a LivingEntity

parzivail opened this issue ยท 2 comments

commented

The client camera entity is modified by a few mods to be a plain Entity or subclass that doesn't inherit LivingEntity, so this explicit cast throws an exception:

LivingEntity livingEntity = (LivingEntity) (MinecraftClient.getInstance().getCameraEntity());

commented

Ah, I'll wrap that in a instanceof check

commented

A more specific example of this case would be the camera entity used by PSWG's ship chase cam.
The question there would be, should that mixin still apply if the player is flying a ship? If so, you'd want a way to either get its "owner" in some way or get the player entity instead.