SkyBlock Profile Collections
Helpers
# SkyBlock Profile Collections
# Introduction
The getSkyBlockProfileMemberCollections()
helper takes a SkyBlock profile object (obtained here or here) and the collections resource to get usable collection information from the profile. Additionally, for displaying collection tiers in roman numerals (as you would see ingame) you can use the romanize()
helper.
# Example
import { Client as Hypixel, getSkyBlockProfileMemberCollections, romanize } from "@zikeji/hypixel";
const client = new Hypixel("API_KEY");
(async () => {
const profile = await client.skyblock.profile("ec1811e6822b4843bcd4fef82f75deb7");
const collectionsResource = await client.resources.skyblock.collections();
const collections = getSkyBlockProfileMemberCollections(profile, collectionsResource);
console.log(collections);
// output:
[{…}, {…}, {…}, {…}, {…}]
console.log(collections[4]);
// output:
{id: "FISHING", name: "Fishing", progress: 100, maxedChildCollections: 10, totalCollections: 10, …}
console.log(collections[4].children);
// output:
[{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]
console.log(collections[4].children[0]);
// output:
{
id: "RAW_FISH",
name: "Raw Fish",
tier: 11,
maxTier: 11,
amount: 121990,
progress: 100
}
console.log(romanize(collections[4].children[0].tier));
// output:
"XI"
})();
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
30
31
32
33
34
35
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
30
31
32
33
34
35