So I recently found out that /testfor can specify coordinates and player name. This gives me the idea that I could potentially make a command fueled door that only opens when my specific character is near it.

But can it be inverted? Meaning that it tests for anyone else besides me, and if someone is detected who isn't me, it then activates whatever I have attached to it. (For example, traps.)

1 Answer 1


after watching this and reading this, I came up with the following for testing for other players.

testfor @p[r=5,name=!<your username>]
  • Are you sure it's =! and not !=? I don't know Minecraft that well but it's != in most programming languages.
    – Probst
    Feb 23, 2016 at 14:24
  • @Probst Inori is correct, it is =!. Feb 23, 2016 at 14:47
  • Well that's weird but OK lol
    – Probst
    Feb 23, 2016 at 14:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .