mineflayer-playerlist
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Mineflayer Playerlist Tablist Generator

A simple package that generates a PNG image Encoded in Base64 of the Minecraft server tablist for Mineflayer bots.

Example

Example Tablist



Installation

npm install mineflayer-playerlist



or

yarn add mineflayer-playerlist



Usage

Typescript Example:

import { generateTablist, PlayerList } from "mineflayer-playerlist";

const playerList: PlayerList[] = [
    { name: "player1", ping: 10 },
    { name: "player2", ping: 50 },
    { name: "player3", ping: 200 },
];

const tablistImage = await generateTablist(playerList);
console.log(tablistImage);

The function returns a Promise that resolves to the generated PNG image encoded in Base64.



API

generateTablist(players: PlayerList[]): Promise<string>

Use this function to generate a PNG image encoded in Base64 for a Minecraft server tablist.

Parameters

players: An array of player objects. Each player object should have a name and a ping property.

Return Value

A Promise that resolves to the generated PNG image encoded in Base64.

Types

PlayerList

type PlayerList = {
  name: string;
  ping: number;
};

An object representing a player in the tablist. The name property should be a string and the ping property should be a number representing the player's latency in milliseconds.

Readme

Keywords

none

Package Sidebar

Install

npm i mineflayer-playerlist

Weekly Downloads

1

Version

1.1.1

License

MIT

Unpacked Size

69.6 kB

Total Files

19

Last publish

Collaborators

  • febzey