I am trying to execute a command when a player's kills
score reaches a certain value, but it doesn't work.
This image should explain it all.
How do I execute a command when the player reaches a certain amount of score?
minecraft-commandsminecraft-java-edition
Best Answer
You have two mistakes in your command.
First of all, your target selector is wrong. Target selector arguments use a
<argument>=<value>
syntax, meaning it should bescore_kills_min=1
. A colon as separator is only used for data tags (which you aren't using in this command).Secondly, the syntax for
execute
requires 4 arguments before the other command:Minecraft commands are dumb, they can not divine which arguments are not given when some are missing. In your case, the game sees the following arguments:
This is obviously rubbish and the command would fail. If you don't require
<command …>
to be run from a specific location (if you do, you know), just use~ ~ ~
for the coordinates.In summary, your command should be: