Advertisement
Guest User

Untitled

a guest
Oct 5th, 2016
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.87 KB | None | 0 0
  1.     @Override
  2.     public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
  3.         if (!worldIn.isRemote) {
  4.             if (heldItem.getItem() != null && heldItem.getItem() instanceof ItemArgent) {
  5.                 worldIn.setBlockToAir(pos);
  6.                 worldIn.createExplosion(playerIn, pos.getX(), pos.getY(), pos.getZ(), 0, true);
  7.                 BuddyBob bud = new BuddyBob(worldIn);
  8.                 bud.setPosition(pos.getX() + hitX, pos.getY() + hitY, pos.getZ() + hitZ);
  9.                 bud.setOwnerId(playerIn.getPersistentID());
  10.                 worldIn.spawnEntityInWorld(bud);
  11.             }
  12.         }
  13.         return super.onBlockActivated(worldIn, pos, state, playerIn, hand, heldItem, side, hitX, hitY, hitZ);
  14.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement