Skip to content

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초마다

Clone this wiki locally