Teleporting & Return

Started by Kye_the_miner on Sun, 04/05/2015 - 04:02
Last seen on 06:49, 29. Apr 2016
Joined Feb 2014
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Teleporting & Return
Sun, 04/05/2015 - 04:04 (edited)

Hello, Im not sure if this is 'advance' modding but it does require coding knowledge so I put it under advance modding.

So, I'm getting the player to teleport away after clicking on a block; to get the player back I just made 3 varibles and called them x,y & z then just before the teleport event I set those varibles to the same as i, j & k but when the player gets teleported back it teleports them back to inside the block. This is because of the way the code works... when I set I added the event it thought I meant the i, j & k coords of the block but I need to know how to access the i, j & k coords of the player and that I do not know how to do. I have coded before and know how to edit the code to a fairly large extend so If someone could just help me but telling me what code I need to write I can work it out... probably. anyway thanks for reading, Kye_the_miner (now changed to FoodLover135 but oh well)

Edited by Kye_the_miner on Sun, 04/05/2015 - 04:04
Last seen on 14:26, 10. May 2015
Joined Apr 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
You could just add x +1 which
Thu, 04/23/2015 - 06:14

You could just add x +1 which would put the player 1 block in front of the block where they were, this of course does not take into account any building someone may do there in the mean time.

Best solution would be to get the coords (whichh you have in the Entity entity.posX etc) then check for the closest air block to the teleport block to teleport the player to.

Last seen on 21:38, 10. Jun 2015
Joined Nov 2014
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
i think y+1 is better cause
Tue, 06/09/2015 - 22:17

i think y+1 is better cause then they would teleport on top of it.