Coder Social home page Coder Social logo

nixinova / minecraft-versions Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 2.0 157 KB

A complete list of all Minecraft versions and metadata; Java and Bedrock, release and snapshot.

License: Other

TypeScript 63.09% JavaScript 36.91%
minecraft minecraft-versions minecraft-data versions minecraft-java nixinova data version-history

minecraft-versions's Introduction

Latest version Last updated npm downloads

Minecraft Versions

A complete list of all Minecraft versions and their metadata, for Java and Bedrock, releases and snapshots.

Install

Minecraft-Versions is available on npm.

Install locally using npm install [email protected] to use in a Node project.

Install globally using npm install -g [email protected] to use the CLI.

Usage

Node:

const versionData = require('minecraft-vers') // old import syntax
/*or*/
import versionData from 'minecraft-vers' // modern import syntax

Command-line:

mcdata [--full] <edition> <phase> [<version>] [<index>] [<param>]

Output format

{
  "<edition>": { // Java | Bedrock | ...
    "<phase>":  { // Release | Beta | ....
      "<version>": [ // 1.17 | 1.16.5-rc1 | ...
        {
          "name": "<in-game name>",
          "type": "release|snapshot",
          "parent": "null|<parent>|{phase:<phase>,version:<parent>}", // null | '1.16.3' | {phase: Release, version: 1.0.0} | ...
          "date": "<timestamp>",
        }
      ]
    }
  }
}

Examples

Command-line:

$ mcdata Java Beta 1.8
[{ "name": "Beta 1.8", "type": "release", "parent": null, "date": 2011-09-14 }]

Node:

const versionData = require('minecraft-vers')

console.log(versionData.Java.Release['1.17'])
// [{ "name": "1.17", "type": "release", "parent": null, "date": 2021-06-08 }]

console.log(versionData.Java.Beta['1.8-pre1'][0])
// { "name": "Beta 1.8 Pre-release", "type": "snapshot", "parent": "Beta 1.8", "date": 2011-09-08 }

console.log(versionData.Java.Release['1.6.3'][1].type)
// "snapshot"

Data source

Omniarchive index, excluding speculative (yellow-shaded) versions.

Contributing

Version information is stored in the data folder.

Use node script/add to add an entry to the files.

License

This data is released into the public domain and can be used for any purpose.

minecraft-versions's People

Contributors

mbledkowski avatar nixinova avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

minecraft-versions's Issues

Crash when edition or phase is spelt incorrectly

When the version number is specified, the typo checking doesn't get applied, causing a crash

C:\Users\Nixinova\Documents\GitHub>mcdata jav
Invalid input. Type 'mcdata --help' for help.

C:\Users\Nixinova\Documents\GitHub>mcdata java relesae
Invalid input. Type 'mcdata --help' for help.

C:\Users\Nixinova\Documents\GitHub>mcdata java relesae 1.17.2
C:\Users\Nixinova\AppData\Roaming\npm\node_modules\minecraft-vers\dist\cli.js:20
    versionList = versionTable[version];
                              ^

TypeError: Cannot read properties of undefined (reading '1.17.2')
    at getData (C:\Users\Nixinova\AppData\Roaming\npm\node_modules\minecraft-vers\dist\cli.js:20:31)
    at Object.<anonymous> (C:\Users\Nixinova\AppData\Roaming\npm\node_modules\minecraft-vers\dist\cli.js:89:5)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (C:\Users\Nixinova\AppData\Roaming\npm\node_modules\minecraft-vers\bin\index.js:2:1)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.