コード例 #1
0
  @Override
  /** Called when the mob's health reaches 0. */
  public void onDeath(DamageSource cause) {
    super.onDeath(cause);

    if (cause.getSourceOfDamage() instanceof EntityArrow
        && cause.getEntity() instanceof EntityPlayer) {
      EntityPlayer entityplayer = (EntityPlayer) cause.getEntity();
      double d0 = entityplayer.posX - this.posX;
      double d1 = entityplayer.posZ - this.posZ;

      if (d0 * d0 + d1 * d1 >= 2500.0D) {
        entityplayer.triggerAchievement(AchievementList.snipeSkeleton);
      }
    } else if (cause.getEntity() instanceof EntityCreeper
        && ((EntityCreeper) cause.getEntity()).getPowered()
        && ((EntityCreeper) cause.getEntity()).isAIEnabled()) {
      ((EntityCreeper) cause.getEntity()).func_175493_co();
      this.entityDropItem(
          new ItemStack(ChaosBlock.itemChaoticWitherSkull, 1, !this.isEthereal ? 0 : 1), 0.0F);
    }
  }
コード例 #2
0
 @Override
 protected void entityInit() {
   super.entityInit();
   this.experienceValue = 15;
 }
コード例 #3
0
 public EntityChaoticWitherSkeleton(World worldIn) {
   super(worldIn);
   super.setIsEthereal(false);
 }