Skip to content

gigantino/coralmc

Repository files navigation

CoralMC

About

A Node.js/Bun module that allows you to interact with the CoralMC API.

Warning CoralMC's API is still in alpha and isn't documented. In the future an access token is going to be required. At the current state, it isn't recommended for production usage as it could stop working at any point.

Installation

# Node
npm i coralmc
yarn add coralmc
pnpm add coralmc

# Bun
bun add coralmc

Example usage

Get basic player info:

const coralmc = require("coralmc");

const playerInfo = await coralmc.getPlayerInfo("Feryzz").catch((err) => {
  console.error(`Error: ${err}`);
});

if (playerInfo) {
  console.log(playerInfo);
} else console.log("Player not found!");

Get player stats:

const coralmc = require("coralmc");

const playerStats = await coralmc.getPlayerStats("Feryzz").catch((err) => {
  console.error(`Error: ${err}`);
});

if (playerStats) {
  console.log(playerStats.bedwars);
  console.log(playerStats.kitpvp);
} else console.log("Player not found!");

About

A module to interact with the CoralMC API

Resources

Stars

Watchers

Forks

Packages

No packages published