1
Command Block Help Please!
Hello everyone,
I am trying to use command blocks but I'm not good with the new 1.9 ones yet so I would appreciate some help. What I'm trying to do is set it up that when a pressure plate is stepped on the command block under it will test for a player (doesn't matter if it's within a certain range or at specific coords) and if it the designated player then it will teleport that player to specific coords. Even better would be if it could test for 2 players and if its one of them then to tp them, but this may be really hard/impossible so I'm willing to set up 2 things, one for each player. If you have any questions feel free to ask. Thanks!
I am trying to use command blocks but I'm not good with the new 1.9 ones yet so I would appreciate some help. What I'm trying to do is set it up that when a pressure plate is stepped on the command block under it will test for a player (doesn't matter if it's within a certain range or at specific coords) and if it the designated player then it will teleport that player to specific coords. Even better would be if it could test for 2 players and if its one of them then to tp them, but this may be really hard/impossible so I'm willing to set up 2 things, one for each player. If you have any questions feel free to ask. Thanks!
15
Tedk1WaterOwl13Tedk1You have an extra bracket ] in your second command. This will make it an incorrect player format and cause the problem you're having. Other than that I cannot see other mistakes.
Edit: The command feedback you stated with the quotes is not vanila. You are most likely using a plugin alias that doesn't recognize target selectors. Try using the vanila alias /minecraft:tp in place of /tp
Alright here's every variation I tried.
1. The one I already posted/tp @a[name=WaterOwl,dy=0,x=967,y=120,z=697]
/tp @a[name=arrowfire,dy=0,x=967,y=120,z=697]] 965 120 692
2. Removing the extra bracket./tp @a[name=WaterOwl,dy=0,x=967,y=120,z=697]
/tp @a[name=arrowfire,dy=0,x=967,y=120,z=697]965 120 692
3. Using /minecraft:tp/minecraft:tp @a[name=WaterOwl,dy=0,x=967,y=120,z=697]
/tp @a[name=arrowfire,dy=0,x=967,y=120,z=697]] 965 120 692
4. Changing both/minecraft:tp @a[name=WaterOwl,dy=0,x=967,y=120,z=697]
/tp @a[name=arrowfire,dy=0,x=967,y=120,z=697] 965 120 692
All variations gave the exact same message of[@: You must specify the player you wish to preform this action on.]Which is the same as before/the first one.
Each one of your 8 commands has something wrong with it.
Commands 1, 3, 5, and 7 don't do anything, it teleports the player to nowhere, there is no destination or player. Essentially you're typing /tp [Player]
Command 2 has the extra bracket, as I said before.
Command 4, where you erased the second bracket, is missing a space between the end bracket and the first coordinate.
Command 6 you brought back the extra bracket again.
Command 8 seems to be the only command that should work. I'm not familiar with the distanceY tag used, and replaced it with a radius instead which I find easier. Try using these two commands:/minecraft:tp @a[name=arrowfire,x=967,y=120,z=697,r=1] 965 120 692
/minecraft:tp @a[name=WaterOwl,x=967,y=120,z=697,r=1] 965 120 692
Those two work! Thank you! I also figured out why my previous one didn't work.
I did one command block with
/tp @a[name=WaterOwl,dy=0,x=967,y=120,z=697]
/tp @a[name=arrowfire,dy=0,x=967,y=120,z=697]] 965 120 692instead of two command blocks. one with
/tp @a[name=WaterOwl,dy=0,x=967,y=120,z=697]and the other with
/tp @a[name=arrowfire,dy=0,x=967,y=120,z=697] 965 120 692 That's also why I had the second bracket in there.LexxerWaterOwl13
Sorry for the late reply, I didn't have time to test this until now. This is what it's saying "You must specify which player you wish to perform this action on.]"
This is what I put, substitutions and all. I did take the numbers off my friend's name in this post but the correct numbers are there in my command block/tp @a[name=WaterOwl,dy=0,x=967,y=120,z=697]
/tp @a[name=arrowfire,dy=0,x=967,y=120,z=697]] 965 120 692
Since this command should work perfectly fine, i assume you messed up with the coordinates, so again/tp @a[name=WaterOwl,x=X,y=Y,z=Z,dy=0] X1 Y1 Z1
(X/Y/Z) are again, the coordinates where your pressure plate is,
(X1/Y1/Z1) are the coordinates you wish to get teleported to.WaterOwl13/tp @a[name=WaterOwl,dy=0,x=967,y=120,z=697]
This can't work since it misses the destination, it should be:/tp @a[name=WaterOwl,dy=0,x=967,y=120,z=697] X Y Z
Alright I figured it out. I tried doing both my friend and I in one command block
I did one command block with
/tp @a[name=WaterOwl,dy=0,x=967,y=120,z=697]
/tp @a[name=arrowfire,dy=0,x=967,y=120,z=697]] 965 120 692Instead of two command blocks where one said
/tp @a[name=WaterOwl,dy=0,x=967,y=120,z=697] and the other said /tp @a[name=arrowfire,dy=0,x=967,y=120,z=697] 965 120 692WaterOwl13Tedk1You have an extra bracket ] in your second command. This will make it an incorrect player format and cause the problem you're having. Other than that I cannot see other mistakes.
Edit: The command feedback you stated with the quotes is not vanila. You are most likely using a plugin alias that doesn't recognize target selectors. Try using the vanila alias /minecraft:tp in place of /tp
Alright here's every variation I tried.
1. The one I already posted/tp @a[name=WaterOwl,dy=0,x=967,y=120,z=697]
/tp @a[name=arrowfire,dy=0,x=967,y=120,z=697]] 965 120 692
2. Removing the extra bracket./tp @a[name=WaterOwl,dy=0,x=967,y=120,z=697]
/tp @a[name=arrowfire,dy=0,x=967,y=120,z=697]965 120 692
3. Using /minecraft:tp/minecraft:tp @a[name=WaterOwl,dy=0,x=967,y=120,z=697]
/tp @a[name=arrowfire,dy=0,x=967,y=120,z=697]] 965 120 692
4. Changing both/minecraft:tp @a[name=WaterOwl,dy=0,x=967,y=120,z=697]
/tp @a[name=arrowfire,dy=0,x=967,y=120,z=697] 965 120 692
All variations gave the exact same message of[@: You must specify the player you wish to preform this action on.]Which is the same as before/the first one.
Each one of your 8 commands has something wrong with it.
Commands 1, 3, 5, and 7 don't do anything, it teleports the player to nowhere, there is no destination or player. Essentially you're typing /tp [Player]
Command 2 has the extra bracket, as I said before.
Command 4, where you erased the second bracket, is missing a space between the end bracket and the first coordinate.
Command 6 you brought back the extra bracket again.
Command 8 seems to be the only command that should work. I'm not familiar with the distanceY tag used, and replaced it with a radius instead which I find easier. Try using these two commands:
/minecraft:tp @a[name=arrowfire,x=967,y=120,z=697,r=1] 965 120 692
/minecraft:tp @a[name=WaterOwl,x=967,y=120,z=697,r=1] 965 120 692WaterOwl13
Sorry for the late reply, I didn't have time to test this until now. This is what it's saying "You must specify which player you wish to perform this action on.]"
This is what I put, substitutions and all. I did take the numbers off my friend's name in this post but the correct numbers are there in my command block/tp @a[name=WaterOwl,dy=0,x=967,y=120,z=697]
/tp @a[name=arrowfire,dy=0,x=967,y=120,z=697]] 965 120 692
Since this command should work perfectly fine, i assume you messed up with the coordinates, so again
/tp @a[name=WaterOwl,x=X,y=Y,z=Z,dy=0] X1 Y1 Z1(X/Y/Z) are again, the coordinates where your pressure plate is,
(X1/Y1/Z1) are the coordinates you wish to get teleported to.
WaterOwl13/tp @a[name=WaterOwl,dy=0,x=967,y=120,z=697]
This can't work since it misses the destination, it should be:
/tp @a[name=WaterOwl,dy=0,x=967,y=120,z=697] X Y ZMaybe
[@: You must specify the player you wish to preform this action on.] It says this when the last X Y Z coords are missing.
/tp @a[r=3,name=WaterOwl] X Y Z and /tp @a[r=3,name=arrowfire] X Y Z[@: You must specify the player you wish to preform this action on.] It says this when the last X Y Z coords are missing.
The server's only plugins as of the time I post this are: World Edit, Protocol Lib, Chat Control, World Guard, and Chop Tree3
You have an extra bracket ] in your second command. This will make it an incorrect player format and cause the problem you're having. Other than that I cannot see other mistakes.
Edit: The command feedback you stated with the quotes is not vanila. You are most likely using a plugin alias that doesn't recognize target selectors. Try using the vanila alias /minecraft:tp in place of /tp
Edit: The command feedback you stated with the quotes is not vanila. You are most likely using a plugin alias that doesn't recognize target selectors. Try using the vanila alias /minecraft:tp in place of /tp
Alright here's every variation I tried.
1. The one I already posted
2. Removing the extra bracket.
3. Using /minecraft:tp
4. Changing both
All variations gave the exact same message of
1. The one I already posted
/tp @a[name=WaterOwl,dy=0,x=967,y=120,z=697]
/tp @a[name=arrowfire,dy=0,x=967,y=120,z=697]] 965 120 6922. Removing the extra bracket.
/tp @a[name=WaterOwl,dy=0,x=967,y=120,z=697]
/tp @a[name=arrowfire,dy=0,x=967,y=120,z=697]965 120 6923. Using /minecraft:tp
/minecraft:tp @a[name=WaterOwl,dy=0,x=967,y=120,z=697]
/tp @a[name=arrowfire,dy=0,x=967,y=120,z=697]] 965 120 6924. Changing both
/minecraft:tp @a[name=WaterOwl,dy=0,x=967,y=120,z=697]
/tp @a[name=arrowfire,dy=0,x=967,y=120,z=697] 965 120 692All variations gave the exact same message of
[@: You must specify the player you wish to preform this action on.]Which is the same as before/the first one.
You can add 'dy=0' and coordiantes to the parameter:
This will only teleport you, when you or your friend are on top the pressureplate.
(x/y/z) are the coordiantes and 'dy=0' will make sure you only get teleported, when you are on those coordiantes.
/tp @a[name=WaterOwl13,dy=0,x=X,y=Y,z=Z]
/tp @a[name=friendsName,dy=0,x=X,y=Y,z=Z]] This will only teleport you, when you or your friend are on top the pressureplate.
(x/y/z) are the coordiantes and 'dy=0' will make sure you only get teleported, when you are on those coordiantes.
Sorry for the late reply, I didn't have time to test this until now. This is what it's saying "You must specify which player you wish to preform this action on.]"
This is what I put, substitutions and all. I did take the numbers off my friend's name in this post but the correct numbers are there in my command block
This is what I put, substitutions and all. I did take the numbers off my friend's name in this post but the correct numbers are there in my command block
/tp @a[name=WaterOwl,dy=0,x=967,y=120,z=697]
/tp @a[name=arrowfire,dy=0,x=967,y=120,z=697]] 965 120 692Without knowing too much of your situation I can't give you an optimal solution but perhaps something like this. Please follow along below:
Player (P) anyone basically: This is easy. Just add a pressure plate.
Player A: We'll need to specify this in some way. Either using the 'name', scoreboard or 'tag' parameters as examples. Will get into this soon.
Player B: Following the same principle as the above.
Player O: The command we issue will simply ignore all other players than those specified so no extra stuff needed there.
Okay so (P) and (O) are not neccessary to think about right now because (P) is already possible and (O) won't trigger, which is what you want.
The following would only teleport you (replace 'YOU' with your name)
/tp @p[name=YOU] xyz
Following this you can add a seperate one for your friend:
/tp @p[name=FRIEND] xyz
Alternatively you can add both of your names to a tag. Think of the tag as a folder. Which means that when you testfor a tag you testfor everything included in the tag.
/scoreboard players tag @p[name=YOU] add Selected
/scoreboard players tag @p[name=FRIEND] add Selected
If you run the two above commands you can simply select both you and your friend at the same time with the tag 'Selected'. For example:
/say @a[tag=Selected]
This will say all players' within the 'Selected' tag (folder if you will) names. If you don't use this method you'd need to use seperate command blocks per player due to the fact that you can't test multiple names in one command.
I'm very, very bad at explaining things, I think it's because I have a different kind of thought proccess so what I say might not make sense. If you still need help please let me know what you don't understand and/or the things I misunderstood.
Player (P) anyone basically: This is easy. Just add a pressure plate.
Player A: We'll need to specify this in some way. Either using the 'name', scoreboard or 'tag' parameters as examples. Will get into this soon.
Player B: Following the same principle as the above.
Player O: The command we issue will simply ignore all other players than those specified so no extra stuff needed there.
Okay so (P) and (O) are not neccessary to think about right now because (P) is already possible and (O) won't trigger, which is what you want.
The following would only teleport you (replace 'YOU' with your name)
/tp @p[name=YOU] xyz
Following this you can add a seperate one for your friend:
/tp @p[name=FRIEND] xyz
Alternatively you can add both of your names to a tag. Think of the tag as a folder. Which means that when you testfor a tag you testfor everything included in the tag.
/scoreboard players tag @p[name=YOU] add Selected
/scoreboard players tag @p[name=FRIEND] add Selected
If you run the two above commands you can simply select both you and your friend at the same time with the tag 'Selected'. For example:
/say @a[tag=Selected]
This will say all players' within the 'Selected' tag (folder if you will) names. If you don't use this method you'd need to use seperate command blocks per player due to the fact that you can't test multiple names in one command.
I'm very, very bad at explaining things, I think it's because I have a different kind of thought proccess so what I say might not make sense. If you still need help please let me know what you don't understand and/or the things I misunderstood.
This make sense there's just one piece missing. If someone else stands on the pressure plate it won't teleport my friend or I. What I'm trying to do is make a hidden room in our base that only we can get in to when we want to. How I understand what you said is that if ANYONE steps on the plate my friend and/or I will be teleported. I need it to be so if my friend steps on the pressure plate they'll be teleported, if I step on it I'll be teleported, and if anyone else does no one will be teleported.
I didn't explain it very well, let me try again.
If a player (P) steps on the pressure plate then the command block will test to see if it's player A (me), player B (my friend) or player O (any other player). If it's player A or B it will teleport that player to the specified coordinates, if it's any player O it does nothing.
Does that make more sense?
If the picture got cut off here the link https://66.media.tumblr.com/406bccc3486dc3f6770752e5fd0929ae/tumblr_o80ixw0NR51s9x0zko1_1280.jpg

