-
Notifications
You must be signed in to change notification settings - Fork 1
Runtime Updates KO
wjddusrb03 edited this page Mar 29, 2026
·
1 revision
생성 후 디스플레이의 속성을 변경합니다.
SpawnedDisplay display = DisplayAPI.getById("my-display");display.updateText(Component.text("새 텍스트").color(NamedTextColor.RED));
display.updateText("일반 텍스트");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);// 즉시 텔레포트
display.teleport(newLocation);
// 부드러운 텔레포트 (보간, 최대 59틱)
display.smoothTeleport(newLocation, 5);display.isAlive(); // 엔티티가 아직 존재하는지 확인
display.remove(); // 엔티티 제거
display.getEntity(); // 기본 Display 엔티티에 접근
display.getLocation(); // 현재 위치// ID로 찾기
SpawnedDisplay display = DisplayAPI.getById("my-id");
// ID로 제거
DisplayAPI.remove("my-id");
// 전체 제거
DisplayAPI.removeAll();SpawnedDisplay display = DisplayAPI.text(location)
.text(Component.text("메시지 1"))
.noBackground()
.id("cycling")
.spawn();
String[] messages = {"메시지 1", "메시지 2", "메시지 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); // 3초마다