Fix mobs ignore player (#986)

This commit is contained in:
IzzelAliz 2023-05-11 10:32:17 +08:00
parent 216cf6b404
commit ef1854ccb2
No known key found for this signature in database
GPG Key ID: EE50E123A11D8338

View File

@ -137,7 +137,7 @@ public abstract class MobMixin extends LivingEntityMixin implements MobEntityBri
} }
} }
var changeTargetEvent = ForgeHooks.onLivingChangeTarget((Mob) (Object) this, livingEntity, LivingChangeTargetEvent.LivingTargetType.MOB_TARGET); var changeTargetEvent = ForgeHooks.onLivingChangeTarget((Mob) (Object) this, livingEntity, LivingChangeTargetEvent.LivingTargetType.MOB_TARGET);
if (changeTargetEvent.isCanceled()) { if (!changeTargetEvent.isCanceled()) {
this.target = changeTargetEvent.getNewTarget(); this.target = changeTargetEvent.getNewTarget();
// noinspection removal // noinspection removal
ForgeHooks.onLivingSetAttackTarget((Mob) (Object) this, this.target); ForgeHooks.onLivingSetAttackTarget((Mob) (Object) this, this.target);