{"name":"prismarine-registry","version":"1.12.0","description":"Prismarine Registry","main":"lib/index.js","scripts":{"test":"mocha --reporter spec --bail --exit","pretest":"npm run lint","lint":"standard","fix":"standard --fix"},"repository":{"type":"git","url":"git+https://github.com/PrismarineJS/prismarine-registry.git"},"keywords":["prismarine","template"],"author":{"name":"Romain Beaumont"},"license":"MIT","bugs":{"url":"https://github.com/PrismarineJS/prismarine-registry/issues"},"homepage":"https://github.com/PrismarineJS/prismarine-registry#readme","devDependencies":{"bedrock-protocol":"^3.22.0","debug":"^4.3.3","minecraft-bedrock-server":"^1.1.2","minecraft-protocol":"^1.30.0","minecraft-wrap":"^1.4.0","mocha":"^11.0.1","prismarine-registry":"file:.","standard":"^17.0.0"},"dependencies":{"minecraft-data":"^3.70.0","prismarine-block":"^1.17.1","prismarine-nbt":"^2.0.0"},"gitHead":"e4a2a9f2a9696939bff7d4ca4f7ffef5c1bb1c94","types":"./lib/index.d.ts","_id":"prismarine-registry@1.12.0","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-OC5U6YrflY6OcAWRZEqe2HGZuNp0bIuP7H+oKEHD6rLfKNDxo8Ymx5eh2VvrZWnMVugpwID1Qj/UjA4MoCzNDw==","shasum":"b6cfede995fe7bd088ef6ec1e30620cf1998ccfa","tarball":"http://registry-npm.ywwl.com/prismarine-registry/download/prismarine-registry-1.12.0.tgz","fileCount":28,"unpackedSize":29892,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/prismarine-registry@1.12.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDC4w5eKqbDUlusQMTosy1RrA/EWgOq/F4BaqMaDygqaQIhAPkIbRvRrUWBDR6tD0BN7dSKu+YMtmEOqSdzBSfX+Qlz"}],"size":10109,"noattachment":false,"key":"/prismarine-registry/-/prismarine-registry-1.12.0.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e00dedcf-6b0f-47d8-bd4b-d223917040d8"}},"directories":{},"maintainers":[{"name":"rom1504","email":"romain.rom1@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/prismarine-registry_1.12.0_1774833541444_0.6974338358281005"},"_hasShrinkwrap":false,"readme":"# prismarine-registry\n[![NPM version](https://img.shields.io/npm/v/prismarine-registry.svg)](http://npmjs.com/package/prismarine-registry)\n[![Build Status](https://github.com/PrismarineJS/prismarine-registry/workflows/CI/badge.svg)](https://github.com/PrismarineJS/prismarine-registry/actions?query=workflow%3A%22CI%22)\n[![Discord](https://img.shields.io/badge/chat-on%20discord-brightgreen.svg)](https://discord.gg/GsEFRM8)\n[![Try it on gitpod](https://img.shields.io/badge/try-on%20gitpod-brightgreen.svg)](https://gitpod.io/#https://github.com/PrismarineJS/prismarine-registry)\n\nCreates an dynamic instance of node-minecraft-data.\n\n## Usage\n\n```js\nconst registry = require('prismarine-registry')('1.18')\n\nregistry.blocksByName['stone'] // See information about stone\n```\n\n## API\n\n[See minecraft-data API](https://github.com/PrismarineJS/node-minecraft-data/blob/master/doc/api.md)\n\n### mcpc\n\n#### loadDimensionCodec / writeDimensionCodec\n\n* loads/writes data from dimension codec in login packet\n\n#### .chatFormattingByName, .chatFormattingById (1.19+)\n\nContains mapping from chat type ID (numeric or string) to information about how the \nchat type should be formatted and what the relevant parameters are.\n\n```js\n{\n  'minecraft:chat': { formatString: '<%s> %s', parameters: [ 'sender', 'content' ] },\n  'minecraft:say_command': { formatString: '[%s] %s', parameters: [ 'sender', 'content' ] },\n  'minecraft:msg_command': { formatString: '%s whispers to you: %s', parameters: [ 'sender', 'content' ] },\n  'minecraft:team_msg_command': { formatString: '%s <%s> %s', parameters: [ 'team_name', 'sender', 'content' ] },\n  'minecraft:emote_command': { formatString: '* %s %s', parameters: [ 'sender', 'content' ] }\n}\n```\n\n#### .dimensionsById, dimensionsByName (1.19+)\n\nMapping to dimension data object containing dimension `name`, `minY` and `height`.\n\n### mcpe\n\n#### loadItemStates / writeItemStates\n\n* loads/writes data from an item states array inside the bedrock start game packet.\n\n```js\n// In a client\nconst { createClient } = require('bedrock-protocol');\nconst registry = require('prismarine-registry')('bedrock_1.19.50');\n\nconst client = createClient({\n  'host': '127.0.0.1'\n})\n\nclient.on('start_game', ({ itemstates }) => {\n  registry.loadItemStates(itemstates);\n})\n\n// In a server\nserver.on('connect', (client) => {\n  const itemstates = registry.writeItemStates()\n  client.write('start_game', { ...startGamePacket, itemstates })\n})\n```","publish_time":1774833541604,"_cnpm_publish_time":1774833541604,"dist-tags":{"latest":"1.12.0"}}