public interface Hologram extends Terminable, GsonSerializable
EMPTY| Modifier and Type | Method and Description |
|---|---|
static Hologram |
create(Position position,
List<String> lines)
Creates and returns a new hologram
|
static Hologram |
deserialize(JsonElement element) |
void |
despawn()
Despawns the hologram
|
void |
setClickCallback(Consumer<Player> clickCallback)
Sets a click callback for this hologram
|
void |
spawn()
Spawns the hologram
|
void |
updateLines(List<String> lines)
Updates the lines displayed by this hologram
|
void |
updatePosition(Position position)
Updates the position of the hologram and respawns it
|
bindWith, close, hasTerminated, of, terminatedeserialize, deserializeRaw, getDeserializeMethod, serialize@Nonnull static Hologram create(@Nonnull Position position, @Nonnull List<String> lines)
Note: the hologram will not be spawned automatically.
position - the position of the hologramlines - the initial lines to displaystatic Hologram deserialize(JsonElement element)
void spawn()
void despawn()
void updatePosition(@Nonnull Position position)
position - the new positionvoid updateLines(@Nonnull List<String> lines)
This method does not refresh the actual hologram display. spawn() must be called for these changes
to apply.
lines - the new linesCopyright © 2017. All rights reserved.