1

Command help

Mithril1Blade 10/7/15 6:45 pm
389
10/8/2015 2:12 am
I'm creating a minigame, and I want to have a command block hooked up to a clock that teleports a villager 10 blocks below me so I can control him. I tried using /execute, but I can't figure out how to do what I want. Any help please?
Posted by
Mithril1Blade
Level 12 : Journeyman System
8

  Have something to say?

JoinSign in

9

Sardonyx
10/07/2015 8:59 pm
Level 51 : Grandmaster Pixel Painter
This should work, it is a bit round-a-bout, but I can't think of any other way to do it
Put all these commands on a /fill clock, so they activate in this order:

/execute @a ~ ~ ~ /summon ArmorStand ~ ~-10 ~ {CustomName:"placeholder",CustomNameVisible:1,Marker:1b,NoGravity:1}

/tp @e[type=Villager,name=example] @e[type=ArmorStand,name=placeholder]

/kill @e[type=ArmorStand,name=placeholder]

If you need help with getting them in the right order, you can use this one command generator: http://mrgarretto.com/cmdcombiner

I haven't actually tested it, but I am pretty sure the syntax is right, so it should work.
1
Mithril1Blade
10/07/2015 9:10 pm
Level 12 : Journeyman System
That's a good idea. I'll give it a shot. Thanks.
1
Sardonyx
10/07/2015 9:34 pm
Level 51 : Grandmaster Pixel Painter
Happy to help!
1
craftykids
10/07/2015 8:33 pm
Level 53 : Grandmaster Pixel Painter
One way you could do it is by using two commands; one to teleport the villager to you, and one to teleport it 10 blocks below itself. You'll have to position the command block correctly, though. (So that the first runs before the second, I guess?) I didn't experiment a whole lot with single commands, though, so there might be a way to do it with only one command.
1
Runninlikcraz
10/07/2015 7:48 pm
Level 64 : High Grandmaster Hero
Depends what the minigame is, if you are planning to have multiple players playing then you would have to make a different villager for each player. Set player one's score to 1, player two's to 2 etc.
then /execute @a[score_Team(or whatever scoreboard objective you have)_min=1,score_Team=1] ~ ~ ~ /tp @e[type=Villager,name=PlayerOne] ~ ~-10 ~
1
Mithril1Blade
10/07/2015 8:03 pm
Level 12 : Journeyman System
That moves the villager to a position relative to him. I need to move him to a position relative to me.

And it's only one player, but if I want to change it later, I will.
1
TheArchitect_95
10/07/2015 7:06 pm
Level 32 : Artisan Architect
The villager has to be unique, either a custom name or scoreboard objective usually works. Let's assume the villager is called Bob. The command is:
/execute @p ~ ~ ~ tp @e[type=Villager,name=Bob] ~ ~-10 ~
1
Mithril1Blade
10/07/2015 7:21 pm
Level 12 : Journeyman System
That teleports Bob to 10 blocks below Bob, which, on a clock, would shoot him into the void pretty quickly. I'm not talking about controlling him with pressure plates- I mean teleporting him below my constantly, so if I move to the right, he moves to the right ten blocks below me.
1
TheArchitect_95
10/08/2015 2:12 am
Level 32 : Artisan Architect
Ah yes, my apologies.
1

Welcome