Minecraft – Making an invisible pressure plate

minecraft-commandsminecraft-java-edition

I'm trying to build a teleporter. I want the player to be teleported from the first sign(left) to the right sign(right). So, when the player steps on the red wool on the left, he will automatically be teleported to the red wool on the right. I do not want to use any pressure plats.It might work with the testfor comment, but I didn't figure out, put that only works with a radius. BTW I'm in 1.10.2 bou I could probably change the version if necessary.
enter image description here

enter image description here
The testfor command block should activate the teleport command block,when the player is detected.
Now, I'm not really the expert, so I know non of the commands that you would need to build this construction. Please help, I would highly appreciate it!
If you need any more details, ask me!

Best Answer

[1.10.2]

With the use of target selectors and a single command block, this is possible. I am going to explain the method to do this for future use.

So there are two teleportation commands:

/tp

and

/teleport

tp is the one that we will be using as it calculates relative coordinates to the entity that the command was executed upon, whereas /teleport executes it upon the relative coordinates of the entity that is performing the command (i.e the player).

So now we have the following command. Aint that great :D

/tp

Now the normal context for this command comes like this:

/tp <player name> <player name>

or

/tp <player name> <X> <Y> <Z>

X Y Z are coordinates.

Instead of the above method's we will instead use target selectors, which come in three different types:

@a

executes all of the players.

@r

executes a random player.

@e

executes all entities (everything mob type)

@p

executes the nearest player (to where the command is being executed)

In this instance we will be using @a (all players). So now we have this command: :D

/tp @a

Ok dont type that in chat yet. Now we must add the target selector:

/tp @a[]

Now these square brackets are where the selectors will go.

/tp @a[x=X,y=Y,z=Z]

Ok so you add the coordinates that you want your pressure plate to go in the X Y Z zones (THE CAPITALS GODDAMNIT). Now we must add one final selector:

/tp @a[x=X,y=Y,z=Z,r=1]

The r selector stands for "radius". So this won't exactly execute in the radius of one block it feels a lot more a sphere the size pf one block. Now we add the coordinates that we want the player to go to:

/tp @a[x=X,y=Y,z=Z,r=1] X Y Z 

Change the second X Y Z to the coordinates the player needs to go to. To get coordinates press F3 for the debug menu it can be found there.

Finally, paste the command into a repeating command block thats always active. I can see you already know how to get them, but for you NOOBS out there I'll help yall out. /give @p command_block

I made an example of the machine:

here

Now the inside of the command block should look like this:

HERE

The coordinates in the picture are just an example.

Now for you lazy peeps... /tp @a[x=1,y=1,z=1,r=1] X Y Z