-
Notifications
You must be signed in to change notification settings - Fork 148
Using the API with Java
Nullicorn edited this page May 29, 2020
·
5 revisions
This page provides examples of how to use the Hypixel PublicAPI in a Java program. It is assumed that you have already configured your IDE and downloaded PublicAPI on your own machine.
To use the PublicAPI, you will first need to have an API key. The Hypixel API uses keys to keep track of how frequently a user is sending requests, as well as to determine if your API key is compromised.
To obtain your personal API key, you must own a valid Minecraft account and have the Minecraft Launcher installed.
- Launch Minecraft on release 1.8.0 or later (snapshot versions will not work)
- Open the
MultiplayerGUI and connect tomc.hypixel.net - Once you are connected, open up the chat bar (this can be done by pressing the
Tkey by default) - In the chat bar, type
/api newand press enter. You should receive a message in chat saying,Your new API key is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx(with your API key in place of the x's) - When you click on that message, your API key should be copied to your clipboard. Paste that somewhere safe for later
NOTE: Your API key is to be treated just like a password. You should never share your API key with anyone, or else it could be used for malicious purposes.
- Add example usage in a plain java program
- Add example usage in a Forge mod
- Add example usage in a Bukkit plugin