Skip to content

Latest commit

 

History

History
46 lines (36 loc) · 1.13 KB

File metadata and controls

46 lines (36 loc) · 1.13 KB

Hypixel Public API - Unirest Transport

Usage

<dependency>
    <groupId>net.hypixel</groupId>
    <artifactId>hypixel-api-transport-unirest</artifactId>
    <version>4.4</version>
</dependency>

Can also be included with Gradle.

dependencies {
    implementation 'net.hypixel:hypixel-api-transport-unirest:4.4'
}

Example code

public class Main {
    public static void main(String[] args) {
        HypixelHttpClient client = new UnirestHttpClient(UUID.fromString("your-api-key-here"));
        HypixelAPI hypixelAPI = new HypixelAPI(client);
        hypixelAPI.getPlayerByName("Hypixel")
                .exceptionally(throwable -> {
                    // Handle exceptions here
                    throwable.printStackTrace();
                    return null;
                })
                .thenAccept(System.out::println);
    }
}

Dependencies

This transport depends on the following: