コード例 #1
0
  @Override
  public void onLivingUpdate() {
    //        if (this.isRiding() && this.getAttackTarget() != null && this.ridingEntity instanceof
    // EntityUndeadHorse) {
    //            ((EntityLiving)
    // this.ridingEntity).getNavigator().setPath(this.getNavigator().getPath(), 1.5D);
    //        }

    super.onLivingUpdate();
  }
コード例 #2
0
  /**
   * Called frequently so the entity can update its state every tick as required. For example,
   * zombies and skeletons use this to react to sunlight and start to burn.
   */
  @Override
  public void onLivingUpdate() {
    if (this.worldObj.isDaytime() && !this.worldObj.isRemote) {
      final float var1 = this.getBrightness(1.0F);

      if (var1 > 0.5F
          && this.worldObj.canBlockSeeTheSky(
              MathHelper.floor_double(this.posX),
              MathHelper.floor_double(this.posY),
              MathHelper.floor_double(this.posZ))
          && this.rand.nextFloat() * 30.0F < (var1 - 0.4F) * 2.0F) {
        this.setFire(8);
      }
    }

    super.onLivingUpdate();
  }