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.
Files changed (54) hide show
  1. package/.github/workflows/ci.yml +1 -6
  2. package/.github/workflows/md-release.yml +5 -4
  3. package/.github/workflows/npm-publish.yml +1 -2
  4. package/.github/workflows/trigger.yml +2 -2
  5. package/README.md +14 -15
  6. package/data.js +22 -1
  7. package/doc/api.md +460 -167
  8. package/doc/history.md +410 -176
  9. package/index.d.ts +152 -125
  10. package/lib/indexes.js +0 -2
  11. package/lib/loader.js +1 -2
  12. package/minecraft-data/README.md +1 -1
  13. package/minecraft-data/data/bedrock/1.16.201/proto.yml +1 -1
  14. package/minecraft-data/data/bedrock/1.16.201/protocol.json +1 -1
  15. package/minecraft-data/data/bedrock/1.16.210/proto.yml +1 -1
  16. package/minecraft-data/data/bedrock/1.16.210/protocol.json +1 -1
  17. package/minecraft-data/data/bedrock/1.16.220/proto.yml +1 -1
  18. package/minecraft-data/data/bedrock/1.16.220/protocol.json +1 -1
  19. package/minecraft-data/data/bedrock/1.17.0/proto.yml +1 -1
  20. package/minecraft-data/data/bedrock/1.17.0/protocol.json +1 -1
  21. package/minecraft-data/data/bedrock/1.17.10/proto.yml +1 -1
  22. package/minecraft-data/data/bedrock/1.17.10/protocol.json +1 -1
  23. package/minecraft-data/data/bedrock/1.17.30/proto.yml +1 -1
  24. package/minecraft-data/data/bedrock/1.17.30/protocol.json +1 -1
  25. package/minecraft-data/data/bedrock/1.17.40/proto.yml +1 -1
  26. package/minecraft-data/data/bedrock/1.17.40/protocol.json +1 -1
  27. package/minecraft-data/data/bedrock/1.18.0/proto.yml +1 -1
  28. package/minecraft-data/data/bedrock/1.18.0/protocol.json +1 -1
  29. package/minecraft-data/data/bedrock/1.18.11/proto.yml +1 -1
  30. package/minecraft-data/data/bedrock/1.18.11/protocol.json +1 -1
  31. package/minecraft-data/data/bedrock/1.18.30/proto.yml +1 -1
  32. package/minecraft-data/data/bedrock/1.18.30/protocol.json +1 -1
  33. package/minecraft-data/data/bedrock/1.19.1/proto.yml +1 -1
  34. package/minecraft-data/data/bedrock/1.19.1/protocol.json +1 -1
  35. package/minecraft-data/data/bedrock/1.19.10/proto.yml +3680 -0
  36. package/minecraft-data/data/bedrock/1.19.10/protocol.json +1 -1
  37. package/minecraft-data/data/bedrock/1.19.10/types.yml +1955 -0
  38. package/minecraft-data/data/bedrock/1.19.20/protocol.json +10644 -0
  39. package/minecraft-data/data/bedrock/1.19.20/version.json +6 -0
  40. package/minecraft-data/data/bedrock/common/protocolVersions.json +6 -0
  41. package/minecraft-data/data/bedrock/common/versions.json +2 -1
  42. package/minecraft-data/data/bedrock/latest/proto.yml +55 -7
  43. package/minecraft-data/data/bedrock/latest/types.yml +7 -0
  44. package/minecraft-data/data/dataPaths.json +22 -1
  45. package/minecraft-data/data/pc/1.19/protocol.json +1 -5
  46. package/minecraft-data/data/pc/1.7/protocol.json +1 -1
  47. package/minecraft-data/data/pc/1.8/protocol.json +1 -1
  48. package/minecraft-data/data/pc/15w40b/protocol.json +1 -1
  49. package/minecraft-data/data/pc/common/protocolVersions.json +35 -0
  50. package/minecraft-data/doc/history.md +14 -0
  51. package/package.json +1 -1
  52. package/typings/generate-typings.js +22 -14
  53. package/typings/index-template.d.ts +160 -133
  54. 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
- ### minecraft-data.blocks
23
+ ### mcData.blocks
24
+
25
+ Blocks indexed by id
6
26
 
7
- blocks indexed by id
27
+ Example:
8
28
 
9
- ### minecraft-data.blocksByName
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
- blocks indexed by name
45
+ Array of blocks
12
46
 
