Skip to content

Instantly share code, notes, and snippets.

@tumen102
Created January 3, 2021 15:08
Show Gist options
  • Save tumen102/53a18ff9acee48a60ed74a2c7ab69c0a to your computer and use it in GitHub Desktop.
Save tumen102/53a18ff9acee48a60ed74a2c7ab69c0a to your computer and use it in GitHub Desktop.
int ticks = 0;
public void onEnable() {
ticks = 0;
}
public void onDisable() {
mc.timer.timerSpeed = 1f;
}
public void onUpdate() {
mc.thePlayer.motionX = 0;
mc.thePlayer.motionZ = 0;
mc.thePlayer.posX = mc.thePlayer.posX;
mc.thePlayer.posZ = mc.thePlayer.posZ;
mc.thePlayer.capabilities.isFlying = false;
Client.addClientChat("teleporting in " + ChatFormatting.RED + Integer.toString(3-ticks+1));
this.suffix = Integer.toString(3-ticks+1);
mc.timer.timerSpeed = 0.1f;
} else if(ticks <= 15) {
mc.thePlayer.performHurtAnimation();
if(mc.thePlayer.onGround) {
mc.thePlayer.jump();
}
mc.thePlayer.capabilities.isFlying = true;
mc.thePlayer.motionY += 0.07f;
if(ticks % 2 == 0) {
mc.thePlayer.setSprinting(true);
} else {
mc.thePlayer.setSprinting(false);
}
mc.timer.timerSpeed = 5f;
}
else {
Client.addClientChat("teleported.");
this.toggle();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment