Forum

Please or Register to create posts and topics.

If you can /tp do it wisely

I know from experience that just hitting /tp to somebody can be a dangerous thing.

But somehow I managed to /tp to somebody who had just entered a /home command.

This resulted in me being thrown into the void and losing everything I had.

Is there any possible way of avoiding that collision? Besides /tpa? Say you and a friend are working on something and you happened to /tp to them as they /home when you knew perfectly well that they would be in a safe area - then you lose everything.

Could there be some sort of 'if player1 text:/home x then player2 !text:/tp'? (very limited at code writing)
To block any sort of collision?

Well, first of all this should not happen of course. When you teleport within the same world, this should not be an issue. When someone teleports between two worlds however, as far as I know, you do two steps: One from where you are to the spawn of the next world and then to the final destination in the new world. I am not sure where in that process you teleported and why you would be stuck in a void. Also that does not happen a lot, to my knowledge at least.

I could create a function somewhat like you describe but it's tricky and not 100% foolproof. Every teleport action on the server would need to trigger a timer and register it in the database, which would then be checked by a user teleporting to him. Since there is always some time that will pass between teleporting, starting a timer and registering it in the database, someone else could do a /tp to you before that process is finished and still get killed. Specially since we are talking here about a check that would have to be successful within the first half second or so. The whole PHP/minecraft interface is not that responsive I am afraid.

I would need to ask floored if something could be fixed with another java plugin. I do not think that PHP is the right method to work on this.

Good point! This /tp was issued between worlds, not within the same one.