I'm new in these kinds of scoreboard and trigger commands. I would like to know how to display any kind of text/number on my scoreboard. Can anyone explain and give me examples of those commands?
Minecraft – How to display arbitrary text and numbers in the scoreboard sidebar
minecraft-commandsminecraft-java-edition
Related Topic
- Minecraft scoreboard count multiple block Ids
- Minecraft Java Edition Commands – Displaying Colored Text When Entering Specific Area
- Minecraft – ny way to numerically retrieve and store the block ID of a block in the scoreboard using command blocks
- Minecraft – Alternatives for setting up a digital clock in the scoreboard sidebar 1.15.2
Best Answer
The sidebar is a display of "players" and their scores in one scoreboard. You can create a scoreboard like this:
This creates a scoreboard with the ID "
scoreboard_id
" that is shown in the sidebar and in the feedback of some commands as "Scoreboard display text" and is of type "dummy
", which means that nothing changes it except for commands.To show it in the sidebar, do this:
But it doesn't actually show up until someone has a score in that scoreboard.
Now to the thing you actually asked about: To show arbitrary text in the sidebar, you need to set a score of a "dummy player" to a value. Example:
This will show up like this in the sidebar:
But be careful! There is a real Minecraft account named "player_name" (archive), so if that person is on your server or plays a map that you release or anything like that, you will actually set their score to that value. There are only two ways I know around that:
$name
". But it will be displayed like that on the sidebar.$r
" before the dummy player name. The problem is that this only works in functions. So you need to create a datapack with a function that does nothing except setting a scoreboard score, have it enabled and run the function instead of directly running the command.Thanks to Lilith in the Minecraft commands Discord chat for the tip about the formatting code!