Minecraft – /execute a command at players with a certain score

minecraft-commandsminecraft-java-edition

For a project I'm working on, I want to be able to execute a setblock command at a player with a certain score. I've tried doing

/execute @a[score_xp_min=100] -insert command here-

but all it says is that I've provided an improper UUID format. Is there any way to /execute commands at players with certain scores?

Best Answer

The selector format is correct, but the problem is that the syntax of /execute is:

/execute <Target> <X> <Y> <Z> <Command>

To fix your problem simply add 3 tilde (~) after the @a selector:

/execute @a[score_xp_min=100] ~ ~ ~ <Command>