-
Notifications
You must be signed in to change notification settings - Fork 0
Runtime Updates
wjddusrb03 edited this page Mar 29, 2026
·
1 revision
Update display properties after spawning.
SpawnedDisplay display = DisplayAPI.getById("my-display");display.updateText(Component.text("New text").color(NamedTextColor.RED));
display.updateText("Plain text shorthand");display.updateBlock(Material.GOLD_BLOCK);
display.updateBlock(Material.OAK_STAIRS.createBlockData("[facing=north]"));display.updateItem(new ItemStack(Material.DIAMOND_SWORD));
display.updateItem(Material.BOW);display.setGlowing(true);
display.setGlowColor(Color.RED);
display.setBillboard(Billboard.FIXED);// Instant teleport
display.teleport(newLocation);
// Smooth teleport (interpolated over ticks, max 59)
display.smoothTeleport(newLocation, 5);display.isAlive(); // Check if entity still exists
display.remove(); // Remove the entity
display.getEntity(); // Access underlying Display entity
display.getLocation(); // Current location// By ID
SpawnedDisplay display = DisplayAPI.getById("my-id");
// Remove by ID
DisplayAPI.remove("my-id");
// Remove all
DisplayAPI.removeAll();SpawnedDisplay display = DisplayAPI.text(location)
.text(Component.text("Message 1"))
.noBackground()
.id("cycling")
.spawn();
String[] messages = {"Message 1", "Message 2", "Message 3"};
new BukkitRunnable() {
int index = 0;
public void run() {
if (!display.isAlive()) { cancel(); return; }
display.updateText(Component.text(messages[index % messages.length]));
index++;
}
}.runTaskTimer(plugin, 0L, 60L); // Every 3 seconds