Advertisement
TNT_Block

Teleport

May 12th, 2019
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. package de.tnt_block_unkown.tntmod.commands.list;
  2.  
  3. import de.tnt_block_unkown.tntmod.commands.Command;
  4. import de.tnt_block_unkown.tntmod.main.TNTMod;
  5. import net.minecraft.network.play.client.C03PacketPlayer;
  6.  
  7. public class Teleport extends Command {
  8. public Teleport() {
  9. super("teleport", "#teleport <x> <y> <z>, teleportiert dich zu einer bestimmten Position!");
  10. }
  11.  
  12. @Override
  13. public void onCommand(String[] args) {
  14. try {
  15. Double x = Double.parseDouble(args[0]);
  16. Double y = Double.parseDouble(args[1]);
  17. Double z = Double.parseDouble(args[2]);
  18. for (int i = 0; i < 4; i++) {
  19. mc.thePlayer.setPosition(x, y, z);
  20. mc.thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(x, y, z, false));
  21. mc.thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(x, y, z, true));
  22. }
  23. } catch (Exception e) {
  24. TNTMod.addMessage("#teleport <x> <y> <z>");
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement