生物在封闭载具上不会获得任何状态效果

This commit is contained in:
17146 2025-05-10 00:29:08 +08:00 committed by Light_Quanta
parent 2fe2b19c2a
commit c259e4842c
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959

View file

@ -645,4 +645,11 @@ public class LivingEventHandler {
event.setCanceled(true);
}
}
@SubscribeEvent
public static void onEffectApply(MobEffectEvent.Applicable event) {
if (event.getEntity().getVehicle() instanceof ArmedVehicleEntity vehicle && vehicle.hidePassenger(event.getEntity())) {
event.setResult(MobEffectEvent.Applicable.Result.DO_NOT_APPLY);
}
}
}