13
- ### minecraft-data.blocksArray
47
+ ### mcData.blocksByStateId
14
48
 
15
- unindexed blocks
49
+ Blocks indexed by state id
16
50
 
17
- ### minecraft-data.blocksByStateId
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
- blocks indexed by state id
57
+ ### mcData.blockStates
20
58
 
21
- ### minecraft-data.blockCollisionShapes
59
+ **_Bedrock edition only_**
22
60
 
23
- block collision shapes
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
- ### minecraft-data.items
85
+ ### mcData.items
28
86
 
29
- items indexed by id
87
+ Items indexed by id
30
88
 
31
- ### minecraft-data.itemsByName
89
+ Example:
32
90
 
33
- items indexed by name
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
- ### minecraft-data.itemsArray
99
+ Example:
100
+
101
+ ```js
102
+ console.log(mcData.itemsByName['wheat']) // Object containing information for "Wheat"
103
+ ```
36
104
 
37
- unindexed items
105
+ ### mcData.itemsArray
106
+
107
+ Array of items
38
108
 
39
109
  ## Foods
40
110
 
41
- ### minecraft-data.foods
111
+ ### mcData.foods
42
112
 
43
- foods indexed by id
113
+ Foods indexed by id
44
114
 
45
- ### minecraft-data.foodsByName
115
+ Example:
46
116
 
47
- foods indexed by name
117
+ ```js
118
+ console.log(mcData.foods[1003]) // Object containing information for "Pumpkin Pie"
119
+ ```
48
120
 
49
- ### minecraft-data.foodsByFoodPoints
121
+ ### mcData.foodsByName
50
122
 
51
- foods indexed by food points
123
+ Foods indexed by name
52
124
 
53
- ### minecraft-data.foodsBySaturation
125
+ Example:
54
126
 
55
- foods indexed by saturation
127
+ ```js
128
+ console.log(mcData.foodsByName['pumpkin_pie']) // Object containing information for "Pumpkin Pie"
129
+ ```
56
130
 
57
- ### minecraft-data.foodsArray
131
+ ### mcData.foodsArray
58
132
 
59
- unindexed foods
133
+ Array of foods
60
134
 
61
135
  ## Biomes
62
136
 
63
- ### minecraft-data.biomes
137
+ ### mcData.biomes
64
138
 
65
- biomes indexed by id
139
+ Biomes indexed by id
66
140
 
67
- ### minecraft-data.biomesArray
141
+ Example:
68
142
 
69
- unindexed biomes
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
- ### minecraft-data.biomesByName
157
+ ### mcData.biomesArray
72
158
 
73
- biomes object indexed by name
159
+ Array of biomes
74
160
 
75
161
  ## Recipes
76
162
 
