Skip to content
ASArcaneMP Scripting APIScripting reference
Data shapeServer APIGenerated

TextLabelOptions

Defined in: server/api.d.ts:7683

A text label’s look, placement and audience. Every key is optional; colours are 0xAARRGGBB numbers, “#RRGGBB[AA]” strings or Colors.

optional align?: "left" | "right" | "center"

Defined in: server/api.d.ts:7772

How lines align with each other. Default “center”.


optional anchor?: "center" | "bottom" | "top"

Defined in: server/api.d.ts:7777

Which part of the text block sits on the point. “bottom” grows upward, as a tag over a head.


optional attachBone?: string | null

Defined in: server/api.d.ts:7712

A bone or socket of the attached entity (“head”, say) that viewers’ clients follow every frame, so the label keeps up with sitting, kneeling or riding; offset counts from it. The game resolves the name; for one the target lacks it typically keeps its usual reference point. Empty or null (default) follows the entity. At most 64 bytes. It stays through update(), even one that names another attachTo, and detaching clears it.


optional attachTo?: number | ServerEntity | null

Defined in: server/api.d.ts:7702

Another live entity to follow, or its network id; null or 0 detaches. The label is destroyed with it.


optional background?: boolean | { color?: string | number | Color; padding?: number; radius?: number; } | null

Defined in: server/api.d.ts:7767

A plate behind the text; true is translucent black, 4 px padding and radius.


optional color?: string | number | Color

Defined in: server/api.d.ts:7742

Text colour. Default white.


optional drawDistance?: number

Defined in: server/api.d.ts:7792

World units; the label neither draws nor streams past it. Default 30 metres’ worth.


optional fadeDistance?: number

Defined in: server/api.d.ts:7797

World units where fading starts; 0 starts at 75% of drawDistance.


optional font?: string | null

Defined in: server/api.d.ts:7722

A family viewers’ clients registered with Fonts.register; {b} and {i} use its bold and italic faces. Empty or null (default), or a family a viewer’s client never registered, is the game’s font. At most 64 bytes.


optional fontSize?: number

Defined in: server/api.d.ts:7717

Pixels, 1-512. Default 16.


optional hideForTarget?: boolean

Defined in: server/api.d.ts:7832

Not sent to the player it is attached to, as for their own name tag. Default false.


optional hideFrom?: (number | Player)[] | null

Defined in: server/api.d.ts:7827

These players are not sent it; null or [] clears. Lasts for the connection: a player who reconnects sees it again until hidden again. Read back through getAudience().


optional lineSpacing?: number

Defined in: server/api.d.ts:7782

Line height as a multiple of the size. Default 1.


optional markup?: boolean

Defined in: server/api.d.ts:7692

Parse inline tags: {#RRGGBB} / {#RRGGBBAA} colour, {#} back to color, {b}{/b}, {i}{/i}, {{ for a brace. Default false.


optional maxSize?: number

Defined in: server/api.d.ts:7737

World mode: never larger than this many pixels; 0 = no cap.


optional maxWidth?: number

Defined in: server/api.d.ts:7787

Wraps at spaces past this width, in fontSize pixels. 0 (default) never wraps.


optional minDrawDistance?: number

Defined in: server/api.d.ts:7802

World units; the label does not draw this close, so a second label can take over up close (a name near, “Unknown” far). It is still sent, so the swap has no gap. At or past drawDistance it never draws. Default 0.


optional minFadeDistance?: number

Defined in: server/api.d.ts:7807

World units where it is fully faded in from minDrawDistance (from the camera when that is 0); at or below minDrawDistance (default) it appears at once. To cross-fade with a label that fades out, set minDrawDistance to its fadeDistance and this to its drawDistance.


optional minSize?: number

Defined in: server/api.d.ts:7732

World mode: never smaller than this many pixels.


optional occlusion?: boolean

Defined in: server/api.d.ts:7812

Hidden behind world geometry. Default true.


optional offset?: Vector3 | { x: number; y: number; z: number; }

Defined in: server/api.d.ts:7707

Relative to the attached entity, in world axes; the game decides the reference point (a player’s head, say) unless attachBone names one.


optional opacity?: number

Defined in: server/api.d.ts:7747

0-1, multiplies every colour. Default 1.


optional outline?: boolean | { color?: string | number | Color; width?: number; } | null

Defined in: server/api.d.ts:7757

true is 1 px black; width is at most 4.


optional position?: Vector3 | { x: number; y: number; z: number; }

Defined in: server/api.d.ts:7697

Where the label stands while it is not attached, and returns to when detached.


optional shadow?: boolean | { blur?: number; color?: string | number | Color; offsetX?: number; offsetY?: number; } | null

Defined in: server/api.d.ts:7762

A drop shadow; blur (at most 8) is approximated. Default a 1 px shadow.


optional showTo?: (number | Player)[] | null

Defined in: server/api.d.ts:7822

Only these players are sent it; [] is nobody, null (default) everyone. hideFrom wins over it. Lasts for the connection: a player who reconnects is off it until added again. Read back through getAudience().


optional sizeMode?: "world" | "screen"

Defined in: server/api.d.ts:7727

“screen” (default): fontSize pixels at any distance. “world”: fontSize pixels at one metre on a 1080p view, shrinking with distance.


optional style?: number | "none" | "box" | "shadow" | "outline"

Defined in: server/api.d.ts:7752

A preset for outline, shadow and background; blocks in the same call refine it.


optional text?: string

Defined in: server/api.d.ts:7687

UTF-8 text, at most 1024 bytes; ‘\n’ breaks lines.


optional virtualWorld?: number

Defined in: server/api.d.ts:7817

The virtual world it lives in while it is not attached, and returns to when detached.