Exemplo n.º 1
0
  @Override
  public boolean onEntityInteract(EntityPlayer player, Entity entity, boolean isAttack) {

    if (entity instanceof EntityLiving) {
      ItemStack stack = player.getCurrentEquippedItem();
      if (stack != null
          && !player.worldObj.isRemote
          && InfiToolPowers.freezingEnchant(stack, (EntityLiving) entity)) {
        // entity.worldObj.playSoundAtEntity(entity, "random.glass", 1.0F, this.rand.nextFloat() -
        // this.rand.nextFloat() * 0.2F + 1.0F);
        entity.attackEntityFrom(
            DamageSource.causePlayerDamage(player), stack.getDamageVsEntity(entity));
        ((EntityLiving) entity).freeze(500);
        return false;
      } else {
        return true;
      }
    } else {
      return true;
    }
  }
Exemplo n.º 2
0
 public static int GetDamageVS(ItemStack itemStack, EntityLiving living) {
   return GetDamageVS(itemStack.getDamageVsEntity(living), living);
 }