77
- ### minecraft-data.recipes
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
- recipes indexed by id
178
+ // Note: 1100 is the block ID of "Pointed Dripstone"
179
+ ```
80
180
 
81
181
  ## Instruments
82
182
 
83
- ### minecraft-data.instruments
183
+ ### mcData.instruments
184
+
185
+ Instruments indexed by id
84
186
 
85
- instruments indexed by id
187
+ Example:
188
+
189
+ ```js
190
+ console.log(mcData.instruments[5])
191
+ // Returns: { id: 5, name: 'flute' }
192
+ ```
86
193
 
87
- ### minecraft-data.instrumentsArray
194
+ ### mcData.instrumentsArray
88
195
 
89
- unindexed instruments
196
+ Array of instruments
90
197
 
91
198
  ## Materials
92
199
 
93
- ### minecraft-data.materials
200
+ ### mcData.materials
94
201
 
95
- materials indexed by name
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
- ### minecraft-data.mobs
213
+ ### mcData.mobs
100
214
 
101
- mobs indexed by id
215
+ Mobs (passive, neutral, and hostile) indexed by id
102
216
 
103
- ### minecraft-data.objects
217
+ Example:
104
218
 
105
- objects indexed by id
219
+ ```js
220
+ console.log(mcData.mobs[30]) // Object containing information for "Ghast"
221
+ ```
106
222
 
107
- ### minecraft-data.entitiesByName
223
+ ### mcData.objects
108
224
 
109
- entities indexed by name
225
+ Objects (non-mob entities such as vehicles and projectiles) indexed by id
110
226
 
111
- ### minecraft-data.entitiesArray
227
+ Example:
112
228
 
113
- unindexed entities
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
- ### minecraft-data.enchantments
261
+ ### mcData.enchantments
118
262
 
119
- enchantments indexed by id
263
+ Enchantments indexed by id
120
264
 
121
- ### minecraft-data.enchantmentsByName
265
+ Example:
122
266
 
123
- enchantments indexed by name
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
- ### minecraft-data.enchantmentsArray
275
+ Example:
126
276
 
127
- unindexed enchantments
277
+ ```js
278
+ console.log(mcData.enchantmentsByName['mending']) // Object containing information for "Mending"
279
+ ```
128
280
 
129
- ### minecraft-data.defaultSkin
281
+ ### mcData.enchantmentsArray
130
282
 
131
- (bedrock edition) Skin geometry and texture data for default player skin
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
- ### minecraft-data.protocol
293
+ ### mcData.protocol
294
+
295
+ The Minecraft protocol
296
+
297
+ ### mcData.protocolComments
298
+
299
+ The Minecraft protocol comments
136
300
 
137
- the minecraft protocol
301
+ ### mcData.protocolYaml
138
302
 
303
+ **_Bedrock edition only_**
139
304
 
140
- ### minecraft-data.protocolComments
305
+ The url to the files of the protocol yaml
141
306
 
142
- the minecraft protocol comments
307
+ ## Windows (GUIs)
143
308
 
144
- ## Windows
309
+ ### mcData.windows
145
310
 
146
- ### minecraft-data.windows
311
+ Windows indexed by id
147
312
 
148
- windows indexed by id
313
+ Example:
149
314
 
150
- ### minecraft-data.windowsByName
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
- windows indexed by name
321
+ Windows indexed by name
153
322
 
154
- ### minecraft-data.windowsArray
323
+ Example:
324
+
325
+ ```js
326
+ console.log(mcData.windowsByName['NPC Trade']) // Object containing window information for the villager GUI
327
+ ```
155
328
 
156
- unindexed windows
329
+ ### mcData.windowsArray
157
330
 
331
+ Array of windows
158
332
 
159
333
  ## Version
160
334
 
161
- ### minecraft-data.version.version
335
+ For version comparison, the other version must be of the same type, and the prefix is always implied
162
336
 
163
- the version number (example : 47)
337
+ ### mcData.version.version
164
338
 
165
- ### minecraft-data.version.minecraftVersion
339
+ The version number
166
340
 
167
- the minecraft number (example : 1.8.3)
341
+ Example:
168
342
 
169
- ### minecraft-data.version.type
343
+ ```js
344
+ console.log(mcData.version.version) // 759
345
+ ```
346
+
347
+ ### mcData.version.minecraftVersion
170
348
 
171
- the version type, currently 'pc' or 'bedrock'
349
+ The full Minecraft version
172
350
 
173
- ### minecraft-data.version.majorVersion
351
+ Example:
174
352
 
175
- the major version (example : 1.8), also the name of the minecraft-data version
353
+ ```js
354
+ console.log(mcData.version.minecraftVersion) // 1.19
355
+ ```
176
356
 
177
- ### minecraft-data.version.dataVersion
357
+ ### mcData.version.type
178
358
 
179
- "Data version" for this Minecraft version, used for example when writing chunks to disk
359
+ The version type, either `pc` or `bedrock`
180
360
 
181
- ### minecraft-data.version.< (other)
182
- Returns true if the current version is less than than the `other` version's dataVersion
361
+ Example:
183
362
 
184
- ### minecraft-data.version.> (other)
185
- Returns true if the current version is greater than the `other` version's dataVersion
363
+ ```js
364
+ console.log(mcData.version.type) // pc
365
+ ```
186
366
 
187
- ### minecraft-data.version.== (other)
188
- Returns true if the current version is equal to the `other` version's dataVersion
367
+ ### mcData.version.majorVersion
189
368
 
190
- ### minecraft-data.version.>=, minecraft-data.version.<=
369
+ The major Minecraft version
191
370
 
192
- Same as above but also allows equal dataVersion. The other version must be of the same type, the prefix is always implied.
371
+ Example:
193
372
 
194
- Example Usage:
195
373
  ```js
196
- const mcd = require('minecraft-data')('1.16.4')
197
- console.log('1.16.4 >= 1.17 ?', mcd.version['>=']('1.17')) // False
374
+ const mcData = MinecraftData('1.16.5')
198
375
 
199
- const mcd = require('minecraft-data')('bedrock_1.17.0')
200
- console.log('1.17.0 > 1.16.220 ?', mcd.version['>']('1.16.220')) // True
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
- ### minecraft-data.effects
421
+ ### mcData.effects
206
422
 
