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.
Properties
Section titled “Properties”align?
Section titled “align?”
optionalalign?:"left"|"right"|"center"
Defined in: server/api.d.ts:7772
How lines align with each other. Default “center”.
anchor?
Section titled “anchor?”
optionalanchor?:"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.
attachBone?
Section titled “attachBone?”
optionalattachBone?: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.
attachTo?
Section titled “attachTo?”
optionalattachTo?: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.
background?
Section titled “background?”
optionalbackground?: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.
color?
Section titled “color?”
optionalcolor?:string|number|Color
Defined in: server/api.d.ts:7742
Text colour. Default white.
drawDistance?
Section titled “drawDistance?”
optionaldrawDistance?:number
Defined in: server/api.d.ts:7792
World units; the label neither draws nor streams past it. Default 30 metres’ worth.
fadeDistance?
Section titled “fadeDistance?”
optionalfadeDistance?:number
Defined in: server/api.d.ts:7797
World units where fading starts; 0 starts at 75% of drawDistance.
optionalfont?: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.
fontSize?
Section titled “fontSize?”
optionalfontSize?:number
Defined in: server/api.d.ts:7717
Pixels, 1-512. Default 16.
hideForTarget?
Section titled “hideForTarget?”
optionalhideForTarget?: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.
hideFrom?
Section titled “hideFrom?”
optionalhideFrom?: (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().
lineSpacing?
Section titled “lineSpacing?”
optionallineSpacing?:number
Defined in: server/api.d.ts:7782
Line height as a multiple of the size. Default 1.
markup?
Section titled “markup?”
optionalmarkup?: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.
maxSize?
Section titled “maxSize?”
optionalmaxSize?:number
Defined in: server/api.d.ts:7737
World mode: never larger than this many pixels; 0 = no cap.
maxWidth?
Section titled “maxWidth?”
optionalmaxWidth?:number
Defined in: server/api.d.ts:7787
Wraps at spaces past this width, in fontSize pixels. 0 (default) never wraps.
minDrawDistance?
Section titled “minDrawDistance?”
optionalminDrawDistance?: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.
minFadeDistance?
Section titled “minFadeDistance?”
optionalminFadeDistance?: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.
minSize?
Section titled “minSize?”
optionalminSize?:number
Defined in: server/api.d.ts:7732
World mode: never smaller than this many pixels.
occlusion?
Section titled “occlusion?”
optionalocclusion?:boolean
Defined in: server/api.d.ts:7812
Hidden behind world geometry. Default true.
offset?
Section titled “offset?”
optionaloffset?: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.
opacity?
Section titled “opacity?”
optionalopacity?:number
Defined in: server/api.d.ts:7747
0-1, multiplies every colour. Default 1.
outline?
Section titled “outline?”
optionaloutline?: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.
position?
Section titled “position?”
optionalposition?: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.
shadow?
Section titled “shadow?”
optionalshadow?: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.
showTo?
Section titled “showTo?”
optionalshowTo?: (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().
sizeMode?
Section titled “sizeMode?”
optionalsizeMode?:"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.
style?
Section titled “style?”
optionalstyle?: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.
optionaltext?:string
Defined in: server/api.d.ts:7687
UTF-8 text, at most 1024 bytes; ‘\n’ breaks lines.
virtualWorld?
Section titled “virtualWorld?”
optionalvirtualWorld?:number
Defined in: server/api.d.ts:7817
The virtual world it lives in while it is not attached, and returns to when detached.