tellraw2dom

0.0.4 • Public • Published

tellraw2dom

Convert Minecraft's raw chat format to HTML DOM nodes for display in a web browser.

Interactive demo

Usage

var tellraw2dom = require('tellraw2dom');

var node = tellraw2dom('{"text": "hello ", "color": "aqua", "extra": [{"text": "world!", "bold": "true"}]}');
document.body.appendChild(node);

DOM nodes will be created appropriately to display 'hello world!' colored aqua.

You can pass either a string to be parsed as JSON, or an object which has already been parsed. tellraw2dom optionally accepts a second argument to specify click, hover, and hoverOut callbacks to support the clickEvent and hoverEvent properties.

Run npm start for a more sophisticated example or visit http://deathcap.github.io/tellraw2dom.

Minecraft is property of Mojang Specifications

See also

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.4
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.4
    2
  • 0.0.3
    1
  • 0.0.2
    1

Package Sidebar

Install

npm i tellraw2dom

Weekly Downloads

4

Version

0.0.4

License

MIT

Last publish

Collaborators

  • deathcap