Code Monkey home page Code Monkey logo

prismarine-registry's Introduction

prismarine-registry

NPM version Build Status Discord Try it on gitpod

Creates an dynamic instance of node-minecraft-data.

Usage

const registry = require('prismarine-registry')('1.18')

registry.blocksByName['stone'] // See information about stone

API

See minecraft-data API

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 })
})

prismarine-registry's People

Contributors

extremeheat avatar rom1504 avatar frej4189 avatar dependabot[bot] avatar adambrangenberg avatar autowert66 avatar sertonix avatar nickelpro avatar jtsiskin avatar

Forkers

freezeengine

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.