Hey guys, I have a plugin in which i am using the HolographicDisplays API for holograms. I set a hologram to last a set time, then it deletes it. However I'm having some trouble, The message that i set the hologram to display, changes at some point during that 5 minutes within the code. I need to know how i can then delete the old hologram and add this one.
jolbol1 Give us your code maybe you've done something wrong in your code. and does your hologram text change when you aren't looking at it? because it can bug when the chunk gets unloaded where that hologram in is.
The hologram follows the player above their head, so that shouldn't be a problem, My only problem is changing the hologram while the delayed task is still going.
Store your hologram in a Map Code: Map<UUID, Hologram> holograms = new HashMap<>(); Then retrieve it later within your method Code: public void onUpdate(Player player) { Hologram holo holograms.get(player.getUniqueId); // Perform changes here // Use holo.setLine() to set text // Use holo.teleport() to set new location holo.update } if you want to delete the hologram Code: public void deleteHologram(Player player) { Hologram holo holograms.get(player.getUniqueId); if(holo != null && !holo.isDeleted() { holo.delete() } }