How to use mojangson - 1 common examples

To help you get started, we’ve selected a few mojangson examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PrismarineJS / mineflayer / lib / chat_message.js View on Github external
if (this.hoverEvent.action === 'show_item') {
        let content
        if (this.hoverEvent.value instanceof Array) {
          if (this.hoverEvent.value[0] instanceof Object) {
            content = this.hoverEvent.value[0].text
          } else {
            content = this.hoverEvent.value[0]
          }
        } else {
          if (this.hoverEvent.value instanceof Object) {
            content = this.hoverEvent.value.text
          } else {
            content = this.hoverEvent.value
          }
        }
        this.hoverEvent.value = mojangson.parse(content)
      }
    }
  }

mojangson

A mojangson parser written in node.js

MIT
Latest version published 2 years ago

Package Health Score

39 / 100
Full package analysis

Popular mojangson functions