Video Summary
In this tutorial, I demonstrate how to use the execute command combined with scoreboards in Minecraft Java edition to test player scores and trigger specific commands based on those scores. I walk through setting up a dummy scoreboard objective, creating command blocks, and using execute commands with score matching to execute different actions like particle effects or score resets when certain score thresholds are reached. I also show how to use execute commands to modify scores based on conditions, such as increasing a score when a player stands on a specific block.
“`html
Hey everybody, it’s UnderMyCap and welcome back to another video! Today I’m going to be showing you how to execute a command using a scoreboard in Minecraft Java Edition. It’s a really cool command and I can see it being incredibly useful for a wide range of builds and projects. If you’d prefer to watch the video version, you can check it out here: Execute If Score Minecraft Command Tutorial. Let’s say you wanted to test how many times you’ve killed a mob, or how many times you’ve died, and then once you reached 10 of that, you wanted to trigger a sound effect, a particle effect, or a reset — you can do all of that with this command! I’m going to split this guide into two sections. The first section covers setting up the scoreboard, which you’ll need for this to work. If you’ve already watched my scoreboard video and have one set up, feel free to skip ahead to the second section. The second section is the main event — showing you exactly how to execute commands based on a scoreboard score. First, we need to create a scoreboard objective. Head into chat and type the following command to add a new objective called “test” as a dummy type. Dummy scoreboards are great because you can manually set and alter the data — it won’t be affected by things like deaths or other in-game events. To create the scoreboard objective, use: You’ll notice the scoreboard doesn’t show up on screen just yet. To display it on the sidebar, type: Now the scoreboard is visible on the right side of your screen. Next, let’s add a player and set their score so we have something to work with. To add yourself and set a score, use: As you can see, the score is now set to five and is displayed on the sidebar. With that done, we’re ready to move on to the fun part! For this part, you’re going to need a command block. You can get one by typing: Once you have your command block placed down, it’s time to set up the execute command. The full command we’ll be using looks like this: Let me break that down so it makes sense. The When you activate the command block, you’ll see the particle effect appear around you because the score is equal to five, which matches our condition. If you increase the score above five, it still triggers. However, if you set the score to less than five, the particles stop — which confirms the condition check is working perfectly. Now, what if you wanted to reset the score back to zero once the condition is met? You can do that with a second command block. Copy the command from the first block (you can hold Ctrl while using the pick block button to copy a command block with all of its contents), then modify the end of the command to run a scoreboard reset instead of the particle effect. Replace the particle command at the end with: The full command would look like this: Now when the score hits five, it will reset back to zero. If you have both command blocks running together, you’ll also see the particle effect fire briefly before the reset kicks in — a really satisfying combination! Here’s another great way to use this system — automatically changing a player’s score based on what block they’re standing on. In this example, we’ll make it so that standing on stone increases your score by one each time the command block triggers. The command for this is: This command checks if the block directly underneath the player (at a Y offset of negative one) is stone. If it is, it adds one to the player’s “test” score. When combined with the previous command blocks, you’ll see the score climb while standing on stone, and once it hits five, the particle effect fires! Keep in mind that to make this run on a timer or loop automatically, you’d want to pair it with a repeating command block or a tick clock setup. If you know a great way to do that, feel free to share it in the comments — I’m always looking to learn new things too! To bring it all together, the I hope this guide has been helpful! If you enjoyed this content, please consider leaving a like on the video and subscribing to the channel — it really does mean a lot. You can also check out my other tutorials on the particle command and the execute command for both Java and Bedrock editions over on my YouTube channel. Thank you so much for reading and watching, and I hope to see you in the next one!Execute If Score Minecraft Command Tutorial – Test Scores and Execute Commands in Java Edition
What Can You Do With This Command?
Part One: Setting Up the Scoreboard
/scoreboard objectives add test dummy/scoreboard objectives setdisplay sidebar test/scoreboard players add @a test 5
Part Two: Executing Commands Based on a Score
/give @s command_block/execute as @a run execute at @s if score @s test matches 5.. run particle minecraft:flame ~ ~ ~ 3 0 0 0 10 @aexecute as @a part means the command is running as every player on the server. The run execute at @s part means it’s then running a secondary command specifically at each individual player’s location — so while it checks everyone, the command only applies to that specific person. The if score @s test matches 5.. part is where the magic happens. This is the query or test — it checks whether the player’s score in the “test” objective matches a certain value. The two dots after the number five mean “five or more.” If you put the two dots before the number, it means “five or less.” If you want to test a specific range, for example five through ten, you would write 5..10. Finally, the run particle minecraft:flame ~ ~ ~ 3 0 0 0 10 @a part is the command that executes when the condition is met — in this case, a flame particle effect.
Resetting the Score Automatically
scoreboard players set @s test 0/execute as @a run execute at @s if score @s test matches 5.. run scoreboard players set @s test 0
Incrementing Scores Based on Player Position
/execute at @a if block ~ ~-1 ~ stone run scoreboard players add @s test 1
Summary
execute if score command is a powerful tool that lets you test a player’s scoreboard value and trigger any command you like based on the result. Whether you want to play a sound, spawn particles, reset a score, or even kill a player, this setup makes it all possible. The key things to remember are that matches 5.. means five or more, matches ..5 means five or less, and matches 5..10 tests for a specific range. You can swap out the scoreboard name “test” for whatever your own objective is called, whether that’s kills, health, deaths, or anything else.





