2

This question already has an answer here:

My problem is what the title specifies. I'm creating an adventure map with an xp store. I have a series of command blocks which check for the proper xp level, take away the cost of the item and give the player that item. however when I go to check my xp level with /testfor, the command block doesn't output anything. instead it tells me

[19:54:57] /testfor < player>

The command I put in was /testfor @p [lm=5]

I tried moving [lm=5] so it was right beside the @p, but Minecraft told me it can't find the player. I also tried putting my playername in, but I got the same output from before. Is there something I'm missing here?

marked as duplicate by Wolf, Young Guilo, angussidney, Riley, Merus Oct 3 '16 at 8:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

Target selector parameters must be placed directly next to the selector, with no space between them. "lm" stands for "level minimum", and it if's telling you it can't find the player, that means no player with 5 XP levels or more was found.

The correct command is:

/testfor @p[lm=5]

Also note that selector parameters can only be used with a selector. Using playername[lm=5] is invalid syntax. To check for a specific player along with parameters, you must use the name parameter:

/testfor @p[name=playername,lm=5]

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