New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

minecraft-pe

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minecraft-pe

A package using minecraftpocket-servers.com API that allow users to easily manage their minecraft bedrock servers.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

minecraft-pe

A package using minecraftpocket-servers.com API that allow users to easily manage their minecraft bedrock servers.

Usage

Initialization

This structure is necessary in order for the package to work.

const Minecraft = require('minecraft-pe');
const server = new Minecraft("YOUR_SERVER_API_KEY");

You can get your SERVER_API_KEY here by clicking in the gear button
(You must have registered a minecraft server before btw)
image
And It'll be like this
image)

Get Informations from your Minecraft Server

Code
server.getInformations().then(data => {
    console.log(data);
    const id = data.id;
    const name = data.name;
    const address = data.address;
    const port = data.port;
    const hostname = data.hostname;
    const players = data.players;
    const version = data.version;
    const url = data.url;
});

⚠ You can't set data from getInformations() function as a super global variable at the moment (Sorry). ⚠

Expected Output (example)
{
  id: '111746',
  name: 'Exodus',
  address: 'play.exodus.ovh.mine.fun',
  port: '25565',
  private: '1',
  password: '0',
  location: 'France',
  hostname: 'Exodus UHC',
  is_online: '1',
  players: '3',
  maxplayers: '100',
  version: '1.17.0',
  platform: null,
  uptime: '100',
  score: '2',
  rank: '1004',
  votes: '0',
  favorited: '0',
  comments: '0',
  url: 'https://minecraftpocket-servers.com/server/111746/',
  last_check: 'July 11th, 2021 04:01 PM EST',
  last_online: 'July 11th, 2021 04:01 PM EST'
}

All of above (Full Example)

const Minecraft = require('minecraft-pe');
const server = new Minecraft("YOUR_SERVER_API_KEY");

server.getInformations().then(data => console.log(data));

Install

npm install minecraft-pe

Changelog

1.0.0

  • First Publish
  • Adding getInformations() function according to the new Connect(server_api_key) Class.
  • Adding colors and fetch packages.

Credits

Don't forget to Star this open-source repo ! GitHub Repo stars

License

Apache-2.0

Keywords

minecraft

FAQs

Package last updated on 13 Jul 2021

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