@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; } }
public void attacks( ItemStack itemstack, World world, EntityLiving entityliving, EntityLiving entityliving1, int i) { switch (i) { case 1: InfiToolPowers.splinterAttack(entityliving, mod_InfiTools.woodSplinters, world); break; case 2: InfiToolPowers.splinterAttack(entityliving, mod_InfiTools.stoneShard, world); break; case 7: InfiToolPowers.splinterAttack(entityliving, mod_InfiTools.obsidianShard, world); break; case 8: InfiToolPowers.splinterAttack(entityliving, mod_InfiTools.sandstoneShard, world); break; case 12: InfiToolPowers.splinterAttack(entityliving, mod_InfiTools.netherrackShard, world); break; case 13: InfiToolPowers.splinterAttack(entityliving, Item.lightStoneDust, world); break; case 14: entityliving1.freeze(); break; case 15: entityliving1.setFire(100); break; case 20: entityliving1.setFire(100); break; } }