Check it out on GitHub!
This plugin does nothing on it's own! It is a library meant to be used by other plugins to easily allow them to display HUDs to players. This plugin will be needed as a dependency by the plugins that use it.
Display information in a whole new, innovative way with your plugins! WonderHUDAPI allows you to easily create, update, and remove HUD displays filled with your custom content.
The code that powers WonderHUD can now be easily utilized with a few easy to understand methods.
WonderHUDAPI Javadocs
API features coming soon:
- New HUD positions (top right, top left, left, right, bottom right, bottom left)
- HUD transition animations (slide left, slide up, etc)
- Scrolling Text
Setup:
- Load ProtocolLib onto your server
- Place the WonderHUAPI.jar into your plugins folder and make sure it's loaded on your server
- Add the WonderHUDAPI.jar to the build path for your project.
- Add depend: [WonderHUDAPI] to your plugin.yml
Creating a new HUD with text content:
RESULT:
Code (Text):
//Create lines of text to be displayed on the HUD
ArrayList<String> lines = new ArrayList<String>();
lines.add(ChatColor.DARK_RED + "WonderHUD");
lines.add("is");
lines.add(ChatColor.BOLD + "awesome!");
//spawnHUD(Player player, HUDPosition position, maxLines, ArrayList<String> lines)
//maxLines specifies the maximum number of lines the HUD will display
//if a HUD for a player already exists at this location then the method does nothing.
WonderHUD.spawnHUD(player, HUDPosition.TOP_CENTER, 5, lines);
ArrayList<String> lines = new ArrayList<String>();
lines.add(ChatColor.DARK_RED + "WonderHUD");
lines.add("is");
lines.add(ChatColor.BOLD + "awesome!");
//spawnHUD(Player player, HUDPosition position, maxLines, ArrayList<String> lines)
//maxLines specifies the maximum number of lines the HUD will display
//if a HUD for a player already exists at this location then the method does nothing.
WonderHUD.spawnHUD(player, HUDPosition.TOP_CENTER, 5, lines);
Creating a new HUD with image content:
Code (Text):
try
{
//Path to an image on your server
File imageFile = new File("plugins/WonderHUD/images/image.png");
BufferedImage image = ImageIO.read(imageFile);
//spawnHUD(Player player, HUDPosition position, int maxLines, BufferedImage image, int width, int height)
//if a HUD for a player already exists at this location then the method does nothing.
WonderHUD.spawnHUD(player, HUDPosition.TOP_CENTER, 50, image, 120, 40);
}
catch(IOException e){}
{
//Path to an image on your server
File imageFile = new File("plugins/WonderHUD/images/image.png");
BufferedImage image = ImageIO.read(imageFile);
//spawnHUD(Player player, HUDPosition position, int maxLines, BufferedImage image, int width, int height)
//if a HUD for a player already exists at this location then the method does nothing.
WonderHUD.spawnHUD(player, HUDPosition.TOP_CENTER, 50, image, 120, 40);
}
catch(IOException e){}
Updating an existing HUD with text content:
Code (Text):
ArrayList<String> lines = new ArrayList<String>();
lines.add("This");
lines.add("is");
lines.add("some");
lines.add("new");
lines.add("text");
//updateHUD(Player player, HUDPosition position, ArrayList<String> lines)
//if the lines list is longer than the maxLines value of the HUD then it will cut off the additional lines!
//if no HUD exists at the given location for the player then the method does nothing
//updates the HUD at the given position. If no HUD exists at the given location for the player then the method does nothing
WonderHUD.updateHUD(player, HUDPosition.TOP_CENTER, lines);
lines.add("This");
lines.add("is");
lines.add("some");
lines.add("new");
lines.add("text");
//updateHUD(Player player, HUDPosition position, ArrayList<String> lines)
//if the lines list is longer than the maxLines value of the HUD then it will cut off the additional lines!
//if no HUD exists at the given location for the player then the method does nothing
//updates the HUD at the given position. If no HUD exists at the given location for the player then the method does nothing
WonderHUD.updateHUD(player, HUDPosition.TOP_CENTER, lines);
Code (Text):
try
{
File imageFile = new File("plugins/WonderHUD/images/apple.jpg");
BufferedImage image = ImageIO.read(imageFile);
//updateHUD(Player player, HUDPosition position, BufferedImage image, width, height)
//if the image height larger than the maxLines value of the HUD then it will cut off the additional lines!
//if no HUD exists at the given location for the player then the method does nothing
WonderHUD.updateHUD(player, HUDPosition.TOP_CENTER, image, 40, 40);
}
catch (IOException e) {}
{
File imageFile = new File("plugins/WonderHUD/images/apple.jpg");
BufferedImage image = ImageIO.read(imageFile);
//updateHUD(Player player, HUDPosition position, BufferedImage image, width, height)
//if the image height larger than the maxLines value of the HUD then it will cut off the additional lines!
//if no HUD exists at the given location for the player then the method does nothing
WonderHUD.updateHUD(player, HUDPosition.TOP_CENTER, image, 40, 40);
}
catch (IOException e) {}
Code (Text):
//removeHUD(Player player, HUDPosition position)
//if no HUD exists for a player at the given position then the method does nothing
WonderHUD.removeHUD(player, HUDPosition.TOP_CENTER);
//if no HUD exists for a player at the given position then the method does nothing
WonderHUD.removeHUD(player, HUDPosition.TOP_CENTER);
Code (Text):
//removeAllHUDs(Player player)
WonderHUD.removeAllHUDs(player);
WonderHUD.removeAllHUDs(player);
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 1.8, 1.9
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
WonderHUDAPI is a free Minecraft Java mod. Compatible with Minecraft 1.8, 1.9. Downloaded 753 times (via Spigot). Download it and open it directly in the game.