mysticdrew

Untitled

Sep 29th, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1.     public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase mobBase, EntityLivingBase playerBase)
  2.     {
  3.             if(Math.random() < 0.05d ) {
  4.                 if(!mobBase.worldObj.isRemote){
  5.                     par1ItemStack.damageItem(this.getMaxDamage() + 1, playerBase);
  6.                     mobBase.setDead();
  7.                     ItemStack stack = new ItemStack(ModItems.interestingStone, 1);
  8.                     EntityItem eItem = new EntityItem(playerBase.worldObj, playerBase.posX, playerBase.posY + 1, playerBase.posZ, stack);
  9.                     playerBase.worldObj.spawnEntityInWorld(eItem);
  10.                 }
  11.             }
  12.         return true;
  13.     }1)
Advertisement
Add Comment
Please, Sign In to add comment