Java Code Examples for net.minecraft.entity.monster.EntityPigZombie#isArmsRaised()

The following examples show how to use net.minecraft.entity.monster.EntityPigZombie#isArmsRaised() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PigmenAngerCooldownService.java    From ForgeHax with MIT License 5 votes vote down vote up
@SubscribeEvent
public void onUpdate(LivingEvent.LivingUpdateEvent event) {
  if (event.getEntityLiving() instanceof EntityPigZombie) {
    // update pigmens anger level
    EntityPigZombie pigZombie = (EntityPigZombie) event.getEntityLiving();
    if (pigZombie.isArmsRaised()) {
      FastReflection.Fields.EntityPigZombie_angerLevel.set(pigZombie, 400);
    } else if (pigZombie.isAngry()) {
      FastReflection.Fields.EntityPigZombie_angerLevel.set(
          pigZombie, FastReflection.Fields.EntityPigZombie_angerLevel.get(pigZombie) - 1);
    }
  }
}
 
Example 2
Source File: PigZombieMob.java    From ForgeHax with MIT License 4 votes vote down vote up
@Override
protected MobTypeEnum getMobTypeUnchecked(Entity entity) {
  EntityPigZombie zombie = (EntityPigZombie) entity;
  return (zombie.isArmsRaised() || zombie.isAngry()) ? MobTypeEnum.HOSTILE : MobTypeEnum.NEUTRAL;
}