minecraft-data 3.9.0 → 3.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +1 -6
- package/.github/workflows/md-release.yml +5 -4
- package/.github/workflows/npm-publish.yml +1 -2
- package/.github/workflows/trigger.yml +2 -2
- package/README.md +14 -15
- package/data.js +22 -1
- package/doc/api.md +460 -167
- package/doc/history.md +410 -176
- package/index.d.ts +152 -125
- package/lib/indexes.js +0 -2
- package/lib/loader.js +1 -2
- package/minecraft-data/README.md +1 -1
- package/minecraft-data/data/bedrock/1.16.201/proto.yml +1 -1
- package/minecraft-data/data/bedrock/1.16.201/protocol.json +1 -1
- package/minecraft-data/data/bedrock/1.16.210/proto.yml +1 -1
- package/minecraft-data/data/bedrock/1.16.210/protocol.json +1 -1
- package/minecraft-data/data/bedrock/1.16.220/proto.yml +1 -1
- package/minecraft-data/data/bedrock/1.16.220/protocol.json +1 -1
- package/minecraft-data/data/bedrock/1.17.0/proto.yml +1 -1
- package/minecraft-data/data/bedrock/1.17.0/protocol.json +1 -1
- package/minecraft-data/data/bedrock/1.17.10/proto.yml +1 -1
- package/minecraft-data/data/bedrock/1.17.10/protocol.json +1 -1
- package/minecraft-data/data/bedrock/1.17.30/proto.yml +1 -1
- package/minecraft-data/data/bedrock/1.17.30/protocol.json +1 -1
- package/minecraft-data/data/bedrock/1.17.40/proto.yml +1 -1
- package/minecraft-data/data/bedrock/1.17.40/protocol.json +1 -1
- package/minecraft-data/data/bedrock/1.18.0/proto.yml +1 -1
- package/minecraft-data/data/bedrock/1.18.0/protocol.json +1 -1
- package/minecraft-data/data/bedrock/1.18.11/proto.yml +1 -1
- package/minecraft-data/data/bedrock/1.18.11/protocol.json +1 -1
- package/minecraft-data/data/bedrock/1.18.30/proto.yml +1 -1
- package/minecraft-data/data/bedrock/1.18.30/protocol.json +1 -1
- package/minecraft-data/data/bedrock/1.19.1/proto.yml +1 -1
- package/minecraft-data/data/bedrock/1.19.1/protocol.json +1 -1
- package/minecraft-data/data/bedrock/1.19.10/proto.yml +3680 -0
- package/minecraft-data/data/bedrock/1.19.10/protocol.json +1 -1
- package/minecraft-data/data/bedrock/1.19.10/types.yml +1955 -0
- package/minecraft-data/data/bedrock/1.19.20/protocol.json +10644 -0
- package/minecraft-data/data/bedrock/1.19.20/version.json +6 -0
- package/minecraft-data/data/bedrock/common/protocolVersions.json +6 -0
- package/minecraft-data/data/bedrock/common/versions.json +2 -1
- package/minecraft-data/data/bedrock/latest/proto.yml +55 -7
- package/minecraft-data/data/bedrock/latest/types.yml +7 -0
- package/minecraft-data/data/dataPaths.json +22 -1
- package/minecraft-data/data/pc/1.19/protocol.json +1 -5
- package/minecraft-data/data/pc/1.7/protocol.json +1 -1
- package/minecraft-data/data/pc/1.8/protocol.json +1 -1
- package/minecraft-data/data/pc/15w40b/protocol.json +1 -1
- package/minecraft-data/data/pc/common/protocolVersions.json +35 -0
- package/minecraft-data/doc/history.md +14 -0
- package/package.json +1 -1
- package/typings/generate-typings.js +22 -14
- package/typings/index-template.d.ts +160 -133
- package/typings/test-typings.ts +24 -29
package/doc/api.md
CHANGED
|
@@ -1,364 +1,657 @@
|
|
|
1
1
|
# API
|
|
2
2
|
|
|
3
|
+
Import the module:
|
|
4
|
+
|
|
5
|
+
```js
|
|
6
|
+
const minecraftData = require('minecraft-data')
|
|
7
|
+
|
|
8
|
+
const mcData = minecraftData('1.19')
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
or using es6 import syntax:
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import minecraftData from 'minecraft-data'
|
|
15
|
+
|
|
16
|
+
const mcData = minecraftData('1.19')
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
All examples reference `minecraftData` as the module, and `mcData` as the version data.
|
|
20
|
+
|
|
3
21
|
## Blocks
|
|
4
22
|
|
|
5
|
-
###
|
|
23
|
+
### mcData.blocks
|
|
24
|
+
|
|
25
|
+
Blocks indexed by id
|
|
6
26
|
|
|
7
|
-
|
|
27
|
+
Example:
|
|
8
28
|
|
|
9
|
-
|
|
29
|
+
```js
|
|
30
|
+
console.log(mcData.blocks[1]) // Object containing information for "Stone"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### mcData.blocksByName
|
|
34
|
+
|
|
35
|
+
Blocks indexed by name
|
|
36
|
+
|
|
37
|
+
Example:
|
|
38
|
+
|
|
39
|
+
```js
|
|
40
|
+
console.log(mcData.blocksByName['stone']) // Object containing information for "Stone"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### mcData.blocksArray
|
|
10
44
|
|
|
11
|
-
|
|
45
|
+
Array of blocks
|
|
12
46
|
|
|
13
|
-
###
|
|
47
|
+
### mcData.blocksByStateId
|
|
14
48
|
|
|
15
|
-
|
|
49
|
+
Blocks indexed by state id
|
|
16
50
|
|
|
17
|
-
|
|
51
|
+
Example:
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
console.log(mcData.blocksByStateId[100]) // Object containing information for "Lava" (as Lava has a state range from 91 to 106)
|
|
55
|
+
```
|
|
18
56
|
|
|
19
|
-
|
|
57
|
+
### mcData.blockStates
|
|
20
58
|
|
|
21
|
-
|
|
59
|
+
**_Bedrock edition only_**
|
|
22
60
|
|
|
23
|
-
block
|
|
61
|
+
Array of block states
|
|
62
|
+
|
|
63
|
+
Example:
|
|
64
|
+
|
|
65
|
+
```js
|
|
66
|
+
console.log(mcData.blockStates[50]) // Object containing block state information for "Warped Door"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### mcData.blockCollisionShapes
|
|
70
|
+
|
|
71
|
+
Block collision shapes. Contains `blocks`, with each block (indexed by name) containing an array of collision shape ids. Also contains `shapes`, providing all collision shapes information (indexed by id).
|
|
72
|
+
|
|
73
|
+
Example:
|
|
74
|
+
|
|
75
|
+
```js
|
|
76
|
+
console.log(mcData.blockCollisionShapes.blocks['oak_stairs']) // Array of collision shape ids for "Oak Stairs"
|
|
77
|
+
// Returns: [ 42, 32, 43, 33, 37, 27, 38, 28 ]
|
|
78
|
+
|
|
79
|
+
console.log(mcData.blockCollisionShapes.shapes[42]) // Collision information for collision shape id 42
|
|
80
|
+
// Returns: [ [ 0, 0, 0, 1, 0.5, 1 ], [ 0.5, 0.5, 0.5, 1, 1, 1 ] ]
|
|
81
|
+
```
|
|
24
82
|
|
|
25
83
|
## Items
|
|
26
84
|
|
|
27
|
-
###
|
|
85
|
+
### mcData.items
|
|
28
86
|
|
|
29
|
-
|
|
87
|
+
Items indexed by id
|
|
30
88
|
|
|
31
|
-
|
|
89
|
+
Example:
|
|
32
90
|
|
|
33
|
-
|
|
91
|
+
```js
|
|
92
|
+
console.log(mcData.items[772]) // Object containing information for "Wheat"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### mcData.itemsByName
|
|
96
|
+
|
|
97
|
+
Items indexed by name
|
|
34
98
|
|
|
35
|
-
|
|
99
|
+
Example:
|
|
100
|
+
|
|
101
|
+
```js
|
|
102
|
+
console.log(mcData.itemsByName['wheat']) // Object containing information for "Wheat"
|
|
103
|
+
```
|
|
36
104
|
|
|
37
|
-
|
|
105
|
+
### mcData.itemsArray
|
|
106
|
+
|
|
107
|
+
Array of items
|
|
38
108
|
|
|
39
109
|
## Foods
|
|
40
110
|
|
|
41
|
-
###
|
|
111
|
+
### mcData.foods
|
|
42
112
|
|
|
43
|
-
|
|
113
|
+
Foods indexed by id
|
|
44
114
|
|
|
45
|
-
|
|
115
|
+
Example:
|
|
46
116
|
|
|
47
|
-
|
|
117
|
+
```js
|
|
118
|
+
console.log(mcData.foods[1003]) // Object containing information for "Pumpkin Pie"
|
|
119
|
+
```
|
|
48
120
|
|
|
49
|
-
###
|
|
121
|
+
### mcData.foodsByName
|
|
50
122
|
|
|
51
|
-
|
|
123
|
+
Foods indexed by name
|
|
52
124
|
|
|
53
|
-
|
|
125
|
+
Example:
|
|
54
126
|
|
|
55
|
-
|
|
127
|
+
```js
|
|
128
|
+
console.log(mcData.foodsByName['pumpkin_pie']) // Object containing information for "Pumpkin Pie"
|
|
129
|
+
```
|
|
56
130
|
|
|
57
|
-
###
|
|
131
|
+
### mcData.foodsArray
|
|
58
132
|
|
|
59
|
-
|
|
133
|
+
Array of foods
|
|
60
134
|
|
|
61
135
|
## Biomes
|
|
62
136
|
|
|
63
|
-
###
|
|
137
|
+
### mcData.biomes
|
|
64
138
|
|
|
65
|
-
|
|
139
|
+
Biomes indexed by id
|
|
66
140
|
|
|
67
|
-
|
|
141
|
+
Example:
|
|
68
142
|
|
|
69
|
-
|
|
143
|
+
```js
|
|
144
|
+
console.log(mcData.biomes[20]) // Object containing information for "Windswept Gravelly Hills"
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### mcData.biomesByName
|
|
148
|
+
|
|
149
|
+
Biomes indexed by name
|
|
150
|
+
|
|
151
|
+
Example:
|
|
152
|
+
|
|
153
|
+
```js
|
|
154
|
+
console.log(mcData.biomesByName['windswept_gravelly_hills']) // Object containing information for "Windswept Gravelly Hills"
|
|
155
|
+
```
|
|
70
156
|
|
|
71
|
-
###
|
|
157
|
+
### mcData.biomesArray
|
|
72
158
|
|
|
73
|
-
|
|
159
|
+
Array of biomes
|
|
74
160
|
|
|
75
161
|
## Recipes
|
|
76
162
|
|
|
77
|
-
###
|
|
163
|
+
### mcData.recipes
|
|
164
|
+
|
|
165
|
+
Recipes indexed by the resulting item id
|
|
166
|
+
|
|
167
|
+
Example:
|
|
168
|
+
|
|
169
|
+
```js
|
|
170
|
+
console.log(mcData.recipes[31]) // Recipe information for crafting "Dripstone Block"
|
|
171
|
+
|
|
172
|
+
// Returns:
|
|
173
|
+
// {
|
|
174
|
+
// inShape: [ [ 1100, 1100 ], [ 1100, 1100 ] ],
|
|
175
|
+
// result: { count: 1, id: 13 }
|
|
176
|
+
// }
|
|
78
177
|
|
|
79
|
-
|
|
178
|
+
// Note: 1100 is the block ID of "Pointed Dripstone"
|
|
179
|
+
```
|
|
80
180
|
|
|
81
181
|
## Instruments
|
|
82
182
|
|
|
83
|
-
###
|
|
183
|
+
### mcData.instruments
|
|
184
|
+
|
|
185
|
+
Instruments indexed by id
|
|
84
186
|
|
|
85
|
-
|
|
187
|
+
Example:
|
|
188
|
+
|
|
189
|
+
```js
|
|
190
|
+
console.log(mcData.instruments[5])
|
|
191
|
+
// Returns: { id: 5, name: 'flute' }
|
|
192
|
+
```
|
|
86
193
|
|
|
87
|
-
###
|
|
194
|
+
### mcData.instrumentsArray
|
|
88
195
|
|
|
89
|
-
|
|
196
|
+
Array of instruments
|
|
90
197
|
|
|
91
198
|
## Materials
|
|
92
199
|
|
|
93
|
-
###
|
|
200
|
+
### mcData.materials
|
|
94
201
|
|
|
95
|
-
|
|
202
|
+
Material types indexed by name
|
|
203
|
+
|
|
204
|
+
Example:
|
|
205
|
+
|
|
206
|
+
```js
|
|
207
|
+
console.log(mcData.materials['mineable/axe'])
|
|
208
|
+
// Returns: { '702': 2, '707': 4, '712': 12, '717': 6, '722': 8, '727': 9 }
|
|
209
|
+
```
|
|
96
210
|
|
|
97
211
|
## Entities
|
|
98
212
|
|
|
99
|
-
###
|
|
213
|
+
### mcData.mobs
|
|
100
214
|
|
|
101
|
-
|
|
215
|
+
Mobs (passive, neutral, and hostile) indexed by id
|
|
102
216
|
|
|
103
|
-
|
|
217
|
+
Example:
|
|
104
218
|
|
|
105
|
-
|
|
219
|
+
```js
|
|
220
|
+
console.log(mcData.mobs[30]) // Object containing information for "Ghast"
|
|
221
|
+
```
|
|
106
222
|
|
|
107
|
-
###
|
|
223
|
+
### mcData.objects
|
|
108
224
|
|
|
109
|
-
entities indexed by
|
|
225
|
+
Objects (non-mob entities such as vehicles and projectiles) indexed by id
|
|
110
226
|
|
|
111
|
-
|
|
227
|
+
Example:
|
|
112
228
|
|
|
113
|
-
|
|
229
|
+
```js
|
|
230
|
+
const mcData = MinecraftData('1.8.9')
|
|
231
|
+
|
|
232
|
+
console.log(mcData.objects[10]) // Object containing information for "Minecart"
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### mcData.entities
|
|
236
|
+
|
|
237
|
+
Entities indexed by id
|
|
238
|
+
|
|
239
|
+
Example:
|
|
240
|
+
|
|
241
|
+
```js
|
|
242
|
+
console.log(mcData.entities[25]) // Object containing information for "Evoker"
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### mcData.entitiesByName
|
|
246
|
+
|
|
247
|
+
Entities indexed by name
|
|
248
|
+
|
|
249
|
+
Example:
|
|
250
|
+
|
|
251
|
+
```js
|
|
252
|
+
console.log(mcData.entitiesByName['evoker']) // Object containing information for "Evoker"
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### mcData.entitiesArray
|
|
256
|
+
|
|
257
|
+
Array of entities
|
|
114
258
|
|
|
115
259
|
## Enchantments
|
|
116
260
|
|
|
117
|
-
###
|
|
261
|
+
### mcData.enchantments
|
|
118
262
|
|
|
119
|
-
|
|
263
|
+
Enchantments indexed by id
|
|
120
264
|
|
|
121
|
-
|
|
265
|
+
Example:
|
|
122
266
|
|
|
123
|
-
|
|
267
|
+
```js
|
|
268
|
+
console.log(mcData.enchantments[37]) // Object containing information for "Mending"
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### mcData.enchantmentsByName
|
|
272
|
+
|
|
273
|
+
Enchantments indexed by name
|
|
124
274
|
|
|
125
|
-
|
|
275
|
+
Example:
|
|
126
276
|
|
|
127
|
-
|
|
277
|
+
```js
|
|
278
|
+
console.log(mcData.enchantmentsByName['mending']) // Object containing information for "Mending"
|
|
279
|
+
```
|
|
128
280
|
|
|
129
|
-
###
|
|
281
|
+
### mcData.enchantmentsArray
|
|
130
282
|
|
|
131
|
-
|
|
283
|
+
Array of enchantments
|
|
284
|
+
|
|
285
|
+
### mcData.defaultSkin
|
|
286
|
+
|
|
287
|
+
**_Bedrock edition only_**
|
|
288
|
+
|
|
289
|
+
Skin geometry and texture data for default player skin
|
|
132
290
|
|
|
133
291
|
## Protocol
|
|
134
292
|
|
|
135
|
-
###
|
|
293
|
+
### mcData.protocol
|
|
294
|
+
|
|
295
|
+
The Minecraft protocol
|
|
296
|
+
|
|
297
|
+
### mcData.protocolComments
|
|
298
|
+
|
|
299
|
+
The Minecraft protocol comments
|
|
136
300
|
|
|
137
|
-
|
|
301
|
+
### mcData.protocolYaml
|
|
138
302
|
|
|
303
|
+
**_Bedrock edition only_**
|
|
139
304
|
|
|
140
|
-
|
|
305
|
+
The url to the files of the protocol yaml
|
|
141
306
|
|
|
142
|
-
|
|
307
|
+
## Windows (GUIs)
|
|
143
308
|
|
|
144
|
-
|
|
309
|
+
### mcData.windows
|
|
145
310
|
|
|
146
|
-
|
|
311
|
+
Windows indexed by id
|
|
147
312
|
|
|
148
|
-
|
|
313
|
+
Example:
|
|
149
314
|
|
|
150
|
-
|
|
315
|
+
```js
|
|
316
|
+
console.log(mcData.windows['minecraft:villager']) // Object containing window information for the villager GUI
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### mcData.windowsByName
|
|
151
320
|
|
|
152
|
-
|
|
321
|
+
Windows indexed by name
|
|
153
322
|
|
|
154
|
-
|
|
323
|
+
Example:
|
|
324
|
+
|
|
325
|
+
```js
|
|
326
|
+
console.log(mcData.windowsByName['NPC Trade']) // Object containing window information for the villager GUI
|
|
327
|
+
```
|
|
155
328
|
|
|
156
|
-
|
|
329
|
+
### mcData.windowsArray
|
|
157
330
|
|
|
331
|
+
Array of windows
|
|
158
332
|
|
|
159
333
|
## Version
|
|
160
334
|
|
|
161
|
-
|
|
335
|
+
For version comparison, the other version must be of the same type, and the prefix is always implied
|
|
162
336
|
|
|
163
|
-
|
|
337
|
+
### mcData.version.version
|
|
164
338
|
|
|
165
|
-
|
|
339
|
+
The version number
|
|
166
340
|
|
|
167
|
-
|
|
341
|
+
Example:
|
|
168
342
|
|
|
169
|
-
|
|
343
|
+
```js
|
|
344
|
+
console.log(mcData.version.version) // 759
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
### mcData.version.minecraftVersion
|
|
170
348
|
|
|
171
|
-
|
|
349
|
+
The full Minecraft version
|
|
172
350
|
|
|
173
|
-
|
|
351
|
+
Example:
|
|
174
352
|
|
|
175
|
-
|
|
353
|
+
```js
|
|
354
|
+
console.log(mcData.version.minecraftVersion) // 1.19
|
|
355
|
+
```
|
|
176
356
|
|
|
177
|
-
###
|
|
357
|
+
### mcData.version.type
|
|
178
358
|
|
|
179
|
-
|
|
359
|
+
The version type, either `pc` or `bedrock`
|
|
180
360
|
|
|
181
|
-
|
|
182
|
-
Returns true if the current version is less than than the `other` version's dataVersion
|
|
361
|
+
Example:
|
|
183
362
|
|
|
184
|
-
|
|
185
|
-
|
|
363
|
+
```js
|
|
364
|
+
console.log(mcData.version.type) // pc
|
|
365
|
+
```
|
|
186
366
|
|
|
187
|
-
###
|
|
188
|
-
Returns true if the current version is equal to the `other` version's dataVersion
|
|
367
|
+
### mcData.version.majorVersion
|
|
189
368
|
|
|
190
|
-
|
|
369
|
+
The major Minecraft version
|
|
191
370
|
|
|
192
|
-
|
|
371
|
+
Example:
|
|
193
372
|
|
|
194
|
-
Example Usage:
|
|
195
373
|
```js
|
|
196
|
-
const
|
|
197
|
-
console.log('1.16.4 >= 1.17 ?', mcd.version['>=']('1.17')) // False
|
|
374
|
+
const mcData = MinecraftData('1.16.5')
|
|
198
375
|
|
|
199
|
-
|
|
200
|
-
|
|
376
|
+
console.log(mcData.version.majorVersion) // 1.16
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
### mcData.version.dataVersion
|
|
380
|
+
|
|
381
|
+
The "data version" for this Minecraft version, used for example when writing chunks to disk
|
|
382
|
+
|
|
383
|
+
Example:
|
|
384
|
+
|
|
385
|
+
```js
|
|
386
|
+
console.log(mcData.version.dataVersion) // 3105
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### mcData.version.[<](<version>), mcData.isOlderThan(<version>)
|
|
390
|
+
|
|
391
|
+
Returns `true` if the current version is less than than the other version's `dataVersion`, or else `false`
|
|
392
|
+
|
|
393
|
+
### mcData.version.[<=](<version>)
|
|
394
|
+
|
|
395
|
+
Same as above but also checks for an equivalent `dataVersion`
|
|
396
|
+
|
|
397
|
+
### mcData.version.[==](<version>)
|
|
398
|
+
|
|
399
|
+
Returns `true` if the current version is equal to the other version's `dataVersion`, or else `false`
|
|
400
|
+
|
|
401
|
+
### mcData.version.[>](<version>)
|
|
402
|
+
|
|
403
|
+
Returns `true` if the current version is greater than the other version's `dataVersion`, or else `false`
|
|
404
|
+
|
|
405
|
+
### mcData.version.[>=](<version>), mcData.isNewerOrEqualTo(<version>)
|
|
406
|
+
|
|
407
|
+
Same as above but also checks for an equivalent `dataVersion`
|
|
408
|
+
|
|
409
|
+
Example Usage:
|
|
410
|
+
|
|
411
|
+
```js
|
|
412
|
+
const mcData = MinecraftData('1.16.4')
|
|
413
|
+
console.log(mcData.version['>=']('1.17')) // Returns false, as 1.16.4 is older than 1.17
|
|
414
|
+
|
|
415
|
+
const mcData = MinecraftData('bedrock_1.17.0')
|
|
416
|
+
console.log(mcData.version['>']('1.16.220')) // Returns true, as 1.17.0 is newer than 1.16.220
|
|
201
417
|
```
|
|
202
418
|
|
|
203
419
|
## Effects
|
|
204
420
|
|
|
205
|
-
###
|
|
421
|
+
### mcData.effects
|
|
206
422
|
|
|
207
|
-
|
|
423
|
+
Effects indexed by id
|
|
208
424
|
|
|
209
|
-
|
|
425
|
+
Example:
|
|
210
426
|
|
|
211
|
-
|
|
427
|
+
```js
|
|
428
|
+
console.log(mcData.effects[5]) // Object containing information for "Strength"
|
|
429
|
+
```
|
|
212
430
|
|
|
213
|
-
###
|
|
431
|
+
### mcData.effectsByName
|
|
432
|
+
|
|
433
|
+
Effects indexed by name
|
|
434
|
+
|
|
435
|
+
Example:
|
|
436
|
+
|
|
437
|
+
```js
|
|
438
|
+
console.log(mcData.effectsByName['strength']) // Object containing information for "Strength"
|
|
439
|
+
```
|
|
214
440
|
|
|
215
|
-
|
|
441
|
+
### mcData.effectsArray
|
|
442
|
+
|
|
443
|
+
Array of effects
|
|
216
444
|
|
|
217
445
|
## Attributes
|
|
218
446
|
|
|
219
|
-
###
|
|
447
|
+
### mcData.attributes
|
|
448
|
+
|
|
449
|
+
Attributes indexed by resource name
|
|
450
|
+
|
|
451
|
+
Example:
|
|
452
|
+
|
|
453
|
+
```js
|
|
454
|
+
console.log(mcData.attributes['minecraft:generic.movement_speed']) // Object containing information for "minecraft:generic.movement_speed"
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
### mcData.attributesByName
|
|
220
458
|
|
|
221
|
-
|
|
459
|
+
Attributes indexed by name
|
|
222
460
|
|
|
223
|
-
|
|
461
|
+
Example:
|
|
224
462
|
|
|
225
|
-
|
|
463
|
+
```js
|
|
464
|
+
console.log(mcData.attributesByName['movementSpeed']) // Object containing information for "minecraft:generic.movement_speed"
|
|
465
|
+
```
|
|
226
466
|
|
|
227
|
-
###
|
|
467
|
+
### mcData.attributesArray
|
|
228
468
|
|
|
229
|
-
|
|
469
|
+
Array of attributes
|
|
230
470
|
|
|
231
471
|
## Particles
|
|
232
472
|
|
|
233
|
-
###
|
|
473
|
+
### mcData.particles
|
|
234
474
|
|
|
235
|
-
|
|
475
|
+
Particles indexed by id
|
|
236
476
|
|
|
237
|
-
|
|
477
|
+
Example:
|
|
478
|
+
|
|
479
|
+
```js
|
|
480
|
+
console.log(mcData.particles[12]) // Object containing information for "dripping_water"
|
|
481
|
+
```
|
|
238
482
|
|
|
239
|
-
|
|
483
|
+
### mcData.particlesByName
|
|
240
484
|
|
|
241
|
-
|
|
485
|
+
Particles indexed by name
|
|
242
486
|
|
|
243
|
-
|
|
487
|
+
Example:
|
|
488
|
+
|
|
489
|
+
```js
|
|
490
|
+
console.log(mcData.particlesByName['dripping_water']) // Object containing information for "dripping_water"
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
### mcData.particlesArray
|
|
494
|
+
|
|
495
|
+
Array of particles
|
|
244
496
|
|
|
245
497
|
## Commands
|
|
246
498
|
|
|
247
|
-
###
|
|
499
|
+
### mcData.commands
|
|
500
|
+
|
|
501
|
+
Commands and parsers
|
|
248
502
|
|
|
249
|
-
|
|
503
|
+
Example:
|
|
504
|
+
|
|
505
|
+
```js
|
|
506
|
+
const mcData = MinecraftData('1.13')
|
|
507
|
+
|
|
508
|
+
console.log(mcData.commands)
|
|
509
|
+
// Returns:
|
|
510
|
+
// {
|
|
511
|
+
// root: {
|
|
512
|
+
// type: 'root',
|
|
513
|
+
// name: 'root',
|
|
514
|
+
// executable: false,
|
|
515
|
+
// redirects: [],
|
|
516
|
+
// children: [ ... ]
|
|
517
|
+
// },
|
|
518
|
+
// parsers: [ ... ]
|
|
519
|
+
// }
|
|
520
|
+
```
|
|
250
521
|
|
|
251
522
|
## Loot
|
|
252
523
|
|
|
253
|
-
###
|
|
524
|
+
### mcData.entityLoot
|
|
525
|
+
|
|
526
|
+
Entity loot indexed by entity name
|
|
527
|
+
|
|
528
|
+
Example:
|
|
254
529
|
|
|
255
|
-
|
|
530
|
+
```js
|
|
531
|
+
console.log(mcData.entityLoot['zombie']) // Object containing loot information for "Zombie"
|
|
532
|
+
```
|
|
256
533
|
|
|
257
|
-
###
|
|
534
|
+
### mcData.entityLootArray
|
|
258
535
|
|
|
259
|
-
|
|
536
|
+
Array of entity loot
|
|
260
537
|
|
|
261
|
-
###
|
|
538
|
+
### mcData.blockLoot
|
|
262
539
|
|
|
263
|
-
|
|
540
|
+
Block loot indexed by block name
|
|
264
541
|
|
|
265
|
-
|
|
542
|
+
Example:
|
|
266
543
|
|
|
267
|
-
|
|
544
|
+
```js
|
|
545
|
+
console.log(mcData.blockLoot['diamond_ore']) // Object containing loot information for "Diamond Ore"
|
|
546
|
+
```
|
|
268
547
|
|
|
269
|
-
|
|
548
|
+
### mcData.blockLootArray
|
|
270
549
|
|
|
271
|
-
|
|
550
|
+
Array of block loot
|
|
272
551
|
|
|
273
|
-
|
|
552
|
+
## Map icons
|
|
274
553
|
|
|
275
|
-
###
|
|
554
|
+
### mcData.mapIcons
|
|
276
555
|
|
|
277
|
-
|
|
556
|
+
Map icons indexed by id
|
|
278
557
|
|
|
279
|
-
|
|
558
|
+
Example:
|
|
280
559
|
|
|
281
|
-
|
|
560
|
+
```js
|
|
561
|
+
console.log(mcData.mapIcons[20]) // Object containing map icon information for "banner_purple"
|
|
562
|
+
```
|
|
282
563
|
|
|
283
|
-
|
|
564
|
+
### mcData.mapIconsByName
|
|
284
565
|
|
|
285
|
-
|
|
566
|
+
Map icons indexed by name
|
|
286
567
|
|
|
287
|
-
|
|
568
|
+
Example:
|
|
288
569
|
|
|
289
|
-
|
|
570
|
+
```js
|
|
571
|
+
console.log(mcData.mapIconsByName['banner_purple']) // Object containing map icon information for "banner_purple"
|
|
572
|
+
```
|
|
290
573
|
|
|
291
|
-
|
|
574
|
+
### mcData.mapIconsArray
|
|
292
575
|
|
|
293
|
-
|
|
576
|
+
Array of map icons
|
|
294
577
|
|
|
295
|
-
|
|
578
|
+
### mcData.type
|
|
296
579
|
|
|
297
|
-
|
|
298
|
-
No need to specify a version before accessing them. They are indexed by pc and pe.
|
|
580
|
+
The type of the current version, either `pc` or `bedrock`
|
|
299
581
|
|
|
300
|
-
###
|
|
582
|
+
### minecraftData.language
|
|
301
583
|
|
|
302
|
-
|
|
584
|
+
Object containing `en_US` language conversions
|
|
303
585
|
|
|
304
|
-
|
|
586
|
+
Example:
|
|
305
587
|
|
|
306
|
-
|
|
588
|
+
```js
|
|
589
|
+
console.log(mcData.language['argument.player.unknown'])
|
|
590
|
+
// Returns: 'That player does not exist'
|
|
591
|
+
```
|
|
307
592
|
|
|
308
|
-
###
|
|
593
|
+
### minecraftData.loginPacket
|
|
309
594
|
|
|
310
|
-
|
|
595
|
+
Login packet example
|
|
311
596
|
|
|
312
|
-
###
|
|
597
|
+
### mcData.supportFeature(<feature>)
|
|
313
598
|
|
|
314
|
-
|
|
599
|
+
This can be used to check if a specific feature is available in the current Minecraft version. This is usually only used for handling version-specific functionality.
|
|
315
600
|
|
|
316
|
-
|
|
601
|
+
Example:
|
|
317
602
|
|
|
318
|
-
|
|
603
|
+
```js
|
|
604
|
+
const mcData = minecraftData('1.18.2')
|
|
319
605
|
|
|
320
|
-
|
|
606
|
+
console.log(mcData.supportFeature('blockStateId')) // Returns: true
|
|
607
|
+
```
|
|
321
608
|
|
|
322
|
-
|
|
609
|
+
## Tints
|
|
323
610
|
|
|
324
|
-
###
|
|
611
|
+
### mcData.tints
|
|
325
612
|
|
|
326
|
-
|
|
613
|
+
Tints indexed by the tint type (`grass`, `foliage`, `water`, `redstone`, `constant`)
|
|
327
614
|
|
|
328
|
-
|
|
615
|
+
## Protocol versions
|
|
329
616
|
|
|
330
|
-
|
|
617
|
+
These are common data and directly available in the `minecraftData` object.
|
|
618
|
+
No need to specify a version before accessing them.
|
|
331
619
|
|
|
332
|
-
|
|
620
|
+
### minecraftData.versions
|
|
333
621
|
|
|
334
|
-
|
|
622
|
+
Array of all Minecraft versions (separated into `pc` (java) and `bedrock`)
|
|
335
623
|
|
|
336
|
-
###
|
|
624
|
+
### minecraftData.versionsByMinecraftVersion
|
|
337
625
|
|
|
338
|
-
|
|
626
|
+
All versions indexed by Minecraft version (separated into `pc` (java) and `bedrock`)
|
|
339
627
|
|
|
340
|
-
###
|
|
628
|
+
### minecraftData.preNettyVersionsByProtocolVersion
|
|
341
629
|
|
|
342
|
-
|
|
630
|
+
Pre-netty Minecraft versions indexed by protocol version (separated into `pc` (java) and `bedrock`)
|
|
343
631
|
|
|
344
|
-
###
|
|
632
|
+
### minecraftData.postNettyVersionsByProtocolVersion
|
|
345
633
|
|
|
346
|
-
|
|
634
|
+
Post netty minecraft versions indexed by protocol version (separated into `pc` (java) and `bedrock`)
|
|
347
635
|
|
|
348
|
-
###
|
|
636
|
+
### minecraftData.supportedVersions
|
|
349
637
|
|
|
350
|
-
|
|
638
|
+
Array of supported versions (separated into `pc` (java) and `bedrock`)
|
|
351
639
|
|
|
352
|
-
###
|
|
640
|
+
### minecraftData.legacy.pc.blocks
|
|
353
641
|
|
|
354
|
-
|
|
642
|
+
Mapping from 1.12 block:metadata to 1.13 block names
|
|
355
643
|
|
|
356
|
-
|
|
644
|
+
Example:
|
|
357
645
|
|
|
358
|
-
|
|
646
|
+
```js
|
|
647
|
+
console.log(mcData.legacy.pc.blocks['171:15']) // Returns: 'minecraft:black_carpet'
|
|
648
|
+
```
|
|
649
|
+
|
|
650
|
+
## Schemas
|
|
359
651
|
|
|
360
|
-
|
|
652
|
+
These are common data and directly available in the `minecraftData` object.
|
|
653
|
+
No need to specify a version before accessing them.
|
|
361
654
|
|
|
362
|
-
|
|
655
|
+
Available schemas:
|
|
363
656
|
|
|
364
|
-
|
|
657
|
+
`biomes`, `blocks`, `blockLoot`, `effects`, `entities`, `entityLoot`, `instruments`, `items`, `materials`, `particles`, `protocol`, `protocolVersions`, `recipes`, `version`, `windows`
|