Hello I am working on my first minecraft map! But I don't know how to decrease / increase a number in the bossbar, without entering a specific number, instead, for example, incrementing by 1.
I am using version 1.16.4.
minecraft-java-edition
Hello I am working on my first minecraft map! But I don't know how to decrease / increase a number in the bossbar, without entering a specific number, instead, for example, incrementing by 1.
I am using version 1.16.4.
Best Answer
Bossbars don't support math operations directly. Instead, you'll have to use a scoreboard to manage your bossbars.
I usually create an objective named
bossbar
for my bossbars, and use fake player names as descriptors.We need a repeating command block with the following command. This will make the bossbar use the scoreboard value.
Then, all you need to do is increment the scoreboard and the value in the bossbar will change automatically. Use the following command to decrease bossbar by 5: