Adventure and primitives

Use rune.adventure for messaging and rune.types for common Paper classes. Both are available directly in TypeScript Runes.

Send a message

const { adventure } = rune;

rune.on(Events.PlayerJoinEvent, (event) => {
  const player = event.getPlayer();
  const welcome = adventure.format`<gold>Welcome, ${player.getName()}!</gold>`;

  adventure.send(player, welcome);
  adventure.title(player, welcome, "Glad you're here", { stayMs: 2200 });
  adventure.actionBar(player, "Use /help to see commands");
  adventure.playSound(player, "minecraft:entity.player.levelup", { volume: 0.5 });
});

Plain strings are literal. Use adventure.miniMessage()or the adventure.format template tag for rich text. Interpolated strings are inserted literally. Adventure components can also be interpolated to preserve their styling.

const name = "<red>Still literal";
const welcome = rune.adventure.miniMessage("<gold>Hello, <name>!", { name });
rune.adventure.broadcast(welcome);

Compose components

const a = rune.adventure;
const label = a.hover(a.text("Open the guide", "#ffb347"), "Click to open");
const link = a.click(label, "open_url", "https://runemc.dev/docs");

a.send(rune.players(), link);

const book = a.book("Server guide", "Operators", [link, a.text("Have fun!")]);
const player = rune.player("Alex");
if (player) a.openBook(player, book);

Use join, translate, and serializeto combine, localize, and export components. The Component, Style, ClickEvent,HoverEvent, TagResolver, and other Adventure classes are also available directly on rune.adventure.

Boss bars, tab lists, and sounds

const a = rune.adventure;
const team = a.audience(rune.players());
const bar = a.bossBar(a.text("Race starts soon", "gold"), {
  progress: 0.5,
  color: "yellow",
  overlay: "notched_10",
});

a.showBossBar(team, bar);
a.tabList(team, a.text("Sprint Arena", "gold"), "Waiting for players");
bar.progress(0.75);
a.hideBossBar(team, bar);
a.stopSound(team, "minecraft:entity.player.levelup");

Common Paper objects

const { Material, PotionEffect } = rune.types;
const world = rune.world("world");

if (world) {
  const spawn = rune.location(world, 10.5, 70, 8.5);
  const floor = rune.blockAt(world, 10, 69, 8);
  floor.setType(Material.STONE);

  const player = rune.player("Alex"); // exact online name or UUID
  if (player) player.teleport(spawn);
}

const direction = rune.vector(0, 1, 0);

rune.types also exposes Location, Vector, ItemStack, NamespacedKey, EntityType, GameMode, and PotionEffectType. Existing helpers such as rune.item, rune.key, and rune.msg remain available.