コード例 #1
0
  @SubscribeEvent
  public void livingUpdate(LivingUpdateEvent event) {
    ModEnchantments.onLivingUpdate(event.entityLiving);

    if (EtFuturum.enableVillagerZombies)
      if (!event.entityLiving.worldObj.isRemote
          && event.entityLiving.getClass() == EntityZombie.class) {
        EntityZombie zombie = (EntityZombie) event.entityLiving;
        if (zombie.isVillager()) {
          EntityZombieVillager villagerZombie = new EntityZombieVillager(zombie.worldObj);
          villagerZombie.copyLocationAndAnglesFrom(zombie);
          villagerZombie.onSpawnWithEgg(null);
          villagerZombie.worldObj.spawnEntityInWorld(villagerZombie);

          zombie.setDead();
        }
      }
  }
コード例 #2
0
 @SubscribeEvent
 public void onPlayerPickXP(PlayerPickupXpEvent event) {
   ModEnchantments.onPlayerPickupXP(event);
 }