Package Exports
- prismarine-registry
- prismarine-registry/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (prismarine-registry) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
prismarine-registry
Creates an dynamic instance of node-minecraft-data.
Usage
const registry = require('prismarine-registry')('1.18')
registry.blocksByName['stone'] // See information about stoneAPI
mcpc
loadDimensionCodec / writeDimensionCodec
- loads/writes data from dimension codec in login packet
.chatFormattingByName, .chatFormattingById (1.19+)
Contains mapping from chat type ID (numeric or string) to information about how the chat type should be formatted and what the relevant parameters are.
{
'minecraft:chat': { formatString: '<%s> %s', parameters: [ 'sender', 'content' ] },
'minecraft:say_command': { formatString: '[%s] %s', parameters: [ 'sender', 'content' ] },
'minecraft:msg_command': { formatString: '%s whispers to you: %s', parameters: [ 'sender', 'content' ] },
'minecraft:team_msg_command': { formatString: '%s <%s> %s', parameters: [ 'team_name', 'sender', 'content' ] },
'minecraft:emote_command': { formatString: '* %s %s', parameters: [ 'sender', 'content' ] }
}.dimensionsById, dimensionsByName (1.19+)
Mapping to dimension data object containing dimension name, minY and height.
mcpe
loadItemStates / writeItemStates
- loads/writes data from an item states array inside the bedrock start game packet.
// In a client
const { createClient } = require('bedrock-protocol');
const registry = require('prismarine-registry')('bedrock_1.19.50');
const client = createClient({
'host': '127.0.0.1'
})
client.on('start_game', ({ itemstates }) => {
registry.loadItemStates(itemstates);
})
// In a server
server.on('connect', (client) => {
const itemstates = registry.writeItemStates()
client.write('start_game', { ...startGamePacket, itemstates })
})