Easy to create own Text Holograms!
How to use it?
- Add the plugin as Library in your development environment
- Spawn the hologramm with
Code
HashMap<String, Double> TextInHashmap= new HashMap<String, Double>(); TextInHashmap.put("§aText1", 0.0); TextInHashmap.put("§7Text2", 0.4); TextInHashmap.put("§cText3", [Relative Y position]); [...] TextObject hologram = new TextObjects([Plugin Instance], [Player], [DistanceToPlayer], TextInHashmap); - Destroy the hologram with
Code
hologram.delete(); - Do this in combination with a ArrayList or Hashmap, as in the example.
- Export your plugin and do it with the HologramAPI.jar in the "plugins" order of your server.
- READY!
Other Methods in the TextObjects class:
- getPlayer(), return the Player.
- getDistanceToPlayer(), return the distance.
- setDistanceToPlayer(double distance), set the distance, work without respawn.
- spawn(), spawn the hologram, only for respawn. Automatically spawn, spawn() is in the constructor.
- delete(), remove the NPCs, you can make spawn() to respawn.
Example
HashMap<UUID, TextObjects> TextObjects = new HashMap<UUID, TextObjects>();
@EventHandler
public void onToggleSneak(PlayerToggleSneakEvent e) {
Player player = e.getPlayer();
if(player.isSneaking()) {
if(TextObjects.containsKey(player.getUniqueId())) {
TextObjects.get(player.getUniqueId()).delete();
TextObjects.remove(player.getUniqueId());
}
} else {
if(!TextObjects.containsKey(player.getUniqueId())) {
HashMap<String, Double> Text = new HashMap<String, Double>();
int Kills = 37;
int Deaths = 21;
double KD = Double.valueOf(Math.round(((double)Kills / (double)Deaths) * 100)) / 100;
Text.put("§aYour Stats:", 0.0);
Text.put("§7Kills: §6" + Kills, 0.4);
Text.put("§7Deaths: §6" + Deaths, 0.7);
Text.put("§7K/D: §6" + KD, 1.0);
TextObjects.put(player.getUniqueId(), new TextObjects(Main.getInstance(), player, 3, Text));
}
}
}Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta