all-minecraft
Installation
# NPM
npm install --save all-minecraft
# Yarn
yarn add all-minecraft
Usage
// ES5
const allMinecraft = require("all-minecraft");
// ES6
import allMinecraft from "all-minecraft";
Server Information
MinecraftServerInfo.serverInfo
const { MinecraftServerInfo } = require("all-minecraft");
const server = new MinecraftServerInfo({
serverIp: "pika.host",
});
server.serverInfo().then(console.log);
MinecraftServerInfo.query
const server = new MinecraftServerInfo({
serverIp: "lobby.freecraft.eu",
queryPort: 25555,
});
server.query().then(console.log);
Others
const server = new MinecraftServerInfo({
serverIp: "darklegacymc.tk",
});
console.log("Favicon: " + server.favicon());
console.log("Banner: " + server.getBannerURL({ title: "DarkLegacyMC" }));
console.log("IP: " + server.getServerIp);
console.log("Port: " + server.getServerPort);
Player Information
MinecraftPlayerInfo.getHead
const { MinecraftPlayerInfo } = require("all-minecraft");
const player = new MinecraftPlayerInfo({
usernameOrUUID: "mallusrgreat",
});
console.log(
player.getHead({
extension: "png",
helm: false,
size: 100,
facing: "left", // Facing is only for isometric
})
);
MinecraftPlayerInfo.getSkin
console.log(
player.getSkin({
extension: "png",
helm: false,
size: 100,
facing: "left", // Facing is only for isometric version
})
);
MinecraftPlayerInfo.getPlayerInfo
player.getPlayerInfo().then(console.log);
Other
console.log("Username / UUID Specified in constructor: " + player.getUsernameOrUUID);
That's it! You're done