示例

Java

Hologram hologram = TrHologramAPI
        .builder(player.getLocation())
        .append("Hello World")
        .append("Your name: " + player.getName(), 50, (TickEvent) component -> {
            TextHologram text = (TextHologram) component;
            text.setText("Health: " + player.getHealth());
        })
        .append(viewer -> viewer.getInventory().getItemInMainHand(), 50)
        .interspace(0.5)
        .append("Time: %server_time_ss%", 20)
        .build();

Last updated