JSPM

  • Created
  • Published
  • Downloads 222
  • Score
    100M100P100Q78985F
  • License ISC

A package providing info on the EarthMC Minecraft server.

Package Exports

  • earthmc

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (earthmc) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

EarthMC Package

Provides info on the EarthMC Minecraft server.

Installation

$ npm install earthmc

Require the package

var emc = require("earthmc")

Usage Example (Discord Bot)

 A test image

Methods

Get Online Player (Promise)

var player = await emc.getOnlinePlayer("PlayerName").then(player => { return player })

console.log(player)

// => { x: 0, y: 64, z: 0, isUnderground: true, nickname: 'PlayerNickname', name: 'PlayerName' } 

Get Resident (Promise)

var resident = await emc.getResident("ResidentName").then(resident => { return resident })

console.log(resident)

// => { name: 'ResidentName', townName: 'TownName', townNation: 'NationName', rank: 'Resident' }
// Ranks include Resident, Mayor and Nation Leader

Get Town (Promise)

var town = await emc.getTown("TownName").then(town => { return town })

console.log(town)

// => { area: 975, x: -352, z: -9904, name: 'TownName', nation: 'NationName', mayor: 'MayorName', residents: ['Resident', 'OtherResident', ...], pvp: false, mobs: false, public: false, explosion: false, fire: false, capital: true }

Get Nation (Promise)

var nation = await emc.getNation("NationName").then(nation => { return nation })

console.log(nation)

// => { name: 'NationName', residents: ['Resident', 'OtherResident', ...], towns: ['Town', 'OtherTown', ...], king: 'KingName', capitalName: 'CapitalName', capitalX: -352, capitalZ: -9904, area: 7289 }

Get Townless (Promise)

var townless = await emc.getTownless().then(array => { return array })

console.log(townless)

// => [{ x: 0, y: 64, z: 0, isUnderground: true, nickname: 'TownlessPlayer', name: 'TownlessPlayer' }, ...]

Get Server Info (Promise)

var serverInfo = await emc.getServerInfo().then(info => { return info })

console.log(serverInfo)

// => { serverOnline: true, online: 190, max: 200, towny: 139, townyOnline: true, storming: false, thundering: false, beta: 0, betaOnline: true, queue: 51 }