Skip to content

Pools ​

A pool manages a group of holograms for you: who sees them, when they appear, and cleanup.

If you only ever call hologram.show(player), you are doing visibility by hand. Pools are the usual approach for real plugins.

Starting a pool ​

java
IHologramPool<MyHologram> pool = holoEasy.startPool(
    60,     // spawnDistance — how close a player must be (blocks)
    true,   // isInteractive — listen for clicks on InteractionLines
    false   // checkLineOfSight — require a clear line of sight
);
ArgumentMeaning
spawnDistancePlayers farther than this do not receive the hologram packets
isInteractiveSet true if holograms in this pool should receive click events
checkLineOfSightWhen true, players behind walls may not see the hologram

Use a type parameter matching your hologram class (MyHologram, HelloWorldHologram, …).

Adding / removing holograms ​

java
MyHologram hologram = new MyHologram(holoEasy, location);
hologram.show(pool);

// later
hologram.hide(pool);

Cleanup on disable ​

java
@Override
public void onDisable() {
    holoEasy.destroyPools();
    PacketEvents.getAPI().terminate();
}

destroyPools() destroys every pool you started and clears them from HoloEasy.

When should you use a pool? ​

SituationRecommendation
Quick test for one playershow(player) is enough
Holograms in the world for everyone nearbyUse a pool
Clickable hologramsPool with isInteractive = true
Many hologramsPrefer pools — they handle join/quit and distance

Next: Click interactions

Released under the GNU GPL v3 License.