1

I'm making a find the button map where you press a button once found and proceed to the next level. There's one level with animals in it and they keep activating the text command so it constantly comes up and it's very annoying. Is it possible for players only to activate the command? (btw its a pressure plate, just in case it matters)

  • Could you paste the command you're using for your text command? – SirBenet Oct 12 '16 at 16:26
  • Rather than using a pressure plate, could you instead use a lever or a button for the player to find? Seems like it would be a bit more intuitive, and mobs can't use either of them. – Gigazelle Oct 21 '16 at 1:41
1

Use a weighed pressure plate (gold or iron). Those take more entities to power it. More info on weighed pressure plates here.

Another idea is the /testfor command.
Here is an example: /testfor @p[r=1]
Make sure (if you are using 1.9+) that the command block settings are set to, Always active and Repeat. If you are using 1.8.9 or earlier then power the command block with a clock circuit.
In this example the command block will test for players in a one block radius. To make the command block power something else when it does find someone, you just have to connect the circuit to the command block with a comparator. For more info on the redstone comparator go to here.
EDIT: Here is step by step instructions so no one gets confused:

  1. Build a command block that either is on repeat mode (1.9 up), or connect a clock to it (1.8.9 down), with the command /testfor @p[r=1] (for a longer radius change the 1).
  2. Place a comparator next to it so that the end with two torches is facing towards the command block.
  3. Connect the other end of the comparator to another command block either directly or with redstone between.
  4. Add the command /tellraw @p ["",{"text":"What you want to say.","color":"Color here"}] to the second command block. You can also use /title or any other command you need to use.
  • 1.13 syntax: /execute if entity @p[distance=..1] – pppery Jul 19 at 1:46
0

have a dummy pressure plate, but use player coordinates instead to activate it?

you could use @a[x=<x>,y=<y>,z=<z>] to select the player

read http://minecraft.gamepedia.com/Commands#Target_selector_arguments for more information on how to use it

note: dx dy dz are relitive to x y z so if you want a box 10 by 10 by 10, dx dy dz would all equal 10

EDIT: more info

if your using a /say command to give the message, replace it with a /tell @a[x=<x>,y=<y>,z=<z>] <message> or just update the selector in a /tellraw

  • Be aware that you need to reduce the selection area, otherwise only the origin is changed and the command becomes pointless (as all players are going to be targeted regardless of their distance to the origin). – Skylinerw Oct 12 '16 at 17:33
  • true, a r=<distance> would be needed, that also explains some problems I was having before – Venya Oct 12 '16 at 23:40
0

Have a gold weighted pressure plate with a XOR gate underneath it so that the command is only executed when 1 entity is on it. Keeping animals away by allowing only 1-blocks spaces will reduce the spam, but chickens (untested: maybe pigs too?) will still be able to get through. This could be solved with a door.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.