How can you do it with commands in Minecraft so that if a bossbar has a certain value, then a command will be executed?
The command looks like this:
/ execute store result score NAME SCORE run bossbar get minecraft: BOSSBAR_NAME value
You can replace NAME with a player / placeholder (for scoreboard)
SCORE with the scoreboard on which you want to have the value
BOSSBAR_NAME with the name of the boss bar
And then comparator to the command block?
And I don't quite understand the command.
Sorry have explained too badly I will make another answer
This command must be executed once at the beginning
/ scoreboard objectives add bossbar dummy
This command must always be executed (in a blue command block)
/ execute store result score bossbar bossbar run bossbar get minecraft: BOSSBAR_NAME value
This command must always be executed and you can connect a comparator to it.
/ execute if score bossbar bossbar matches NUMBER
Replace BOSSBAR_NAME with the name of the boss bar
Replace NUMBER with the value that the bossbar should have.
Ah, thanks!
In the last two commands there are 2 bossbars in a row. What is the first and what is the second for?
And why can't I write / execute if score @a BBEFHVillage1 matches 360 on the last command? The @a is marked as wrong.
And if I set the score to 2, the boss bar is still at 360
The first boss bar stands for the player / placeholder and the second for the scoreboard
Because you can only test for one person whether the scoreboard is 360.
You can do it like this:
/ execute as @a if score @s BBEFHVillage1 matches 360
What exactly do you mean. If you set the third command to always active, it will always show you the score that the boss bar has and even if you change the value in the scoreboard.