Skip to content

Commit 5f636c7

Browse files
committed
update nbt and other pages
1 parent fcdc869 commit 5f636c7

4 files changed

Lines changed: 18 additions & 22 deletions

File tree

src/lib/sidebar/tabs/WikiPages.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<SidebarPage label="Target Selectors" icon={IconAt} page="/wiki/concepts/target-selectors" />
4949
<SidebarPage label="Coordinates" icon={IconTilde} page="/wiki/concepts/coordinates" />
5050
<SidebarPage label="Item Components" icon={IconComponents} page="/wiki/concepts/item-components" />
51-
<SidebarPage label="JSON Text" icon={IconBraces} page="/wiki/concepts/json-text" />
51+
<SidebarPage label="JSON Text" icon={IconBraces} page="/wiki/concepts/text" />
5252
<SidebarPage label="Resource Locations" icon={IconResourceLocation} page="/wiki/concepts/resource-locations" />
5353
<SidebarPage label="Ranges" icon={IconRange} page="/wiki/concepts/ranges" />
5454
</SidebarCategory>

src/routes/search.json/meta.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/routes/wiki/info/json/+page.svx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: "A rough guide to the JSON format used in Minecraft Datapacks (amon
44
---
55

66
# 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/json-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 [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.
88

99
## How JSON works
1010
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.

src/routes/wiki/nbt-scoreboards/nbt/+page.svx

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -91,22 +91,25 @@ string, text, booleans, and more.
9191
Strings can store any text value, or more technically, any sequence of unicode characters.
9292

9393
**Format**: Strings are stored within either double or single quotes. For strings containing standard characters
94-
(`A-Z, a-z, 0-9, -,_,+,.`), the quotes are optional, but recommended. `"<text>"` or `'<text>'` or `<text>`
94+
(`A-Z, a-z, 0-9, -,_,+,.`), the quotes are optional (as long as the text starfts with a letter), but recommended. `"<text>"` or `'<text>'` or `<text>`
9595

9696
**Example**: `name:"Silabear"`, `name:'Cobblestone'`, `name:Aandeel`
9797

9898
### Whole Numbers
9999

100100
**Short**, **Int**, and **Long** data types all represent integers (whole numbers).
101101

102-
- **Byte** is an unsigned 8 bit integers, it can be any value from `0` to `255`
103-
- **Short** is a signed 16 bit integer, it can be any value from `-32,768` to `32,767`
104-
- **Int** is a signed 32 bit integer, it can be any value from `-2,147,483,648` to `2,147,483,647`
105-
- **Long** is a signed 64 bit integer, it can be any value from `-9,223,372,036,854,775,808` to
102+
- **Byte** is an 8 bit integer, it can be any value from `0` to `255`
103+
- **Short** is a 16 bit integer, it can be any value from `-32,768` to `32,767`
104+
- **Int** is a 32 bit integer, it can be any value from `-2,147,483,648` to `2,147,483,647`
105+
- **Long** is a 64 bit integer, it can be any value from `-9,223,372,036,854,775,808` to
106106
`9,223,372,036,854,775,807`
107107

108-
**Format**: By default, numbers are stored as integers. To store a number in the other formats, you need to use the appropriate suffix.
109-
For shorts, ints, and longs, the prefix is `s`, `i`, and `l` respectively.
108+
**Format**: By default, numbers are stored as integers. To store a number in the other formats, you need to use the appropriate suffix. For shorts, ints, and longs, the prefix is `s`, `i`, and `l` respectively.
109+
110+
The suffix can be extended with `u` or `s` to say whether it is unsigned (only a positive number) or signed (can be positive or negative) - for example, `402ub`.
111+
112+
It is also possible to write using E notation (e.g `1.2E3` would be `1200`), hexadecimals (e.g `0xBC` would be `188`), and binary (e.g `0b110` would be `6`)
110113

111114
**Example**: `count:1234s`, `bigNumber:1200000`, `reallyBigNumber:12123023687234L`, `byte:112b`
112115

@@ -125,23 +128,16 @@ appropriate suffix. For floats, the suffix is `f`. For doubles, the suffix is `d
125128

126129
### Bytes or Booleans
127130

128-
In older versions of Minecraft, booleans were stored as bytes with `0b` representing
129-
`false` and `1b` representing `true`. In newer versions, booleans were introduced.
130-
Essentially, booleans represent the old `0b` and `1b` with a more descriptive name.
131-
It's recommended to use booleans instead of bytes whenever possible, as they are more readable.
131+
In older versions of Minecraft, booleans were stored as bytes with `0b` representing `false` and `1b` representing `true`. In newer versions, booleans were introduced. Essentially, booleans represent the old `0b` and `1b` with a more descriptive name. It's recommended to use booleans instead of bytes whenever possible, as they are more readable.
132132

133-
### Arrays
134133

135-
Arrays are used to store multiple values of the same type. There are currently 3 types of arrays:
136134

137-
- **Byte Array**: Used to store multiple bytes
138-
- **Int Array**: Used to store multiple integers
139-
- **Long Array**: Used to store multiple longs
135+
### Lists/Arrays
136+
Lists, or number arrays are used to store multiple values. Lists can store different types of values, whereas number arrays can only store the same type of number. In practicality, you often do not need to think about the difference
140137

141-
**Format**: Arrays are defined using square brackets (`[]`), followed by the type of the array, a semicolon, and then your data.
142-
The data still has to have prefixes if it needs it.
138+
**Format**: Theyu are defined using square brackets (`[]`), with the values separated by commas. Number arrays can be prefixed with the type of numbr the array is going to store and a semicolon (for instance, a list starting with `[B;` will only store bytes)
143139

144-
**Example**: `[B;1b,2B,true,false]`, `[I;1,2,3,4,5]`, `[L;1l,2l,3l,4l,5l]`
140+
**Example**: `["Silabear", 15, true, 242]`, `[B;1b,2B,true,false]`, `["Kanokarob", "LadyEternal", "lionlance", "thederdiscohund", "theblackswitch"]`, `[L;1l,2l,3l,4l,5l]`
145141

146142
## Validator
147143

0 commit comments

Comments
 (0)