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

/tellraw2dom/

    Package Sidebar

    Install

    npm i tellraw2dom

    Weekly Downloads

    0

    Version

    0.0.4

    License

    MIT

    Last publish

    Collaborators

    • deathcap