-
Notifications
You must be signed in to change notification settings - Fork 0
Quick Start KO
wjddusrb03 edited this page Mar 29, 2026
·
1 revision
import com.wjddusrb03.displayapi.DisplayAPI;
import com.wjddusrb03.displayapi.display.SpawnedDisplay;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import org.bukkit.entity.Display.Billboard;
// 간단한 텍스트 홀로그램 생성
SpawnedDisplay display = DisplayAPI.text(location)
.text(Component.text("안녕하세요!").color(NamedTextColor.GOLD))
.billboard(Billboard.CENTER)
.noBackground()
.spawn();DisplayAPI.text(npc.getLocation().add(0, 2.2, 0))
.text(Component.text("상점 주인").color(NamedTextColor.GREEN))
.billboard(Billboard.CENTER)
.noBackground()
.shadowed(true)
.spawn();@EventHandler
public void onDamage(EntityDamageByEntityEvent e) {
if (!(e.getDamager() instanceof Player attacker)) return;
double damage = e.getFinalDamage();
DisplayAPI.popup(e.getEntity().getLocation().add(0, 1.5, 0))
.text(Component.text(String.format("-%.1f", damage)).color(NamedTextColor.RED))
.duration(25)
.startScale(1.2f)
.endScale(0.3f)
.visibleTo(attacker)
.spawn();
}SpawnedDisplay item = DisplayAPI.item(location)
.item(new ItemStack(Material.NETHER_STAR))
.billboard(Billboard.CENTER)
.spawn();
DisplayAPI.animate(item).floating(0.3f, 40).loop(true).play();
DisplayAPI.animate(item).spin(AnimationBuilder.Axis.Y, 60).loop(true).play();DisplayAPI.interactive(location)
.text(Component.text("[텔레포트]").color(NamedTextColor.AQUA))
.hitbox(2.0f, 0.8f)
.scale(1.5f)
.onClick(player -> {
player.teleport(targetLocation);
player.sendMessage("텔레포트 완료!");
})
.spawn();SpawnedDisplay hp = DisplayAPI.text(player.getLocation().add(0, 2.5, 0))
.text(Component.text("HP: 20").color(NamedTextColor.RED))
.noBackground()
.billboard(Billboard.CENTER)
.spawn();
DisplayAPI.follow(hp, player)
.offset(0, 2.5, 0)
.smoothTeleport(3)
.start();var anchor = location.clone().add(0, 2, 0);
var group = DisplayAPI.group("info-board", anchor);
group.add(DisplayAPI.text(anchor)
.text(Component.text("서버 정보").color(NamedTextColor.GOLD))
.noBackground().spawn());
group.add(DisplayAPI.text(anchor.clone().add(0, -0.3, 0))
.text(Component.text("플레이어: 10/100").color(NamedTextColor.GRAY))
.noBackground().spawn());
group.add(DisplayAPI.text(anchor.clone().add(0, -0.6, 0))
.text(Component.text("TPS: 20.0").color(NamedTextColor.GREEN))
.noBackground().spawn());
DisplayAPI.getManager().registerGroup(group);- TextDisplay-KO - 전체 텍스트 옵션
- Animation-KO - 애니메이션 시스템 상세
- Interactive-KO - 클릭 감지 가이드
- Persistence-KO - 서버 재시작 후 유지