Esempio n. 1
0
 @Override
 public boolean onSkillTrigger(EntityPlayer player) {
   if (!canPlayerUseSkill(player)) return false;
   player.inventory.consumeInventoryItem(Items.bone);
   player.worldObj.playSoundAtEntity(player, "mob.ghast.fireball", 1.0F, 1.0F);
   EntityWolf wolf = new EntityWolf(player.worldObj);
   wolf.setLocationAndAngles(
       player.posX, player.posY, player.posZ, player.rotationYaw, player.rotationPitch);
   wolf.spawnExplosionParticle();
   if (!player.worldObj.isRemote) {
     wolf.setTamed(true);
     wolf.getNavigator().clearPathEntity();
     wolf.setAttackTarget(null);
     wolf.setSitting(false);
     wolf.setHealth(20);
     wolf.setOwnerId(player.getUniqueID().toString());
     player.worldObj.setEntityState(wolf, (byte) 7);
     player.worldObj.spawnEntityInWorld(wolf);
   }
   return true;
 }