Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Hologram

Hierarchy

  • Hologram

Index

Methods

appendItemLine

  • appendItemLine(itemStack: ItemStack): ItemLine
  • Appends an item line to end of this hologram.

    Parameters

    • itemStack: ItemStack

      the content of the line

    Returns ItemLine

    the new ItemLine appended

appendTextLine

  • appendTextLine(text: string): TextLine
  • Appends a text line to end of this hologram.

    Parameters

    • text: string

      the content of the line, can be null for an empty line

    Returns TextLine

    the new TextLine appended

clearLines

  • clearLines(): void

delete

  • delete(): void
  • Deletes this hologram. Editing or teleporting the hologram when deleted will throw an exception. Lines will be automatically cleared. You should remove all the references of the hologram after deletion.

    Returns void

getCreationTimestamp

  • getCreationTimestamp(): number
  • Returns when the hologram was created. Useful for removing old holograms.

    Returns number

    the timestamp of when the hologram was created, in milliseconds

getHeight

  • getHeight(): number
  • The physical height of the hologram, counting all the lines. Since: v2.1.4

    Returns number

    the height of the hologram, counting all the lines and the gaps between them

getLine

  • getLine(index: number): HologramLine
  • Finds the element at a given index in the lines.

    throws

    IndexOutOfBoundsException if the index is out of range (index < 0 || index >= size())

    Parameters

    • index: number

      the index of the line to retrieve.

    Returns HologramLine

    the hologram line at the given index, can be an {@link ItemLine} or a {@link TextLine}.

getLocation

  • getLocation(): BukkitLocation

getVisibilityManager

getWorld

  • getWorld(): BukkitWorld

getX

  • getX(): number

getY

  • getY(): number

getZ

  • getZ(): number

insertItemLine

  • insertItemLine(index: number, itemStack: ItemStack): ItemLine
  • Inserts an item line in this hologram.

    throws

    IndexOutOfBoundsException if the index is out of range (index < 0 || index >= size())

    Parameters

    • index: number

      the line is inserted before this index. If 0, the new line will be inserted before the first line.

    • itemStack: ItemStack

      the content of the line

    Returns ItemLine

    the new ItemLine inserted

insertTextLine

  • insertTextLine(index: number, text: string): TextLine
  • Inserts a text line in this hologram.

    throws

    IndexOutOfBoundsException if the index is out of range (index < 0 || index >= size())

    Parameters

    • index: number

      the line is inserted before this index. If 0, the new line will be inserted before the first line.

    • text: string

      the content of the line, can be null for an empty line

    Returns TextLine

    the new TextLine inserted

isAllowPlaceholders

  • isAllowPlaceholders(): boolean
  • Checks if the hologram will track and replace placeholders. This is false by default.

    Returns boolean

    if the hologram allows placeholders

isDeleted

  • isDeleted(): boolean

refreshAll

  • refreshAll(): void

removeLine

  • removeLine(index: number): void
  • Removes a line at a given index. Since: v2.0.1

    throws

    IndexOutOfBoundsException if the index is out of range (index < 0 || index >= size())

    Parameters

    • index: number

      the index of the line, that should be between 0 and size() - 1.

    Returns void

setAllowPlaceholders

  • setAllowPlaceholders(allowPlaceholders: boolean): void
  • Sets if the hologram should track and replace placeholders. By default if will not track them.

    Parameters

    • allowPlaceholders: boolean

      if the hologram should track placeholders

    Returns void

size

  • size(): number

teleport

  • teleport(location: BukkitLocation): void
  • teleport(world: BukkitWorld, x: number, y: number, z: number): void
  • Teleports a hologram to the given location.

    Parameters

    • location: BukkitLocation

      the new location

    Returns void

  • Teleports a hologram to the given location.

    Parameters

    • world: BukkitWorld

      the world where the hologram should be teleported, use {@link #getWorld()} to teleport it in the same world.

    • x: number

      the X coordinate

    • y: number

      the Y coordinate

    • z: number

      the Z coordinate

    Returns void

Generated using TypeDoc