drackiseries

EXP Orbs From a Block

Jun 24th, 2012
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1. BLOCK EXPERIUM CODE:
  2.  
  3.  
  4. package net.minecraft.src;
  5.  
  6. import java.util.Random;
  7.  
  8. public class BlockExperium extends Block
  9. {
  10.     public BlockExperium(int par1, int par2)
  11.     {
  12.         super(par1, par2, Material.cloth);
  13.     }
  14.    
  15.     public void onBlockDestroyedByPlayer(World world, int i, int j, int k, int l, Random random)
  16.     {
  17.        
  18.         EntityXPOrb entityxporb = new EntityXPOrb(world);
  19.        
  20.         int a = random.nextInt(2);
  21.        
  22.         if (a == 1)
  23.         {
  24.             world.spawnEntityInWorld(entityxporb);
  25.         }
  26.        
  27.         if (a == 2)
  28.         {
  29.             world.spawnEntityInWorld(entityxporb);
  30.             world.spawnEntityInWorld(entityxporb);
  31.         }
  32.        
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment