コード例 #1
0
  public void onLivingUpdate() {
    super.onLivingUpdate();

    if (!this.onGround && this.motY < 0.0D) {
      this.motY *= 0.6D;
    }

    if (Configuration.MyPet.Chicken.CAN_LAY_EGGS && canUseItem() && --nextEggTimer <= 0) {
      world.makeSound(
          this, "mob.chicken.plop", 1.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F);
      a(Items.EGG, 1);
      nextEggTimer = random.nextInt(6000) + 6000;
    }
  }
コード例 #2
0
 protected void initDatawatcher() {
   super.initDatawatcher();
   this.datawatcher.a(12, new Integer(0)); // age
 }