
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
minecraft-protocol-chat-parser
Advanced tools
A small library to transform a string with Minecraft format caracter into a JavaScript object compatible with Minecraft's chat protocol
A small library to transform a string with Minecraft format character into a JavaScript object compatible with Minecraft's chat protocol
const parseString = require('minecraft-protocol-chat-parser')(735).parseString // replace 735 by the protocol number of the targeted minecraft version, 735 is 1.16
console.log(parseString('§4Hello §bWorld'));
Output
{
text: 'Hello ',
color: 'dark_red',
bold: false,
italic: false,
underlined: false,
strikethrough: false,
obfuscated: false,
extra: [
{
text: 'World',
color: 'aqua',
bold: false,
italic: false,
underlined: false,
strikethrough: false,
obfuscated: false
}
]
}
Version 2.0.0 include a partial support to parse a JSON chat protocol data into a string. It's only support formatting properties and will crash if the data contain hoverEvent, clickEvent or others properties who aren't used for text formatting.
let parsed = parseJSON({
text: "Hello ",
extra: [
{
text: "Grooble ",
color: "black",
bold: false,
italic: false,
underlined: false,
strikethrough: false,
obfuscated: false
},
{
text: "How are u ",
color: "dark_purple",
bold: false,
italic: true,
underlined: true,
strikethrough: false,
obfuscated: false
},
{
text: "?",
color: "yellow",
bold: true,
italic: false,
underlined: false,
strikethrough: false,
obfuscated: false
}
]
})
console.log(parsed);
Output
Hello §0Grooble §5§o§nHow are u §e§l?
If the argument useAndChar is set to true the § will be replaced by & in the result string.
The method parseExtra(extra, useAndChar) take only one extra not the full message.
If the argument useAndChar is set to true the § will be replaced by & in the result string.
{
'bold': 'l',
'italic': 'o',
'underlined': 'n',
'strikethrough': 'm',
'obfuscated': 'k',
'black': '0',
'dark_blue': '1',
'dark_green': '2',
'dark_cyan': '3',
'dark_red': '4',
'dark_purple': '5',
'gold': '6',
'gray': '7',
'dark_gray': '8',
'blue': '9',
'green': 'a',
'aqua': 'b',
'red': 'c',
'light_purple': 'd',
'yellow': 'e',
'white': 'f'
}
{
'0': 'black',
'1': 'dark_blue',
'2': 'dark_green',
'3': 'dark_cyan',
'4': 'dark_red',
'5': 'dark_purple',
'6': 'gold',
'7': 'gray',
'8': 'dark_gray',
'9': 'blue',
'a': 'green',
'b': 'aqua',
'c': 'red',
'd': 'light_purple',
'e': 'yellow',
'f': 'white',
'k': 'obfuscated',
'l': 'bold',
'm': 'strikethrough',
'n': 'underlined',
'o': 'italic',
'r': 'reset',
'&': '&',
'§': '&'
}
FAQs
A small library to transform a string with Minecraft format caracter into a JavaScript object compatible with Minecraft's chat protocol
We found that minecraft-protocol-chat-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.