This question already has an answer here:

I'm trying to work on redstone works with a new adventure map, how can I make command blocks detect player levels? That's my main question, the rest I know how to work out but here's the purpose anyway, I'm trying to make a command block detect player levels and at a certain amount of levels an action will happen (yet to be decided) but I know how to do that, just use a comparator to link up to the next command block and continue out the line of commands needed.

marked as duplicate by BlaXpirit, Private Pansy, Ben, MrLemon, kalina Nov 26 '14 at 11:53

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.


This may help you.

Basically, you just need two tags : l= and lm=

l=is the maximum level, while lm=is the minimum level.

So if you want to detect people with 5 levels, do:

/testfor @a[l=5,lm=5]

Source: This question by (answer)aytimothy and FireStrike289

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