0.0.4 • Published 10 years ago

tellraw2dom v0.0.4

Weekly downloads
5
License
-
Repository
github
Last release
10 years ago

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

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago