Bedwars Level & Prestige Info

Helpers
  • Helper
  • Bedwars
  • Level
  • Prestige

# Bedwars Level & Prestige Info

# Introduction

The getBedwarsLevelInfo() helper allows you to easily extract Bedwars level & prestige info from the /api/player endpoint. If provided a player object, will throw an error if no Bedwars stats are found.

# Example

import { Client as Hypixel, getBedwarsLevelInfo } from "@zikeji/hypixel";
const client = new Hypixel("API_KEY");
(async () => {
  let player = await client.player.uuid("b876ec32e396476ba1158438d83c67d4"); // Technoblade
  let levelInfo = getBedwarsLevelInfo(player);
  console.log(levelInfo);
  // output:
  {
    level: 222,
    prestige: 2,
    prestigeName: 'Gold',
    prestigeColor: '§6',
    prestigeColorHex: 'FFAA00',
    levelInCurrentPrestige: 22
  }
  
  player = await client.player.uuid("24c182c6716b47c68f60a1be9045c449"); // gamerboy80
  levelInfo = getBedwarsLevelInfo(player);
  console.log(levelInfo);
  // output:
  {
    level: 1493,
    prestige: 10,
    prestigeName: 'Rainbow',
    prestigeColor: '§f',
    prestigeColorHex: 'FFFFFF',
    levelInCurrentPrestige: 493
  }
})();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Last update: December 2, 2024 20:48