Class Hologram

java.lang.Object
com.ultikits.ultitools.widgets.Hologram

public class Hologram extends Object
A multi-line hologram widget using invisible ArmorStands.

Creates floating text displays by spawning invisible, invulnerable ArmorStands with custom names. Each line is spaced 0.25 blocks apart vertically.

使用不可见盔甲架创建的多行全息文字组件。 通过生成带有自定义名称的不可见、无敌盔甲架来创建浮动文字显示。 每行垂直间距 0.25 格。

Example Usage / 使用示例:


 Hologram hologram = new Hologram("Line 1", "Line 2", "Line 3");
 ArmorStand[] stands = hologram.spawn(location);
 
 // To remove the hologram later / 稍后移除全息图
 for (ArmorStand stand : stands) {
     stand.remove();
 }
 

ArmorStand Properties / 盔甲架属性:

  • Invisible (不可见)
  • No gravity (无重力)
  • Invulnerable (无敌)
  • Custom name visible (显示自定义名称)
Since:
6.0.0
Author:
wisdomme
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final String[]
    The text lines to display, from top to bottom / 要显示的文本行,从上到下
  • Constructor Summary

    Constructors
    Constructor
    Description
    Hologram(String... lines)
    Creates a new hologram with the specified text lines.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.entity.ArmorStand[]
    spawn(org.bukkit.Location originLocation)
    Spawn the hologram.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • lines

      private final String[] lines
      The text lines to display, from top to bottom / 要显示的文本行,从上到下
  • Constructor Details

    • Hologram

      public Hologram(String... lines)
      Creates a new hologram with the specified text lines.
      使用指定的文本行创建新的全息图。
      Parameters:
      lines - the text lines to display, from top to bottom 要显示的文本行,从上到下
  • Method Details

    • spawn

      public org.bukkit.entity.ArmorStand[] spawn(org.bukkit.Location originLocation)
      Spawn the hologram.
      Parameters:
      originLocation - The location you want to create the hologram.
      Returns:
      The spawned armor stands.You can use them to remove the hologram.