Player Ranks

Helpers
  • Helper
  • Player
  • Rank

# Player Ranks

# Introduction

The getPlayerRank() helper makes extracting rank information from a /api/player response simple and removes the guesswork. As an additional benefit, it also provides you the hex color codes.

# Example

import { Client as Hypixel, getPlayerRank } from "@zikeji/hypixel";
const client = new Hypixel("API_KEY");
(async () => {
  const player = await client.player.uuid("20934ef9488c465180a78f861586b4cf"); // Minikloon
  const rank = getPlayerRank(player);
  console.log(rank);
  // output:
  {
    priority: 100,
    name: 'ADMIN',
    cleanName: 'ADMIN',
    prefix: '§c[ADMIN]',
    cleanPrefix: '[ADMIN]',
    colorCode: '§c',
    colorHex: 'FF5555',
    staff: true
  }
})();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Last update: December 2, 2024 20:48