Giter VIP home page Giter VIP logo

mc-utils's Introduction

mc-utils

NPM library of useful Minecraft-related utilities

stable package downloads

##Install npm i --save mc-utils

##Uses

####Pinging servers (example):

utils = require('mc-utils');

utils.ping('mc.hypixel.net', 25565, function(err, res) {
  if(err) {
    console.log(err);
  } else {
    console.log(res);
  }
}, 3000);

Response: { version: { name: 'Requires MC 1.8/1.9/1.10/1.11', protocol: 47 }, players: { max: 35000, online: 17399, sample: [] }, description: ' §aHypixel Network §7§c1.8/1.9/1.10/1.11\n §e§lHUGE MEGA WALLS UPDATE!', favicon: '//Favicon png response as base64' }

####MOTD Formatting

utils = require('mc-utils');

utils.parseMotD("§5An §dExample §eMOTD!", function(err, result) {
  console.log(result);
});

Response: [ { rules: { color: 'dark-purple' }, motd: 'An ' }, { rules: { color: 'light-purple' }, motd: 'Example ' }, { rules: { color: 'yellow' }, motd: 'MOTD!' } ]

####UUID -> Name (example):

utils.name('99d68f36-0adb-48fc-a989-e2cc1cec1878', function(err, res) {
  if(err) {
    console.log(err);
  } else {
    console.log(res);
  }
});

Response: { name: 'Phineas', changedToAt: 1423047291000 } (changedToAt is the epoch timestamp of when they changed their name to that; if they've never changed their name, it won't be in the object)

####Name -> UUID (example):

utils = require('mc-utils');

utils.uuid('Phineas', function(err, res) {
  if(err) {
    console.log(err);
  } else {
    console.log(res);
  }
});

Response: { id: '99d68f360adb48fca989e2cc1cec1878', name: 'Phineas' }

##Credits Cryptkeeper for the MC ping protocol

mc-utils's People

Contributors

phineas avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.