207
- effects indexed by id
423
+ Effects indexed by id
208
424
 
209
- ### minecraft-data.effectsByName
425
+ Example:
210
426
 
211
- effects indexed by name
427
+ ```js
428
+ console.log(mcData.effects[5]) // Object containing information for "Strength"
429
+ ```
212
430
 
213
- ### minecraft-data.effectsArray
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
- unindexed effects
441
+ ### mcData.effectsArray
442
+
443
+ Array of effects
216
444
 
217
445
  ## Attributes
218
446
 
219
- ### minecraft-data.attributes
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
- attributes indexed by resource name (generic.movementSpeed || minecraft:generic.movement_speed)
459
+ Attributes indexed by name
222
460
 
223
- ### minecraft-data.attributesByName
461
+ Example:
224
462
 
225
- attributes indexed by minecraft-data name (movementSpeed)
463
+ ```js
464
+ console.log(mcData.attributesByName['movementSpeed']) // Object containing information for "minecraft:generic.movement_speed"
465
+ ```
226
466
 
227
- ### minecraft-data.attributesArray
467
+ ### mcData.attributesArray
228
468
 
229
- unindexed attributes
469
+ Array of attributes
230
470
 
231
471
  ## Particles
232
472
 
233
- ### minecraft-data.particles
473
+ ### mcData.particles
234
474
 
235
- particles indexed by id
475
+ Particles indexed by id
236
476
 
237
- ### minecraft-data.particlesByName
477
+ Example:
478
+
479
+ ```js
480
+ console.log(mcData.particles[12]) // Object containing information for "dripping_water"
481
+ ```
238
482
 
239
- particles indexed by name
483
+ ### mcData.particlesByName
240
484
 
241
- ### minecraft-data.particlesArray
485
+ Particles indexed by name
242
486
 
243
- unindexed particles
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
- ### minecraft-data.commands
499
+ ### mcData.commands
500
+
501
+ Commands and parsers
248
502
 
249
- Command tree
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
- ### minecraft-data.entityLoot
524
+ ### mcData.entityLoot
525
+
526
+ Entity loot indexed by entity name
527
+
528
+ Example:
254
529
 
255
- entity loot indexed by name
530
+ ```js
531
+ console.log(mcData.entityLoot['zombie']) // Object containing loot information for "Zombie"
532
+ ```
256
533
 
257
- ### minecraft-data.entityLootArray
534
+ ### mcData.entityLootArray
258
535
 
259
- unindexed entity loot
536
+ Array of entity loot
260
537
 
261
- ### minecraft-data.blockLoot
538
+ ### mcData.blockLoot
262
539
 
263
- block loot indexed by name
540
+ Block loot indexed by block name
264
541
 
265
- ### minecraft-data.blockLootArray
542
+ Example:
266
543
 
267
- unindexed block loot
544
+ ```js
545
+ console.log(mcData.blockLoot['diamond_ore']) // Object containing loot information for "Diamond Ore"
546
+ ```
268
547
 
269
- ## Map icons
548
+ ### mcData.blockLootArray
270
549
 
271
- ### minecraft-data.mapIcons
550
+ Array of block loot
272
551
 
273
- mapIcons indexed by id
552
+ ## Map icons
274
553
 
275
- ### minecraft-data.mapIconsByName
554
+ ### mcData.mapIcons
276
555
 
277
- mapIcons indexed by name
556
+ Map icons indexed by id
278
557
 
279
- ### minecraft-data.mapIconsArray
558
+ Example:
280
559
 
281
- unindexed mapIcons
560
+ ```js
561
+ console.log(mcData.mapIcons[20]) // Object containing map icon information for "banner_purple"
562
+ ```
282
563
 
283
- ## type
564
+ ### mcData.mapIconsByName
284
565
 
285
- pe or pc
566
+ Map icons indexed by name
286
567
 
287
- ## minecraft-data.language
568
+ Example:
288
569
 
289
- object from language key to string
570
+ ```js
571
+ console.log(mcData.mapIconsByName['banner_purple']) // Object containing map icon information for "banner_purple"
572
+ ```
290
573
 
291
- ## minecraft-data.loginPacket
574
+ ### mcData.mapIconsArray
292
575
 
293
- example of login packet
576
+ Array of map icons
294
577
 
295
- ## Protocol versions
578
+ ### mcData.type
296
579
 
