mirror of
https://github.com/barkeser2002/node-minecraft-data.git
synced 2026-09-25 05:49:57 +03:00
test/version-comparison-fix
This commit introduces a new test file `test/version_compare.js` to specifically test the version comparison logic, particularly for scenarios involving versions with and without `dataVersion`. The test case covers the issue described in #399, ensuring that comparisons like `version['<=']('1.7.10')` and `version['<']('1.8')` work correctly for version 1.7.10.
node-minecraft-data
node-minecraft-data provides easy access to minecraft-data in node.js.
The objective of this module is to make easier to look for information in minecraft-data in node.
Features
This package allows the lookup of blocks, items, entities, etc. by name, id, etc., and for the easy lookup of other data.
Example
const minecraftData = require('minecraft-data')
// or for es6: import minecraftData from 'minecraft-data';
const mcData = minecraftData('1.19')
console.log(mcData.blocksByName['stone']) // Information for "Stone"
console.log(mcData.windows['minecraft:brewing_stand']) // Information for the "Brewing Stand" GUI
console.log(mcData.version) // Information about the current version
console.log(mcData.effectsByName['Haste']) // Information for the "Haste" effect
Documentation
- See doc/api.md
- See doc/history.md
Languages
JavaScript
94.3%
TypeScript
5.7%