The final bit that you need is to just teleport the non-mod player, like so: tp @p ~ ~ ~
(of course, you're probably going to execute
that command at the horse). This works because the teleport moves the target, and everything that is riding it, but not the things that the target is riding.
But that's just the bit you were missing, my full solution is below.
First things first, you're going to have to give your mod horses custom names. They can be unique, but it makes it easier if they're all the same. For my example, I'll just use "Mod Horse".
Next, you'll need two scoreboard objectives, isRiding
and isMod
. I have to admit that I don't really like having to use the isMod
objective, but for my solution to work, it's unavoidable.
The final step is to have 4 command blocks triggered by a 20Hz fill clock. In order, those commands are:
scoreboard players add @a isMod 0
scoreboard players set @a isRiding 0
scoreboard players set @a isRiding 1 {Riding:{CustomName:"Mod Horse"}}
tp @a[score_isRiding_min=1,score_isMod=0] ~ ~ ~
The first command ensures that everyone always has a score in the isMod
objective, the second and third commands reset the isRiding
score, then set the score for anyone riding an entity named "Mod Horse" (this can be abused, by the way), and the fourth command teleports anyone riding a mod horse who isn't a mod to the same spot they were in, effectively knocking them off the horse.
Of course, you're also going to have to set the isMod
score for all your mods, but that's easy with /scoreboard players set <mod name> isMod 1
.
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:
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.