Advertisement
Guest User

Code

a guest
Apr 10th, 2015
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.50 KB | None | 0 0
  1. public void OnUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
  2.          EntityPlayer player = (EntityPlayer) par3Entity;
  3.          Random random = null;
  4.  
  5.  
  6.         int range = 10;
  7.         for(int i = -range; i < range + 1; i++) {
  8.             for(int j = -range; j < range + 1; j++) {
  9.             for(int k = -range; k < range + 1; k++) {
  10. if(par2World.getBlock(player.chunkCoordX, player.chunkCoordY, player.chunkCoordZ)==Block.getBlockById(11)||par2World.getBlock(player.chunkCoordX, player.chunkCoordY, player.chunkCoordZ)==Block.getBlockById(10)||par2World.getBlock(player.chunkCoordX+i, player.chunkCoordY, player.chunkCoordZ)==Block.getBlockById(10)||par2World.getBlock(player.chunkCoordX+i, player.chunkCoordY, player.chunkCoordZ)==Block.getBlockById(11)||par2World.getBlock(player.chunkCoordX, player.chunkCoordY+j, player.chunkCoordZ)==Block.getBlockById(10)||par2World.getBlock(player.chunkCoordX, player.chunkCoordY+j, player.chunkCoordZ)==Block.getBlockById(11)||par2World.getBlock(player.chunkCoordX, player.chunkCoordY, player.chunkCoordZ+k)==Block.getBlockById(10)||par2World.getBlock(player.chunkCoordX, player.chunkCoordY, player.chunkCoordZ+k)==Block.getBlockById(11)){
  11.                         if(random.nextInt(2000)+1==1){
  12.                         player.inventory.armorInventory[0].damageItem(1, player);
  13.                         player.inventory.armorInventory[1].damageItem(1, player);
  14.                         player.inventory.armorInventory[2].damageItem(1, player);
  15.                         player.inventory.armorInventory[3].damageItem(1, player);
  16.                         }
  17.                     }
  18.             }
  19. }
  20.         }
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement