How to get the player looking pos?
-
I need smth like this:
var C06PlayerPacket = Java.type('net.minecraft.network.play.client.C03PacketPlayer.C06PacketPlayerPosLook');
and i wanna mark this like the normal Teleport with a meter counter. Then i want to get my tp (its a hclip setted to the distance) till now i just got an x axis teleport but i wanna tp u can choose how long and where u tp :CSmth like:
Get Meters
Set Meters to hclip distance
Clipexample:
If Meters (10)
set distance to hclip to (10)
Clip -
@CzechHek said in How to get the player looking pos?:
var MovementUtils = Java.type("net.ccbluex.liquidbounce.utils.MovementUtils"), clipDistance;
so this gets the distance of looking block and sets the distance to the clipdistance?
ive tried it with this offset
function hClip(offset) { mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ + offset, mc.thePlayer.onGround));
then ive tried to put in ur script but it seems not to work do i have to change on urs smth like rename it to hClip not clipDistance ?
this.onUpdate = function () { if(mc.thePlayer.onGround) { mc.thePlayer.motionY = 0.32 if(spoofGround.get()){ mc.thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer(true)); } } if (mc.thePlayer.onGround && mc.gameSettings.keyBindSneak.pressed == true) { MovementUtils.getSpeed() >= 10 && MovementUtils.forward(clipDistance = 10); hClip(20) } }
-
Just take a look at the teleport class of LiquidBounce, you should be able to find the code that gets the block you are looking at and how to determine the distance to it.
By the way, if you want to teleport more than 10 blocks, you have to send several packets.
https://github.com/CCBlueX/LiquidBounce/blob/master/1.8.9-Forge/src/main/java/net/ccbluex/liquidbounce/features/module/modules/exploit/Teleport.java