Quantcast
Channel: User Skylinerw - Arqade
Viewing all articles
Browse latest Browse all 51

Answer by Skylinerw for Testing for specific player a with command block

$
0
0

There is no n parameter. The correct parameter you're looking for is name. The wiki has a list of all valid parameters here.

testfor @p[1303,56,518,2,name=JAMES_the_camel]

For 1.11-1.12, which removes shorthand coordinates:

testfor @p[x=1303,y=56,z=518,r=2,name=JAMES_the_camel]

And for 1.13+, which overhauled the command system (where /testfor has essentially been merged into /execute):

execute if entity @p[x=1303,y=56,z=518,distance=..2,name=JAMES_the_camel]

As well, because your chain is unconditional, it's going to activate no matter what and open the door. If you set it to conditional, it will only run its command if the command block physically behind it was successful. You will want to set your chain block to conditional or otherwise activate another set of command blocks based on the success of /testfor.


Viewing all articles
Browse latest Browse all 51

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>