.dev

Modules1 min read

HUD

Cooldowns, timers, sidebar, bars, kill feed, tint, titles and TNT fuse.

hud:1Tier A · Decorate

Good for

  • Ability cooldowns and match timers that tick on the client
  • A scoreboard that is not limited to 15 grey lines
  • Kill feeds, capture bars and big round titles

Try it in game, no code

/tehoapi cooldown * pearl 15 ender_pearl

HUD elements from your server are real Teho HUD modules. Players can move and scale every one of them in the HUD editor, and timers and cooldowns tick on the client, so you send them once instead of every second.

Cooldowns

Java
teho.hud().cooldown(Cooldown.builder("ender_pearl", 15_000)
        .label("Ender Pearl")
        .item("ender_pearl")
        .color(0x5FE0DC)
        .build());

clearCooldown(id) and clearCooldowns() remove them.

Timers

Java
teho.hud().timer(Timer.countdown("match", "Match ends", 10 * 60_000).color(0xFFC24D));
teho.hud().timer(Timer.stopwatch("parkour", "Run", 0));
teho.hud().timer(Timer.countdown("match", "Match ends", remainingMs).paused(true));
teho.hud().removeTimer("match");

Send the same id again to correct the time or to pause and resume it.

The rich sidebar replaces the vanilla scoreboard and is diffed row by row. Sidebar.replace(title) sets the whole thing; Sidebar.update() changes only the rows you pass.

Java
teho.hud().sidebar(Sidebar.replace("Skyline")
        .accent(0x4DA9FF)
        .row(Sidebar.Row.of("mode", "Mode").value("Bedwars Solo"))
        .row(Sidebar.Row.of("bed", "Bed").value("Alive").color(0x7CDB8A))
        .row(Sidebar.Row.of("kills", "Kills").value("0").item("iron_sword"))
        .row(Sidebar.Row.of("gen", "Diamond gen").progress(0.4))
        .footer("play.skyline.gg")
        .build());

teho.hud().sidebar(Sidebar.update()
        .row(Sidebar.Row.of("kills", "Kills").value("3").item("iron_sword"))
        .remove("gen")
        .build());
Row methodNotes
of(id, text)Required.
value(String)Right-aligned value.
item(id) or icon(Asset)An item icon, or your own PNG asset.
color(argb)Row colour.
progress(fraction)A thin progress bar from 0 to 1.
order(int)Explicit sort order. Rows are ordered as added by default.

A sidebar holds at most 32 rows. clearSidebar() hands the vanilla scoreboard back.

Bars

Any number of bars, each with its own id.

Java
teho.hud().bar(Bar.builder("capture", "Capturing B", 0.65)
        .color(0xFFC24D)
        .style(Bar.Style.SEGMENTED)
        .icon("white_banner")
        .ttl(5000)
        .build());
teho.hud().removeBars("capture");

Styles are SOLID, SEGMENTED and NOTCHED. Without a ttl a bar stays until you remove it.

Kill feed

Java
teho.hud().kill("Steve", steveId, "Alex", alexId, "diamond_sword", 0xFF5555);
teho.hud().feed("Red team captured the flag", 0xFF5555);

Titles

Animated titles, separate from vanilla's.

Java
teho.hud().title(Title.of("Victory")
        .subtitle("You won the duel")
        .animation(Title.Animation.POP)
        .times(200, 2500, 400)
        .color(0xFFC24D)
        .scale(1.4)
        .build());

Animations are FADE, TYPEWRITER, SLIDE and POP. Scale runs from 0.5 to 3.

Screen tint

Java
teho.hud().tint(0xFF5555, true, 0.35, 300, 2000);
teho.hud().clearTint();

The arguments are colour, vignette, strength from 0 to 1, fade time and how long it lasts.

TNT fuse

Java
teho.hud().tntFuse(60);

Tells Teho's TNT countdown your server's fuse length in ticks, for servers with custom TNT.

No code

Text
/tehoapi cooldown * pearl 15 ender_pearl
/tehoapi timer * match 600 Match ends
/tehoapi title * Round 2 | Fight!
/tehoapi bar * capture 65 Capturing B
/tehoapi tint * #ff5555