I have a bossbar that keeps track of each players Stone Mined using the scoreboard. It works properly if only 1 person is on the server. If 2 or more people are on, it will only display for 1 person. I am not sure why, as I have tried different target selectors with the same results.
Any ideas for a fix?
Here is the function file I am using for my feature to work.
tag @a[scores={BreakStone=1..}] add fatigue
tag @a[scores={BreakStone=0}] remove fatigue
scoreboard players set @a[scores={drinkMilk=1..}] BreakStone 1
scoreboard players set @a[scores={drinkMilk=1..}] drinkMilk 0
effect clear @a[scores={BreakStone=1..31}] minecraft:mining_fatigue
effect give @a[scores={BreakStone=32..63}] minecraft:mining_fatigue 99999 0 true
effect clear @a[scores={BreakStone=63}] minecraft:mining_fatigue
effect give @a[scores={BreakStone=64..95}] minecraft:mining_fatigue 99999 1 true
effect clear @a[scores={BreakStone=95}] minecraft:mining_fatigue
effect give @a[scores={BreakStone=96..127}] minecraft:mining_fatigue 99999 2 true
effect clear @a[scores={BreakStone=127}] minecraft:mining_fatigue
effect give @a[scores={BreakStone=128..}] minecraft:mining_fatigue 99999 3 true
scoreboard players add @a[tag=fatigue] fatCool 1
scoreboard players set @a[tag=!fatigue] fatCool 0
scoreboard players remove @a[scores={fatCool=200..}] BreakStone 1
scoreboard players set @a[scores={fatCool=200..}] fatCool 0
bossbar set gameplay:hard_stone players @a[tag=fatigue]
execute at @p[tag=fatigue] run bossbar set gameplay:hard_stone visible true
execute at @p[tag=!fatigue] run bossbar set gameplay:hard_stone visible false
execute store result bossbar gameplay:hard_stone value run scoreboard players get @p BreakStone
Comments 6
I am not asking for command help. I am starting to think this is a bug since it won't display for more than 1 player regardless of any target selector I use. Commands can't have bugs?
I just posted my commands so that you have something to replicate and validate. The commands work just fine.
tag @a[scores={BreakStone=1..}] add fatigue
bossbar set gameplay:hard_stone players @a[tag=fatigue]
execute at @p[tag=fatigue] run bossbar set gameplay:hard_stone visible true
execute at @p[tag=!fatigue] run bossbar set gameplay:hard_stone visible false
execute store result bossbar gameplay:hard_stone value run scoreboard players get @p BreakStone
As a matter of fact, if you want something easier to test that works as intended and is still relevant, use this instead.
However, what STILL won't work is the fact that it won't work for multiple people on a server. Only 1 person. Does not matter what selector you use.
BreakStone scoreboard is set if Stone is mined, you gain 1 point.
If you can get it to work properly, there is not a bug and I am an idiot. You don't even have to tell me the solution, just tell me to figure it out. But chances are it's a bug.
The bossbar is still relatively new. I am playing with it in ways many people haven't in a server environment.
Here is the isolated line from the function that seems to be the target of the issue: