Repository navigation
3. Creating Holograms
Maxim.jsx edited this page Jul 27, 2025
·
3 revisions
This guide covers all types of holograms available in HologramLib and their customization options.
TextHologram textHologram = new TextHologram("unique_id")
.setText("Hello World!")
.setMiniMessageText("<aqua>Formatted Text!");Every setter here is optional. If you are not setting a value, a default value will be used.
TextHologram textHologram = new TextHologram("unique_id")
.setMiniMessageText("<aqua>Hello world!")
.setSeeThroughBlocks(false)
.setBillboard(Display.Billboard.VERTICAL)
.setShadow(true)
.setScale(1.5F, 1.5F, 1.5F)
.setTextOpacity((byte) 200)
.setBackgroundColor(Color.fromARGB(60, 255, 236, 222).asARGB())
.setAlignment(TextDisplay.TextAlignment.CENTER)
.setViewRange(1.0)
.setMaxLineWidth(200);-
setText(String)- Sets plain text -
setMiniMessageText(String)- Sets MiniMessage formatted text -
setShadow(boolean)- Toggles text shadow -
setMaxLineWidth(int)- Sets maximum line width -
setBackgroundColor(int)- Sets ARGB background color -
setSeeThroughBlocks(boolean)- Controls visibility through blocks -
setAlignment(TextDisplay.TextAlignment)- Sets text alignment -
setTextOpacity(byte)- Sets text transparency
ItemHologram itemHologram = new ItemHologram("unique_id")
.setItem(new ItemStack.Builder()
.type(ItemTypes.DIAMOND_SWORD)
.build());ItemHologram itemHologram = new ItemHologram("unique_id")
.setItem(new ItemStack.Builder()
.type(ItemTypes.DIAMOND_SWORD)
.build())
.setGlowing(true)
.setGlowColor(Color.CYAN)
.setOnFire(false)
.setDisplayType(ItemDisplayMeta.DisplayType.FIXED)
.setBillboard(Display.Billboard.VERTICAL)
.setScale(2.0F, 2.0F, 0.01F);-
setItem(ItemStack)- Sets displayed item -
setGlowing(boolean)- Toggles glow effect -
setGlowColor(Color)- Sets glow color -
setOnFire(boolean)- Toggles fire effect -
setDisplayType(DisplayType)- Sets display mode
BlockHologram blockHologram = new BlockHologram("unique_id")
.setBlock(Material.DIAMOND_BLOCK.getId());BlockHologram blockHologram = new BlockHologram("unique_id")
.setBlock(Material.DIAMOND_BLOCK.getId())
.setOnFire(false)
.setBillboard(Display.Billboard.VERTICAL)
.setScale(1.0F, 1.0F, 1.0F)
.setViewRange(1.0);-
setBlock(int)- Sets displayed block -
setOnFire(boolean)- Toggles fire effect
These properties are available for all hologram types:
hologram
.setViewRange(double) // Viewing distance
.setScale(float, float, float) // Size in x, y, z
.setBillboard(Display.Billboard) // Rotation behavior
.setTranslation(float, float, float) // Position offset
.setLeftRotation(float, float, float, float) // Left rotation quaternion
.setRightRotation(float, float, float, float) // Right rotation quaternion
.setUpdateTaskPeriod(long) // Update interval
.setNearbyEntityScanningDistance(double); // Entity scan rangeAfter creating and configuring a hologram, spawn it using the HologramManager:
hologramManager.spawn(hologram, location);Call update() after modifying hologram properties:
TextHologram textHologram ((TextHologram) hologramManager.getHologram("unique_id").get());hologramManager.remove("unique_id");hologram
.setText("New Text")
.setScale(2.0F, 2.0F, 2.0F)
.update();- Always use unique IDs for holograms
- Call
update()after changing properties (if you want to apply the changes) - Clean up holograms when no longer needed
For more advanced features, check out:
- Animations for text animations
- Leaderboards for scoreboard displays
- Hologram Management for advanced control