If a player (P) steps on the pressure plate then the command block will test to see if it's player A (me), player B (my friend) or player O (any other player). If it's player A or B it will teleport that player to the specified coordinates, if it's any player O it does nothing.
Does that make more sense?
If the picture got cut off here the link https://66.media.tumblr.com/406bccc3486dc3f6770752e5fd0929ae/tumblr_o80ixw0NR51s9x0zko1_1280.jpg

WaterOwl13Even better would be if it could test for 2 players and if its one of them then to tp them, but this may be really hard/impossible so I'm willing to set up 2 things, one for each player
So you mean to pick up one random player from those 2 players?
In that case: First, test for 2players
/scoreboard players tag @a[c=2] add SelectedNow teleport one random player:
/tp @r[c=1,tag=Selected] X Y ZFinally, remove the tag for all players:
/scoreboard players tag @a remove SelectedFirst testfor players in a radius of lets say, 5 blocks... So
/testfor @a[r=5] ~ ~ ~
then have a comparator be activated from the testfor command block triggering another command block that contains the teleport command. You make the teleport command teleport a random player to the desired location. so like this:
/tp @r[r=5] (your coords here)
off of the teleport command block have a repeater going off of it to another command block that contains another teleport command. to teleport the other player to the other desired location.
/tp @r[r=5] (your coords here)
So this would be your setup:
/testfor @a[r=5] ~ ~ ~ -> (comparator) -> /tp @r[r=5] (desired coords) -> (repeater) -> /tp @r[r=5] (desired coords)
If you only wanted to teleport one of the players then take away the second teleport command.
/testfor @a[r=5] ~ ~ ~
then have a comparator be activated from the testfor command block triggering another command block that contains the teleport command. You make the teleport command teleport a random player to the desired location. so like this:
/tp @r[r=5] (your coords here)
off of the teleport command block have a repeater going off of it to another command block that contains another teleport command. to teleport the other player to the other desired location.
/tp @r[r=5] (your coords here)
So this would be your setup:
/testfor @a[r=5] ~ ~ ~ -> (comparator) -> /tp @r[r=5] (desired coords) -> (repeater) -> /tp @r[r=5] (desired coords)
If you only wanted to teleport one of the players then take away the second teleport command.
