mirror of
https://github.com/LukeHagar/unicorn-utterances.git
synced 2025-12-09 12:57:45 +00:00
add a small introduction & show scoreboard images in the display section
This commit is contained in:
committed by
Corbin Crutchley
parent
a3d1fbb7d8
commit
c43e362a00
BIN
content/blog/minecraft-data-packs-scoreboards/belowName.png
Normal file
BIN
content/blog/minecraft-data-packs-scoreboards/belowName.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 359 KiB |
@@ -16,6 +16,8 @@
|
||||
|
||||
The data packs built in this series can be found in the [unicorn-utterances/mc-datapacks-tutorial](https://github.com/unicorn-utterances/mc-datapacks-tutorial/tree/main/3-scoreboards) repository. Feel free to use it for reference as you read through these articles!
|
||||
|
||||
Previously, this series has covered the structure of a data pack, conditional statements, and other command syntax. This article will build on top of that to cover scoreboards, which allows us to keep track of player information and store variables in our programs.
|
||||
|
||||
# Storing scores
|
||||
|
||||
In many data packs, you might find a need to store information that can't be directly accessed through an entity or another command. A common way to do this is through the use of *scoreboards,* which can store a table of numbers for each entity or player. These can be used to reference player statistics, such as the number of blocks mined, or keep track of arbitrary values in your code.
|
||||
@@ -32,7 +34,7 @@ This creates an objective named `fennifith.animals_spawned` that is connected to
|
||||
|
||||
### What is an objective?
|
||||
|
||||
The naming of "objective" and "scoreboard" can be a point of confusion. In this article, for simplicity's sake, they can be considered as two names for the same thing, even though they might have slightly different meanings.
|
||||
The naming of "objective" and "scoreboard" can be a point of confusion. In this article, for simplicity's sake, they can be considered as two names for the same thing — even though they might have slightly different meanings.
|
||||
|
||||
Generally speaking, an "objective" is a relation between a set of scores and a statistic. Here, the objective name is `fennifith.animals_spawned` and the statistic is `dummy`. The objective contains its scores for each player in the form of a scoreboard.
|
||||
|
||||
@@ -249,6 +251,10 @@ More areas other than `sidebar` include:
|
||||
- `list`, which shows the scores next to player names in the tab menu (in Multiplayer only)
|
||||
- `belowName`, which displays a player's score underneath their name tag
|
||||
|
||||
| Sidebar | List | Below Name |
|
||||
| ------- | ---- | ---------- |
|
||||
|  |  |  |
|
||||
|
||||
## `/tellraw` command
|
||||
|
||||
The `/tellraw` command can be used to send a formatted message in the game chat. It has a wide variety of uses and formatting options, one of which can embed a scoreboard value into the printed message.
|
||||
|
||||
BIN
content/blog/minecraft-data-packs-scoreboards/list.png
Normal file
BIN
content/blog/minecraft-data-packs-scoreboards/list.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
BIN
content/blog/minecraft-data-packs-scoreboards/scoreboard.png
Normal file
BIN
content/blog/minecraft-data-packs-scoreboards/scoreboard.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 72 KiB |
Reference in New Issue
Block a user