-
Notifications
You must be signed in to change notification settings - Fork 0
Media
Components that render game-world content into a UI box.
Wraps InventoryScreen.drawEntity to draw any LivingEntity (player, mob, ...) inside a UI rect. By default the entity follows the cursor with the same atan-smoothed rotation as the vanilla inventory paperdoll; pass mouseTracksRotation = false to lock the view to the front so the entity's own bodyYaw / headYaw / pitch fields drive the pose.
PlayerRender(LivingEntity entity)
PlayerRender(LivingEntity entity, Style style)
PlayerRender(Supplier<LivingEntity> entitySupplier)
PlayerRender(Supplier<LivingEntity> entitySupplier, Style style)
PlayerRender(Supplier<LivingEntity> entitySupplier, Style style,
int entitySize, boolean mouseTracksRotation)
PlayerRender(Supplier<LivingEntity> entitySupplier, Style style,
int entitySize, boolean mouseTracksRotation, float bottomOffset)PlayerRender(MinecraftClient.getInstance().player,
Style.width(120).height(180)
.backgroundColor(0xFF_22_22_22)
.borderRadius(8)
.build());
// Hot-swap which entity is drawn — supplier is read every frame.
State<LivingEntity> npc = State.of(initialNpc);
PlayerRender(npc::get,
Style.width(120).height(180).build(),
/* entitySize */ 90,
/* mouseTracksRotation */ true,
/* bottomOffset */ 0f);Parameters:
-
entitySize— thesizeargument forwarded toInventoryScreen.drawEntity. Default chosen to fit the component bounds. -
mouseTracksRotation— whentrue, the entity'sbodyYawandheadYawsmoothly track the cursor; whenfalse, they're left untouched and the entity faces forward. -
bottomOffset— fractional offset for the entity's feet relative to the bottom of the bounds (0.0= on the floor of the rect). Useful for centering entities of varying heights.
The component pushes a +100 Z translation onto the matrix stack before calling drawEntity and pops it after, so the 3D entity render stays above the surrounding 2D draws.
Convenience wrapper that auto-binds to MinecraftClient.getInstance().player. Renders nothing while the player is null (main menu, before world join).
LocalPlayer()
LocalPlayer(Style style)LocalPlayer(Style.width(120).height(180)
.backgroundColor(0xFF_22_22_22)
.borderRadius(8)
.build());This is just PlayerRender(() -> MinecraftClient.getInstance().player, style) — use the underlying factory directly if you need the entity-size or rotation controls.
Video. A full FFmpeg-backed
Video/VideoPlayerlives on thefeature/video-playerbranch but is not merged tomaster. It's tracked inFEATURES.mdas a side branch and isn't part of the public API yet.