1

I'm fairly new to using commands. I am working on a little project about a mini-game and i've come to a roadblock. I am using Visual Studio Code to work on this project and have set up my own data pack. In this mini-game there are different waves. For wave 1 there are 12 enemies.

I've set up a scoreboard system so when 1 enemy is killed it adds 1 to the scoreboard. To activate Wave 2 i've set up a command:

execute if score @e[type=armor_stand,limit=1,sort=nearest,tag=test] monster matches 12 run schedule function mc:wave_two 1t append

I've put this command in a tick function so it'll run every 1 tick. The issue with this is that once the conditions are met it'll constantly run this command. Can I make the condition stop checking once it works?

3
  • 1
    Would it work to set the condition to false after the check completes and it runs the procedure? – hyper-neutrino May 2 at 0:53
  • 1
    @hyper-neutrino I am currently trying it right now but in theory should work. The command I did was execute if score @e[type=armor_stand,limit=1,sort=nearest,tag=test] monster matches 12 run scoreboard players add @e[type=armor_stand,sort=nearest,tag=test,limit=1] monster 1 This command will add one to the score so therefore if the original command: execute if score @e[type=armor_stand,limit=1,sort=nearest,tag=test] monster matches 12 run schedule function mc:wave_two 1t append succeeds it'll add one to the score and it won't loop. i'll update soon – Adam Soong May 2 at 11:34
  • Update: It worked! Thanks! – Adam Soong May 2 at 11:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.