Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private boolean foundBlock = false;
- private boolean rand1 = false, rand2 = false;
- @SubscribeEvent
- public void onClientTick(PlayerTickEvent event){
- MovingObjectPosition pos = Minecraft.getMinecraft().objectMouseOver;
- if (pos != null && pos.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
- {
- if (event.player != null && event.player.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ) == SuperMassiveTech.blockRegistry.blackHoleStorage)
- {
- EntityPlayer player = event.player;
- System.out.println(player.toString());
- rand1 = foundBlock ? rand1 : new Random().nextBoolean();
- rand2 = foundBlock ? rand2 : new Random().nextBoolean();
- player.setLocationAndAngles(player.posX, player.posY - 1.6, player.posZ, player.rotationYaw + (rand1 ? 10 : -10), player.rotationPitch + (rand2 ? 10 : -10));
- foundBlock = true;
- }
- else foundBlock = false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment