Minecraft – Teleport player on horse on minecraft vanilla

minecraft-java-edition

I've created a big circuit in my vanilla server to teleport all players to an arena each 3 days.

It's all working like a charm, but a few days ago a player wasn't teleported. Chatting with him, he told me that he was on a horse.

Players on horses are not teleported?

Best Answer

Doing some quick testing, I've found that you can teleport players that are riding something (horse, minecart, boat, or pig), although that may be due to the fact I'm using the latest snapshot. However, whatever those players are riding will not be teleported. That means that the poor owner of the horse will be back in town while his horse is left to wander the wilderness alone. A horse owner might not be too pleased at that. The solution is to first teleport players riding horses into a secure corral in town with the following command:

/execute @a ~ ~ ~ tp @e[type=EntityHorse,r=1] <x> <y> <z>

and then to teleport everyone to the meeting place with a standard teleport command.

For some clarification, this is what the above command does: at the location of every player, execute a teleport, filtering on horses that are within 1 block of a player, to the coordinates <x> <y> <z>.

As I said, this is tested on the latest snapshot (14w20b), and so may not work as expected with earlier versions.