/hypixel-api

Java Hypixel API wrapper

Primary LanguageJavaMIT LicenseMIT

Download CircleCI

Hypixel API

Java Hypixel API wrapper.

Importing

Replace VERSION with the latest version above.

Gradle Groovy DSL

build.gradle

repositories {
    jcenter()
}

dependencies {
    implementation 'ru.mdashlw.hypixel:hypixel-api:VERSION'
}

Gradle Kotlin DSL

build.gradle.kts

repositories {
    jcenter()
}

dependencies {
    implementation("ru.mdashlw.hypixel:hypixel-api:VERSION")
}

Maven

pom.xml

<depedencies>
    <dependency>
        <groupId>ru.mdashlw.hypixel</groupId>
        <artifactId>hypixel-api</artifactId>
        <version>VERSION</version>
  </dependency>
</depedencies>

<repositories>
    <repository>
      <id>jcenter</id>
      <name>JCenter</name>
      <url>https://jcenter.bintray.com/</url>
    </repository>
</repositories>

Usage

Getting started

To use Hypixel Public API you must provide an API key. You can obtain a key by doing /api new on the server.

HypixelAPI api = new HypixelAPI("API_KEY");
HypixelAPI api = new HypixelAPI("API_KEY", new OkHttpClient());
HypixelAPI api = new HypixelAPI("API_KEY", new OkHttpClient(), new ObjectMapper());

Methods

  • All methods return CompletableFuture.
  • All UUIDs can be both dashed and undashed.

Getting information about a player

Returns: HypixelPlayer (nullable).

HypixelAPI#retrievePlayerByUuid("uuid");
HypixelAPI#retrievePlayerByName("nickname");

Getting information about a session

Returns: Session (nullable).

HypixelAPI#retrieveSessionByUuid("uuid");

Getting information about a guild

Returns: Guild (nullable).

HypixelAPI#retrieveGuildByName("guild_name");
HypixelAPI#retrieveGuildByPlayer("player_uuid");

Getting information about a set API key

Returns: Key (never-null).

HypixelAPI#retrieveKey();

Getting friends of a player

Returns: List<Friendship> (never-null).

HypixelAPI#retrieveFriendsByUuid("uuid");

License

The project is licensed under the MIT license.