Modules1 min read
World visuals
Beams, holograms, shapes, entity styling, border and fire colour.
world:1Tier A · DecorateGood for
- Beams over objectives you can see from across the map
- Clickable holograms with no armor stands
- Arena borders, zones and team glow
World visuals are drawn by the client only. Nothing is spawned on your server, so beams, holograms and shapes cost you no entities and no tick time, and every player can be shown something different.
Beams
teho.world().beam(Beam.at("drop", 120.5, 64, -40.5)
.color(0xFFC24D)
.height(200)
.width(0.6)
.pulse(true)
.dimension("overworld")
.ttl(30_000)
.build());
teho.world().beam(Beam.on("carrier", flagCarrier.getUniqueId()).color(0xFF5555).build());Beam.at places it at a position; Beam.on attaches it to an entity and follows it.
Holograms
Text, an item or an image, optionally clickable.
teho.world().hologram(Hologram.at("shop", 0.5, 66, 8.5)
.lines("§bSkyline Shop", "§7Click to browse")
.item("emerald")
.background(0x80000000)
.clickable(true)
.range(32)
.build());
teho.world().hologram(Hologram.above("bounty", target.getUniqueId())
.line("§cBounty: 500 coins")
.throughWalls(true)
.build());| Method | Notes |
|---|---|
at(id, x, y, z) / above(id, entity) | Fixed position, or floating above an entity. |
lines(…), line(String) | Up to 16 lines. |
item(id) / image(Asset) | An item, or your own PNG asset. |
scale(double), background(argb) | Size and backing plate. |
clickable(boolean) | Clicks fire onHologramClick, or TehoClientEvent with kind hologram.click and the hologram id as target. |
throughWalls(boolean), range(blocks) | Visibility. |
dimension(String), ttl(ms) | Where, and for how long. |
@EventHandler
public void onClick(TehoClientEvent event) {
if (event.getKind().equals("hologram.click") && event.getTarget().equals("shop")) {
openShop(event.getPlayer());
}
}Shapes
Cuboids, lines, spheres, cylinders and polygons, outlined or filled.
teho.world().shape(Shape.cuboid("arena", -50, 60, -50, 50, 120, 50)
.color(0xFF4DA9FF)
.fill(0x204DA9FF)
.label("Arena")
.build());
teho.world().shape(Shape.sphere("blast", x, y, z, 6).color(0xFFFF5555).ttl(3000).build());
teho.world().shape(Shape.polygon("zone", 64, 20)
.corner(0, 0).corner(40, 0).corner(40, 30).corner(0, 30)
.color(0xFF7CDB8A)
.build());
teho.world().shape(Shape.line("route").point(0, 65, 0).point(30, 70, 40).point(60, 65, 10).lineWidth(3).build());A shape holds up to 1,024 points. lineWidth is in pixels and throughWalls(true) draws it over terrain.
Removing
teho.world().removeBeams("drop");
teho.world().removeHolograms("shop", "bounty");
teho.world().removeShapes("arena");
teho.world().clear();Entity styling
Glow, rename, rescale or hide parts of any entity, for this player only.
teho.world().style(EntityStyle.of(teammate.getUniqueId())
.glow(0x4DA9FF)
.name("§bAlly")
.build());
teho.world().style(EntityStyle.of(boss.getUniqueId())
.rainbow(true)
.scale(1.5)
.hide(EntityStyle.Part.CAPE, EntityStyle.Part.COSMETICS)
.ttl(20_000)
.build());
teho.world().clearStyles(teammate.getUniqueId());Parts you can hide: HEAD, BODY, ARMS, LEGS, ARMOR, HELD_ITEMS, CAPE, COSMETICS. hideName(true) hides the name.
Border and fire
teho.world().borderColor(0xFF5555, false);
teho.world().resetBorder();
teho.world().fireColor(player.getUniqueId(), 0x4DA9FF);
teho.world().resetFire(player.getUniqueId());borderColor's second argument hides the border wall.
Version notes
- On 1.12.2, 1.8.9 and 1.7.10 there is no glowing effect, so Teho draws glow as an outline.
- 1.7.10 has no world border, so border styling does nothing there.