-
Notifications
You must be signed in to change notification settings - Fork 1
Follow KO
wjddusrb03 edited this page Mar 29, 2026
·
1 revision
디스플레이 엔티티가 대상 엔티티(플레이어, 몹 등)를 부드럽게 따라다니게 합니다.
SpawnedDisplay display = DisplayAPI.text(location)
.text(Component.text("이름표"))
.noBackground()
.spawn();
FollowDisplay follow = DisplayAPI.follow(display, player)
.offset(0, 2.5, 0)
.smoothTeleport(3)
.start();| 메서드 | 설명 | 기본값 |
|---|---|---|
.offset(x, y, z) |
대상으로부터의 위치 오프셋 | 0, 2.5, 0 |
.smoothTeleport(int ticks) |
부드러운 이동의 보간 시간 | 3 |
.updateInterval(int ticks) |
위치 갱신 주기 | 1 |
.start() |
추적 시작 | - |
.stop() |
추적 중지 | - |
.remove() |
중지 및 디스플레이 제거 | - |
FollowDisplay는 다음 경우 자동으로 중지됩니다:
- 디스플레이 엔티티가 죽거나 제거됨
- 대상 엔티티가 죽거나 유효하지 않음
- 대상 플레이어가 오프라인
SpawnedDisplay tag = DisplayAPI.text(player.getLocation())
.text(Component.text(player.getName()).color(NamedTextColor.AQUA))
.noBackground()
.billboard(Billboard.CENTER)
.spawn();
DisplayAPI.follow(tag, player)
.offset(0, 2.3, 0)
.start();SpawnedDisplay hp = DisplayAPI.text(pet.getLocation())
.text(Component.text("HP: " + pet.getHealth()))
.noBackground()
.spawn();
DisplayAPI.follow(hp, pet)
.offset(0, 1.5, 0)
.smoothTeleport(2)
.start();FollowDisplay f = DisplayAPI.follow(arrow, target)
.offset(0, 3.0, 0)
.start();
// 10초 후 제거
new BukkitRunnable() {
public void run() { f.remove(); }
}.runTaskLater(plugin, 200L);