HypixelApiUtils

Methods for accessing the Hypixel API.

Getting a response from an http query takes some time. Therefore the methods in here should only be used suspended in coroutines that do not block the main thread. To ensure that none of the methods are used on accident in the main thread they have the suspend keyword. This only allows them to be used in a coroutine. In general the IO dispatcher is the best choice for these coroutines. The following shows an example of how to use getSecrets.

scope.launch(Dispatchers.IO) {
     val uuid = mc.thePlayer.uniqueID.toString()
     val secrets = HypixelApiUtils.getSecrets(uuid)
     modMessage("$secrets")
}

Author

Aton

Functions

Link copied to clipboard
suspend fun getSecrets(uuid: String): Int?

Get the total amount of secrets a player has collected. Only use this method in a coroutine to not freeze the main thread.