Returns the pack_format of any Minecraft version, including snapshots
npm install pack-format


pack_format of any Minecraft version, including snapshots.
pack_format is a version number used by Minecraft in both resource packs and data packs for labeling compatible versions.
undefined.
npm install pack-format to use for a Node.js project, or npm install -g pack-format to use from the command line.
pack_format of a given Minecraft version, optionally specifying whether the resource (default) or data pack version should be returned.
js
const packFormat = require('pack-format')
packFormat('1.14.4') // 4
packFormat('1.16.2-pre1', 'resource') // 5
packFormat('20w45a', 'data') // 6
packFormat.LATEST.data // 83.1
packFormat.LATEST.version // 1.21.8
`
Retrieve a list of versions corresponding to a specific pack_format, again optionally specifying resource/data pack version.
`js
const {getVersions} = require('pack-format')
getVersions(3) // { releases: { min: '1.11.x', max: '1.12.x' }, snapshots: { min: '16w32a', max: '17w47a' } }
getVersions(6, 'data') // { releases: { min: '1.15.x', max: '1.16.1' }, snapshots: { min: '20w06a', max: '20w44a' } }
getVersions(64, 'resource') // { releases: { min: '1.21.7', max: '1.21.8' }, snapshots: { min: null, max: null } }
`
$3
Retrieve both the resource and data pack_format of a given Minecraft version:
`console
pack-format [--data|--resource]
`
Retrieve a list of corresponding Minecraft versions:
`console
pack-format --list [--data|--resource]
`
Examples:
`console
> pack-format 1.14.4
Resource pack format of 1.14.4 is 4
Data pack format of 1.14.4 is 4
> pack-format --resource 1.16.2-pre1
Resource pack format of 1.16.2-pre1 is 5
> pack-format --data 20w45a
Data pack format of 20w45a is 6
> pack-format --list --resource 3
A resource pack format of 3 is used for 1.11–1.12.2 (16w32a–17w47a)
``