297
- Those are common data and directly available in the `require('minecraft-data')` object.
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
- ### minecraft-data.versions
582
+ ### minecraftData.language
301
583
 
302
- unindexed minecraft versions
584
+ Object containing `en_US` language conversions
303
585
 
304
- ### minecraft-data.versionsByMinecraftVersion
586
+ Example:
305
587
 
306
- minecraft versions indexed by minecraft version (example : 1.8.8)
588
+ ```js
589
+ console.log(mcData.language['argument.player.unknown'])
590
+ // Returns: 'That player does not exist'
591
+ ```
307
592
 
308
- ### minecraft-data.preNettyVersionsByProtocolVersion
593
+ ### minecraftData.loginPacket
309
594
 
310
- pre netty minecraft versions indexed by protocol version (example : 47)
595
+ Login packet example
311
596
 
312
- ### minecraft-data.postNettyVersionsByProtocolVersion
597
+ ### mcData.supportFeature(<feature>)
313
598
 
314
- post netty minecraft versions indexed by protocol version (example : 47)
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
- ### minecraft-data.supportedVersions.pc
601
+ Example:
317
602
 
318
- Array of pc supported versions
603
+ ```js
604
+ const mcData = minecraftData('1.18.2')
319
605
 
320
- ### minecraft-data.supportedVersions.pe
606
+ console.log(mcData.supportFeature('blockStateId')) // Returns: true
607
+ ```
321
608
 
322
- Array of pe supported versions
609
+ ## Tints
323
610
 
324
- ### minecraft-data.legacy.pc.blocks
611
+ ### mcData.tints
325
612
 
326
- Mapping from 1.12 block:metadata to 1.13 block names
613
+ Tints indexed by the tint type (`grass`, `foliage`, `water`, `redstone`, `constant`)
327
614
 
328
- examples 0:0 -> minecraft:air
615
+ ## Protocol versions
329
616
 
330
- ### minecraft-data.supportFeature(featureName) : Boolean
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
- This can be used to check is a specific feature is available in the current Minecraft version. This is usually only required for handling version-specific functionality.
620
+ ### minecraftData.versions
333
621
 
334
- ## Schemas
622
+ Array of all Minecraft versions (separated into `pc` (java) and `bedrock`)
335
623
 
336
- ### minecraft-data.schemas.biomes
624
+ ### minecraftData.versionsByMinecraftVersion
337
625
 
338
- ### minecraft-data.schemas.blocks
626
+ All versions indexed by Minecraft version (separated into `pc` (java) and `bedrock`)
339
627
 
340
- ### minecraft-data.schemas.blockLoot
628
+ ### minecraftData.preNettyVersionsByProtocolVersion
341
629
 
342
- ### minecraft-data.schemas.effects
630
+ Pre-netty Minecraft versions indexed by protocol version (separated into `pc` (java) and `bedrock`)
343
631
 
344
- ### minecraft-data.schemas.entities
632
+ ### minecraftData.postNettyVersionsByProtocolVersion
345
633
 
346
- ### minecraft-data.schemas.entityLoot
634
+ Post netty minecraft versions indexed by protocol version (separated into `pc` (java) and `bedrock`)
347
635
 
348
- ### minecraft-data.schemas.instruments
636
+ ### minecraftData.supportedVersions
349
637
 
350
- ### minecraft-data.schemas.items
638
+ Array of supported versions (separated into `pc` (java) and `bedrock`)
351
639
 
352
- ### minecraft-data.schemas.materials
640
+ ### minecraftData.legacy.pc.blocks
353
641
 
354
- ### minecraft-data.schemas.particles
642
+ Mapping from 1.12 block:metadata to 1.13 block names
355
643
 
356
- ### minecraft-data.schemas.protocol
644
+ Example:
357
645
 
358
- ### minecraft-data.schemas.protocolVersions
646
+ ```js
647
+ console.log(mcData.legacy.pc.blocks['171:15']) // Returns: 'minecraft:black_carpet'
648
+ ```
649
+
650
+ ## Schemas
359
651
 
360
- ### minecraft-data.schemas.recipes
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
- ### minecraft-data.schemas.version
655
+ Available schemas:
363
656
 
364
- ### minecraft-data.schemas.windows
657
+ `biomes`, `blocks`, `blockLoot`, `effects`, `entities`, `entityLoot`, `instruments`, `items`, `materials`, `particles`, `protocol`, `protocolVersions`, `recipes`, `version`, `windows`