tterrag1098

Untitled

Mar 26th, 2014
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.89 KB | None | 0 0
  1.     private boolean foundBlock = false;
  2.     private boolean rand1 = false, rand2 = false;
  3.     @SubscribeEvent
  4.     public void onClientTick(PlayerTickEvent event){
  5.         MovingObjectPosition pos = Minecraft.getMinecraft().objectMouseOver;
  6.         if (pos != null && pos.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
  7.         {
  8.             if (event.player != null && event.player.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ) == SuperMassiveTech.blockRegistry.blackHoleStorage)
  9.             {
  10.                 EntityPlayer player = event.player;
  11.                 System.out.println(player.toString());
  12.                 rand1 = foundBlock ? rand1 : new Random().nextBoolean();
  13.                 rand2 = foundBlock ? rand2 : new Random().nextBoolean();
  14.                 player.setLocationAndAngles(player.posX, player.posY - 1.6, player.posZ, player.rotationYaw + (rand1 ? 10 : -10), player.rotationPitch + (rand2 ? 10 : -10));
  15.                 foundBlock = true;
  16.             }
  17.             else foundBlock = false;
  18.         }
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment