You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/routes/wiki/command/data/+page.svx
+14-14Lines changed: 14 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ version: 1.21.8
5
5
---
6
6
7
7
# /data command
8
-
The `/data` command is used to modify and fetch NBT data of [blocks](/wiki/nbt/block-nbt), [entities](/wiki/nbt/entity-nbt) and [storages](/wiki/nbt/storages).
8
+
The `/data` command is used to modify and fetch NBT data of [blocks](/wiki/nbt-scoreboards/block-nbt), [entities](/wiki/nbt-scoreboards/entity-nbt) and [storages](/wiki/nbt-scoreboards/nbt#nbt-storages).
9
9
10
10
:::warning
11
11
Player data cannot be modified using commands. All subcommands fail when trying to modify player data.
@@ -14,18 +14,18 @@ Player data cannot be modified using commands. All subcommands fail when trying
14
14
## Subcommands
15
15
### `get <source> [path] [scale]`
16
16
Gets the data from a data source, and a `path`, if specified. Multiplies the resulting value by `scale`, if specified.
17
-
`source` is a [data source](#data-source), `path` is an [nbt path](/wiki/concepts/nbt_paths) and `scale` is a number.
17
+
`source` is a [data source](#data-source), `path` is an [nbt path](/wiki/nbt-scoreboards/nbt#nbt-paths) and `scale` is a number.
18
18
If `scale` is set, and the data at that path it not a number, the command fails.
19
19
20
-
After fetching the NBT at the path, if it exists, it prints the data in [SNBT](/wiki/nbt/snbt) format in the chat. Therefore, its main use is manually inspecting NBT data. However, it also returns the integer representation <!-- TODO: we probably want to explain ths somewhere --> of the fetched data, so it can be used in combination with `execute store` or `return run` to convert NBT into an integer.
20
+
After fetching the NBT at the path, if it exists, it prints the data in [SNBT](/wiki/nbt-scoreboards/nbt#snbt-format) format in the chat. Therefore, its main use is manually inspecting NBT data. However, it also returns the integer representation <!-- TODO: we probably want to explain ths somewhere --> of the fetched data, so it can be used in combination with `execute store` or `return run` to convert NBT into an integer.
21
21
22
22
#### Examples
23
23
`data get entity @s SelectedItem.id`
24
24
`data get block ~ ~ ~ Items`
25
25
26
26
### `merge <target> <nbt>`
27
27
[Merges](#data-merging) data with the given data source.
28
-
`target` is a [data source](#data-source) and `nbt` is an [SNBT compound](/wiki/nbt/snbt#compounds).
28
+
`target` is a [data source](#data-source) and `nbt` is an [SNBT compound](/wiki/nbt-scoreboards/nbt#snbt-format).
29
29
This command fails if the given entity or block does exist, or if the block is not a block entity and cannot hold NBT data. However, if the data source is a storage, and that storage does no exist yet, the storage is automatically created.
30
30
31
31
#### Examples
@@ -34,25 +34,25 @@ This command fails if the given entity or block does exist, or if the block is n
34
34
35
35
### `modify <target> <path> <action> <source>`
36
36
Modifies the NBT data at the specified path of the given data source. This gives more fine-grained control that `data merge`.
37
-
`target` is the [data source](#data-source) to modify and `path` is an [NBT path](/wiki/concepts/nbt_paths), the specific sub-path of that data source.
37
+
`target` is the [data source](#data-source) to modify and `path` is an [NBT path](/wiki/nbt-scoreboards/nbt#nbt-paths), the specific sub-path of that data source.
38
38
`action` determines what kind of modification occurs. There are 5 possible actions, as below.
39
39
`source` determines the source of the data being used to modify the `target`. See [source](#source) below.
40
40
41
41
#### `append`
42
-
Appends an NBT value to a [list](/wiki/nbt/nbt_format#lists) or a [typed array](/wiki/nbt/nbt_format#typed-arrays), making the value the last element.
42
+
Appends an NBT value to a [list or a typed array](/wiki/nbt-scoreboards/nbt#listsarrays), making the value the last element.
43
43
If the specified path does not exist in the data source, it is created and initialized as a list containing the value just appended.
44
44
This is equivalent to `data modify ... insert 0 ...`.
45
45
46
46
#### `insert <index>`
47
-
Inserts an NBT value into a [list](/wiki/nbt/nbt_format#lists) or [array](/wiki/nbt/nbt_format#typed-arrays) at a specific index, shifting all proceeding elements to the right. Negative indices may be used to indicate inserting values from the end.
47
+
Inserts an NBT value into a [list or array](/wiki/nbt-scoreboards/nbt#listsarrays) at a specific index, shifting all proceeding elements to the right. Negative indices may be used to indicate inserting values from the end.
48
48
If the index specified would cause the inserted item to be further than one after the first or last element of the list, the command fails.
49
49
Inserting creates list if it doesn't exist in the same way as `append`.
50
50
51
51
#### `merge`
52
52
[Merges](#data-merging) `source` into `target` at `path`. This is similar to `data merge`, but allows modifying a sub-path of a data source, and allows merging from more than just hardcoded NBT values.
53
53
54
54
#### `prepend`
55
-
Prepends an NBT value to a [list](/wiki/nbt/nbt_format#lists) or a [typed array](/wiki/nbt/nbt_format#typed-arrays), making the value the first element.
55
+
Prepends an NBT value to a [list or a typed array](/wiki/nbt-scoreboards/nbt#listsarrays), making the value the first element.
56
56
Lists are created in the same wat as `append`.
57
57
This is equivalent to `data modify ... insert -1 ...`.
58
58
@@ -68,12 +68,12 @@ The `example:main` storage looks like this: `{a: {b: {c: {d: 10}}}}`.
68
68
#### `source`
69
69
`source` determines the value modifying `target`. It can be one of:
70
70
71
-
- `value <value>` - Gets the value from an [SNBT literal](/wiki/nbt/snbt).
72
-
- `from <data-source> [path]` - Gets the data from the specified [data source](#data-source) and [path](/wiki/concepts/nbt_paths).
71
+
- `value <value>` - Gets the value from an [SNBT literal](/wiki/nbt-scoreboards/nbt#snbt-format).
72
+
- `from <data-source> [path]` - Gets the data from the specified [data source](#data-source) and [path](/wiki/nbt-scoreboards/nbt#nbt-paths).
73
73
- `string <data-source> [path] [start] [end]` - Gets the data from the specified [data source](#data-source) and ensures that it's a string. If `start` or `end` is specified, truncates the string using those values. `start` is inclusive, while `end` is exclusive. Both numbers are allowed to be negative, counting from the end of the string. For example, the indices `1 -1` remove one character from each end of the string, while `0 1` takes the first character.
74
74
75
75
### `remove <source> <path>`
76
-
Removes the NBT data from `source` at `path`. `source` is a [data source](#data-source) and `path` is an [NBT path](/wiki/concepts/nbt_paths).
76
+
Removes the NBT data from `source` at `path`. `source` is a [data source](#data-source) and `path` is an [NBT path](/wiki/nbt-scoreboards/nbt#nbt-paths).
77
77
This deletes compound keys, and removes array and list elements, shifting proceeding elements left. It cannot, however, be used to delete an entire storage using the special `{}` path; only single keys of the root storage.
78
78
79
79
:::tip
@@ -88,9 +88,9 @@ data remove storage example:main temp
88
88
89
89
## Data source
90
90
The place to get data from or store data to. One of:
91
-
- `entity <selector>` - The [NBT of an entity](/wiki/nbt/entity_nbt).
92
-
- `block <pos>` - The [NBT of a block entity](/wiki/nbt/block_nbt).
93
-
- `storage <name>` - The NBT from a [data storage](/wiki/nbt/storages).
91
+
- `entity <selector>` - The [NBT of an entity](/wiki/nbt-scoreboards/entity-nbt).
92
+
- `block <pos>` - The [NBT of a block entity](/wiki/nbt-scoreboards/block-nbt).
93
+
- `storage <name>` - The NBT from a [data storage](/wiki/nbt-scoreboards/nbt#nbt-storages).
94
94
95
95
## Data merging
96
96
Data merging is a process of merging two data values into one another.
Copy file name to clipboardExpand all lines: src/routes/wiki/concepts/target-selectors/+page.svx
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ argument. (E.g. @e[type=!minecraft:creeper] will select every entity that is NOT
61
61
| `type` | `@e[type=minecraft:pig]` | Filters to only include entities of a certain type or entity_type tag. Valid with `@e`, `@s` and `@n`. `type` can be any entity ID or entity_type tag. |
62
62
| `name` | `@e[name=Aron]` | Filters to include entities with a specific name. `name` is a string - it cannot be JSON text. |
63
63
| `distance` | `@e[distance=6]` | Filters to include entities within a certain distance or range. `..` is used to represent "greater/less than" operations - for example, `..6` means less than 6 and, `8..` means more than 8. |
64
-
| `nbt` | `@a[nbt={SelectedItem:{id:"minecraft:stone"}}]` | Filters to include entities with specific [NBT data](/wiki/nbt/nbt). NBT data will be partially matched - as long as the specified data exists on the entity, it doesn't matter what other data it has. |
64
+
| `nbt` | `@a[nbt={SelectedItem:{id:"minecraft:stone"}}]` | Filters to include entities with specific [NBT data](/wiki/nbt-scoreboards/nbt). NBT data will be partially matched - as long as the specified data exists on the entity, it doesn't matter what other data it has. |
65
65
| `sort` and `limit` | `@e[limit=1,sort=nearest]` | These two arguments are often used together to find entities based on ordering. For example, `limit=5,sort=furthest` selects the 5 entities which are furthest away from the current position. |
66
66
| `x`/`y`/`z` | `@e[x=10,y=9,z=-5,distance=..5]` | Specifies a starting position to work from; affecting `distance`, `dx`/`dy`/`dz`, and `sort`/`limit`. If left blank, it defaults to `~ ~ ~`. |
67
67
| `dx`/`dy`/`dz` | `@e[x=10,y=13,z=87,dx=10,dy=20,dz=5]` | Creates a selection area (cuboid) which will only select entities if part of their hit box is within the area. The current position or `x`/`y`/`z` is used as the position of the cuboid's corner, where the coordinates are the smallest. If at least one of the `dx`/`dy`/`dz` values are set, the others default to 0 if not set. The checked area is always 1 block bigger in the positive direction than specified, so the smallest checkable area is a 1x1x1 cube with all values at 0. |
@@ -123,7 +123,7 @@ range.
123
123
The `nbt=<object>` argument will filter the selection to only include entities which have or do not have specific NBT
124
124
data.
125
125
126
-
`<object>` is an [NBT compound](/wiki/nbt/nbt). The entity must match everything within the compound.
126
+
`<object>` is an [NBT compound](/wiki/nbt-scoreboards/nbt). The entity must match everything within the compound.
Copy file name to clipboardExpand all lines: src/routes/wiki/concepts/text/+page.svx
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,7 @@ The following properties can be used in a text component to add **interactivity*
79
79
- `separator`: If the text source returns multiple values (e.g. multiple entities with the `selector` source, or multiple NBT values with the `nbt` source), this can be used to specify the separator between the values. This should be a string value.
80
80
81
81
## Text component generators
82
-
Writing text components manually is tedious - there are numerous generators which can be used to quickly create text components. We reccomend [our Minecraft Text Generator](https://text.datapackhub.net) which has an easy UI, cool features like gradient creators, and is updated for modern versions.
82
+
Writing text components manually is tedious - there are numerous generators which can be used to quickly create text components. We recommend [our Minecraft Text Generator](https://text.datapackhub.net) which has an easy UI, cool features like gradient creators, and is updated for modern versions.
83
83
84
84
If you are a more advanced datapacker and want full control over the output, these let you create text components one component at a time, with support for more advanced features
| `id` | A string | The id of the resulting item |
176
-
| `components` (optional) | An object | A map of [component](/wiki/concepts/item_components) names to values, which add to or replace the components of the resulting item |
176
+
| `components` (optional) | An object | A map of [component](/wiki/concepts/item-components) names to values, which add to or replace the components of the resulting item |
Copy file name to clipboardExpand all lines: src/routes/wiki/info/json/+page.svx
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: "A rough guide to the JSON format used in Minecraft Datapacks (amon
4
4
---
5
5
6
6
# JSON Format
7
-
JSON is a data storage type used by Minecraft Datapacks for files such as [predicates](/wiki/files/predicates) and [tags](/wiki/files/tags), as well as in [JSON Text](/wiki/concepts/text). JSON is a way of storing data, usually used in `.json` files but is also seen in `.mcmeta` files too.
7
+
JSON is a data storage type used by Minecraft Datapacks for files such as [predicates](/wiki/files/predicates) and [tags](/wiki/files/tags), as well as in [Styled Text](/wiki/concepts/json-text). JSON is a way of storing data, usually used in `.json` files but is also seen in `.mcmeta` files too.
8
8
9
9
## How JSON works
10
10
JSON stands for **JavaScript Object Notation**. It was originally created as a way of writing objects in Javascript. These days, JSON is used in almost every programming environment, datapacks included.
0 commit comments