MCBE
OverviewPacketsPrimitiveShapes
ID 0x148 · 328Server → ClientScripting

PrimitiveShapes

Send primitive drawing shape info (from scripting) to the client for rendering.

primitive-shapes.bin
struct PrimitiveShapes {
  varuint32 [] · PrimitiveShapeDataPayload[]   Shapes;
}

Structure

FieldTypeDescription
Shapesvaruint32 count + PrimitiveShapeDataPayload[]Length-prefixed sequence.

Structure of PrimitiveShapeDataPayload

FieldTypeDescription
Network Idvaruint64
Shape Typeoptional byte + ScriptPrimitiveShapeTypePresence flag on the wire; value omitted when absent.
Locationoptional byte + Vec3Presence flag on the wire; value omitted when absent.
Scaleoptional byte + float32Presence flag on the wire; value omitted when absent.
Rotationoptional byte + Vec3Presence flag on the wire; value omitted when absent.
Time Left Total Secoptional byte + float32Presence flag on the wire; value omitted when absent.
Max Render Distanceoptional byte + float32Presence flag on the wire; value omitted when absent.
Coloroptional byte + ColorPresence flag on the wire; value omitted when absent.
Dimension Idoptional byte + DimensionTypePresence flag on the wire; value omitted when absent.
Attached To Idoptional byte + ActorUniqueIDPresence flag on the wire; value omitted when absent.
Extra Data Payloadtagged case index (0=None, 1=ArrowDataPayload, 2=TextDataPayload, 3=BoxDataPayload, 4=LineDataPayload, 5=SphereDataPayload, 6=CylinderDataPayload, 7=PyramidDataPayload, 8=EllipsoidDataPayload, 9=ConeDataPayload)Variant: an index selects the payload type — see the tables below.

Structure of Vec3

FieldTypeDescription
Xfloat32 (LE)
Yfloat32 (LE)
Zfloat32 (LE)

Structure of ArrowDataPayload

FieldTypeDescription
End Locationoptional byte + Vec3Presence flag on the wire; value omitted when absent.
Arrow Head Lengthoptional byte + float32Presence flag on the wire; value omitted when absent.
Arrow Head Radiusoptional byte + float32Presence flag on the wire; value omitted when absent.
Num Segmentsoptional byte + uint8Presence flag on the wire; value omitted when absent.

Structure of TextDataPayload

FieldTypeDescription
Textstring
Use Rotationbool
Background Coloroptional byte + ColorPresence flag on the wire; value omitted when absent.
Line Gap Heightfloat32 (LE)
Depth Testbool
Show Backfacebool
Show Text Backfacebool

Structure of BoxDataPayload

FieldTypeDescription
Box BoundVec3

Structure of LineDataPayload

FieldTypeDescription
End LocationVec3

Structure of SphereDataPayload

FieldTypeDescription
Num Segmentsuint8

Structure of CylinderDataPayload

FieldTypeDescription
Radius XVec2
Radius ZVec2
Heightfloat32 (LE)
Num Segmentsuint8

Structure of PyramidDataPayload

FieldTypeDescription
Widthfloat32 (LE)
Depthoptional byte + float32Presence flag on the wire; value omitted when absent.
Heightfloat32 (LE)

Structure of EllipsoidDataPayload

FieldTypeDescription
RadiiVec3
Segments Per Axisuint8

Structure of ConeDataPayload

FieldTypeDescription
RadiiVec2
Heightfloat32 (LE)
Num Segmentsuint8

Structure of Vec2

FieldTypeDescription
Xfloat32 (LE)
Yfloat32 (LE)

Notes

  • No special notes.