Skip to content

@minecraft/server


@minecraft/server / PrimitiveShape

Class: PrimitiveShape ​

Defined in: @minecraft/server/index.d.ts:18550

The base class for a text primitive. Represents an object in the world and its base properties.

Extended by ​

Properties ​

attachedTo? ​

optional attachedTo?: Entity

Defined in: @minecraft/server/index.d.ts:18559

Remarks ​

The entity this shape is attached to. When set, this shape will copy the root location of the attached entity and the shape's position will be used as an offset.


color ​

color: RGBA

Defined in: @minecraft/server/index.d.ts:18565

Remarks ​

The color of the shape.


dimension ​

readonly dimension: Dimension

Defined in: @minecraft/server/index.d.ts:18572

Remarks ​

The dimension the shape is visible within. If the dimension is undefined, it will display in all dimensions.


hasDuration ​

readonly hasDuration: boolean

Defined in: @minecraft/server/index.d.ts:18579

Remarks ​

Returns true if the shape has a limited time span before being removed.


location ​

readonly location: Vector3

Defined in: @minecraft/server/index.d.ts:18585

Remarks ​

The location of the shape.


maximumRenderDistance? ​

optional maximumRenderDistance?: number

Defined in: @minecraft/server/index.d.ts:18595

Remarks ​

If defined, this distance will be used to determine how far away this primitive will be rendered for each client. By default the distance will match the client's render distance setting.

Minimum Value: 0


rotation ​

rotation: Vector3

Defined in: @minecraft/server/index.d.ts:18602

Remarks ​

The rotation of the shape (Euler angles - [Pitch, Yaw, Roll]).


scale ​

scale: number

Defined in: @minecraft/server/index.d.ts:18609

Remarks ​

The scale of the shape.

Bounds: [-1000, 1000]


timeLeft? ​

optional timeLeft?: number

Defined in: @minecraft/server/index.d.ts:18617

Remarks ​

The time left (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span.


totalTimeLeft? ​

readonly optional totalTimeLeft?: number

Defined in: @minecraft/server/index.d.ts:18625

Remarks ​

The total initial time-span (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span.


visibleTo ​

visibleTo: Player[]

Defined in: @minecraft/server/index.d.ts:18632

Remarks ​

The list of players that this shape will be visible to. If left empty, the shape will be visible to all players.

Methods ​

remove() ​

remove(): void

Defined in: @minecraft/server/index.d.ts:18639

Returns ​

void

Remarks ​

Removes this shape from the world. The shape can be re-added via the PrimitiveShapesManager's addText method.


setLocation() ​

setLocation(location): void

Defined in: @minecraft/server/index.d.ts:18646

Parameters ​

location ​

Vector3 | DimensionLocation

Returns ​

void

Remarks ​

Set the location and dimension of the shape. If the dimension is undefined, it will display in all dimensions.