Command Block help
Good afternoon, I'm trying to see if there are any command block experts out there that can help me bring my idea into fruition.
I'm running a completely F2P Cobblemon server, and the way I want to implement ranks is via a scoreboard system that will rank up the player once they achieve a certain score.
I've created a dummy Scoreboard titled "BP" (short for Boss Points) and players will achieve BP by defeating bosses. This will be handled via an external mod, and I already know how I'm going to handle this.
I'm trying to set it up to where, once a players has achieved a certain score, they will rank up in the server, but I'm struggling to figure out a way to only run the command a single time, when a player achieves that score. For testing purposes, I replaced the "rank up" command with giving the player a diamond.
I have a repeating command block set to "always active" to check if the player's score is at a certain amount. In this case, 10 or higher. The command block has the following command:
execute as @a if score @s BP matches 10..
I've tried running this into an "impulse" command block that is "always active" and has the following command:
execute as @a run give @s minecraft:diamond 1
and it does not give the diamond when the player achieves a BP of 10, but rather it gives it a single time when I place the command block, and that's it.
Changing it to a "Chaining" command block works, but it fives the player a diamond every tick, provided their "BP" score is above 10.
Is there any way I can make it so that once it runs the command ONCE for that player, it does not run it again?1 Reply
It would be slightly easier to do this as a datapack FYI. For commands you would simply add a chain command block facing the same way on top of the repeating, have it give the diamond and then one to give the appropriate rank up, limit the @a using @a[<limiter>] to only activate on players that don't already have the rank.