Skip to content

API reference Obsidian.API.Client

BlockEntityRenderPart record

A part of a block entity's renderer: a declared model, faces, or both, scaled and turned about BlockEntityRenderPart.Pivot, then moved by BlockEntityRenderPart.Offset. Positions are in sixteenths of a block, like a block model's elements.

public sealed record BlockEntityRenderPart : IEquatable<BlockEntityRenderPart>

In Obsidian.API.Client.

Remarks

Its angle at a frame is BlockEntityRenderPart.Angle plus BlockEntityRenderPart.Speed times the ticks since BlockEntityRenderPart.Since, counting the partial tick, so a spinning part turns smoothly between ticks: a machine that starts working puts the level's game time (ILevel.Time) in its update data, and its provider returns new BlockEntityRenderPart { Model = new("examplemod:part/gear"), Speed = 18, Since = started }.

Constructors

public BlockEntityRenderPart();

Properties

Angle

public float Angle { get; init; }

The part's angle at BlockEntityRenderPart.Since, in degrees: counterclockwise seen from where BlockEntityRenderPart.Axis points, looking back at BlockEntityRenderPart.Pivot.

Axis

public VectorF Axis { get; init; }

The direction of the axis the part turns about; up by default.

Faces

public IReadOnlyList<BlockModelFace> Faces { get; init; }

Faces drawn with the model, with any block texture, in the format of model data's faces. Their cull faces and tint indexes are ignored.

Model

public BlockModelPart? Model { get; init; }

The model drawn, one of BlockEntityRendererProperties.Models, turned in quarter turns like a blockstate file's model before the part's own rotation; null for faces alone.

Offset

public VectorF Offset { get; init; }

How far the part is moved once turned, in sixteenths of a block.

Pivot

public VectorF Pivot { get; init; }

The point the part is scaled and turned about, in sixteenths of a block; the block's centre by default.

Scale

public float Scale { get; init; }

The part's size, scaled about BlockEntityRenderPart.Pivot.

Since

public long Since { get; init; }

The game tick from which the part turns at BlockEntityRenderPart.Speed, as the server's level counts them (ILevel.Time), which the client follows.

Speed

public float Speed { get; init; }

How fast the part turns, in degrees per tick (20 ticks a second); 0 for a part that doesn't spin.

On this page