Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prismarine-chat

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prismarine-chat

Wrapper for a minecraft chat message

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
21K
decreased by-14.82%
Maintainers
1
Weekly downloads
 
Created
Source

prismarine-chat

NPM version Build Status Discord Gitter Irc

Try it on gitpod

Usage

const ChatMessage = require('prismarine-chat')('1.16')

const msg = new ChatMessage({"text":"Example chat mesasge"})
console.log(msg.toString()) // Example chat message

API

chat.ChatMessage (base class)

chat.toString([lang])

Flattens the message in to plain-text

  • lang - (optional) - Set a custom lang (defaults to mcData.language)
chat.toMotd([lang], parent)

Converts to motd format

  • lang - (optional) - Set a custom lang (defaults to mcData.language)
  • parent - Set a custom lang (defaults to mcData.language)
chat.getText(idx, [lang])

Returns a text part from the message

  • idx - Index of the part
  • lang - (optional) - Set a custom lang (defaults to mcData.language)
chat.toAnsi([lang])

Converts to ansi format

  • lang - (optional) - Set a custom lang (defaults to mcData.language)
chat.length()

Returns the count of text extras and child ChatMessages Does not count recursively in to the children

Keywords

FAQs

Package last updated on 14 Jul 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc