Skip to main content

Drawing entity portraits with actor_portrait_renderer

actor_portrait_renderer draws one entity from the world inside a UI control. Vanilla uses it in one place only, the NPC screen (skin_model in npc_interact_screen.json), and writes no property_bag. Which entity it draws and how is set by keys in property_bag, and those keys appear neither in the vanilla files nor in the community records. This page is a sub plan of Deep research on little-known elements and records how those keys behaved on the HUD and how to use them.

1. Summary​

  • With an integer actor_id in a static property_bag, it draws that entity. The value is the Script API entity.id (the unique entity id saved in the world). It drew players, a pig, a horse, a cat and an armor stand, and did not draw a minecart or a boat.
  • scale_*, rotate_*, translate_x and translate_y change the size, direction and position, and rotate_mode: "auto" keeps it turning. These values can be changed at runtime through bindings.
  • Limit: hard to use dynamically from an add-on. JSON UI expressions handle only 32-bit integers, and this renderer needs a 64-bit integer id. Entity ids are always outside the 32-bit range, and only the low 32 bits survive a binding or an expression. The renderer does not accept strings or floats (section 4).
  • What works: a static id. Where the entity id can be controlled, as in private server software, write a given entity's id into the resource pack's property_bag in advance as a JSON integer and use that id for the entity; the renderer then draws it.
  • A control made by the title factory is rebuilt each time the title is sent again, and the rotation rewinds.
  • The NPC edit screen writes these keys again for each cell and overwrites what a pack sets.
  • Among the six renderers that draw entities, this is the only one that picks an entity by an integer id and takes free transforms. When only your own look is needed, the player renderers that need no id fit better (section 7).

2. property_bag keys​

KeyValueMeasured
actor_idJSON integer (64-bit)Writing the number in the entity.id string as a JSON integer drew that entity. The renderer does not accept the same number as a JSON string or a float. Passing it through a binding or an expression also drew nothing: expressions handle only 32-bit integers and cannot hold a 64-bit id (section 4)
scale_x, scale_y, scale_znumber, default 10.5 gave half size. Shrinking only scale_y flattens it vertically
rotate_x, rotate_y, rotate_znumber (degrees), default 0rotate_y 180 showed the back and rotate_x 45 tilted it forward. rotate_z turns around the axis into the screen: 45 tilts it and 90 lays it down
translate_x, translate_ynumber, default 01 is one UI pixel. Positive translate_x moves right and positive translate_y moves down. With rotate_y 90 it still moves in screen space
translate_znumber, default 050 changed nothing
rotate_modestring"auto" keeps it turning (section 5)
use_live_animationbooleanNo visible difference among true, false and no key. With the player looking up (-60) or down (60), all three faced forward
skinstring (JSON)"{\"variant\":3}" changed the horse coat and "{\"variant\":5}" the cat coat. "{\"mark_variant\":2}" added white markings to the horse

Emote, attack and sneak animations showed in every cell regardless of the keys. No cell followed walking or the view direction. The drawn size follows the entity size, so in the same cell a cat is tiny and a horse is about as tall as a player.

3. Drawing your own portrait on the HUD​

"portrait": {
"type": "custom",
"renderer": "actor_portrait_renderer",
"size": [ 44, 63 ],
"enable_scissor_test": true,
"layer": 2,
"property_bag": { "actor_id": -4294967295, "rotate_mode": "auto" }
}
  • The size follows the control size. At the size above, the whole player was drawn aligned to the bottom of the cell.
  • The player id differs per world. In the tests on this page it was -4294967295 and -8589934591. By the rule in section 4.1, the first is a player who first joined in the first session that loaded the world, and the second one who first joined in the second session (inferred). With a different id nothing is drawn. The example add-on shows your id on the action bar so you can tell whether it matches.
  • To show it on the HUD, declare hud_title_text_factory once more on root_panel as in section 3.2 of HUD item icons, and pick the panel by the title text.

4. Entity ids and usage limits​

4.1 How entity ids are assigned​

  • When a world loads, the game takes worldStartCount from level.dat (negative when read as 32 bits) as the upper 32 bits for that session, and right away saves the value minus 1 to the file.
  • An entity id is worldStartCount x 2^32 + the sequence number in that session, and the sequence starts at 1.
  • Once assigned, an id does not change when the world is entered again.
ObservationValue
A pig summoned in the session entered while the file held -102-438086664191 = -102 x 2^32 + 1
A minecart and a boat summoned next in that session-102 x 2^32 + 2, + 3
The file right after entering that session-103
Pigs summoned in earlier sessionsupper values -98, -99, -101
The player of the same world-8589934591 = -2 x 2^32 + 1 (looks like it first joined in the second session)

So every entity id, players included, is outside the 32-bit integer range (-2147483648 to 2147483647).

4.2 What can change at runtime​

The transform keys can be changed at runtime through bindings. When the script changed only the subtitle to 0, 45 and 90 with updateSubtitle, the cells that bound the subtitle turned into a number ((('' + #s) + 0)) followed along without the title being sent again.

KeyResult
rotate_x, rotate_y, rotate_zturned by 45 and 90
translate_x, translate_ymoved by the value
scale_x, scale_y, scale_zwith ((('' + #s) + 0) * .01) and 25 sent, it became 0.25 times
"bindings": [
{ "binding_name": "#hud_subtitle_text_string", "binding_name_override": "#s", "binding_type": "global" },
{ "binding_type": "view", "source_property_name": "(('' + #s) + 0)", "target_property_name": "rotate_y" }
]

The binding target has to be the key name without # (rotate_y). Writing to #rotate_y changed nothing.

4.3 Why actor_id cannot be set at runtime​

The integers bindings handle are 32-bit. When a binding reads an integer it keeps only the low 32 bits, so a 64-bit entity id becomes another value once it passes through a binding.

Value read by a binding expressionResult
-8589934591 in property_bag1
2147483648 in property_bag-2147483648
2147483647 + 1-2147483648
65536 * 655360
literals 2147483648, 4294967296empty
subtitle string 12 turned into a number with ('' + #s) plus 113
subtitle string -8589934591 turned the same wayempty

Of the ways tried to fill actor_id, only a static integer and a variable holding one drew.

WayResult
JSON integer, variable holding a JSON integer ("$id": -8589934591)drew
JSON integer picked with requires in variablesdrew
JSON string "-8589934591", float -8589934591.0empty
string variable ($subtitle_text), an expression like "($subtitle_text * 1)"empty
string binding, quoted string binding (('"' + #s + '"'))empty
expressions meant to make a number (('' + #s), (#s - 0), (#s * 1))empty
moving a 64-bit integer from the same property_bag or another control without an expression ("source_property_name": "#src")empty. Moving 90 to rotate_z the same way worked

The processing read in the client code (Android 1.26.52.3) agrees (code).

  • The renderer picks the entity only by actor_id in property_bag. It checks only that the JSON kind of the value is integer, reads it as 64 bits, and looks up the entity with that id in the level.
  • It draws only when the ActorTypeComponent type of the entity found has the mob bit (0x100). This matches the measurement that a minecart and a boat were not drawn.
  • The only engine code that writes a 64-bit integer to actor_id in property_bag is the NPC screen callback (section 6). C++ writes that value directly, without bindings.

#entity_id of live_horse_renderer takes a string that the engine parses into an integer, so it can be passed through a binding. actor_portrait_renderer takes only integers, so the same way does not work.

4.4 What works​

  • Entities whose id does not change: entity ids stay the same after the world is entered again. Summon an entity such as an NPC once in a map or on a server, read its entity.id, and write that value into the resource pack to keep drawing it.
  • Picking from candidate ids: write candidate ids as JSON integers, and pick with requires the candidate equal to the id the script sends in the title or subtitle. The title factory rebuilds the control each time a title arrives, so the value picked then goes in.
"variables": [
{ "requires": "($subtitle_text = '-4294967295')", "$bag": { "actor_id": -4294967295 } },
{ "requires": "($subtitle_text = '-8589934591')", "$bag": { "actor_id": -8589934591 } }
]
  • The id of the owner of a single player world has the form -k x 2^32 + 1, and the k values seen so far are 1 and 2. A few candidates should therefore cover most owners. The k on first entry into a new world was not measured.
  • In a multiplayer world, a player who joins later has an upper value as large as the number of world loads until then, and a sequence number as large as the entities made before them in that session. Candidates cannot cover them.

5. Why the rotation rewinds​

The probe pack first sent the title again every second while the item was held, and the "auto" cell kept turning and snapping back to the starting angle. When the title arrives again, the title factory rebuilds the control, and the new control starts its rotation from 0 (the same cause as ANI-12). With the title sent only once and a long stay time, it turned without breaks.

Put turning portraits in controls whose content does not change often. If the title has to carry other information often, move the portrait to another factory or a fixed control. updateSubtitle, which changes only the subtitle, changed the values of the same cells as in section 4.2.

6. The NPC screen​

The skin list of the NPC edit screen draws each NPC skin with this renderer. Adding property_bag { "rotate_mode": "auto", "scale_*": 0.6 } to npc_interact.skin_model from a resource pack changed nothing. Instead, only the hovered skin turned, and the portraits turned along when the real NPC turned its head. The screen writes the skin transform, rotate_mode ("auto" only for the hovered cell) and actor_id (that NPC) again for each cell (code). C++ reads these values from the NPC's NpcComponent and writes them directly. The portraits on this screen cannot be changed by a pack. The NPC dialogue screen was not tested.

7. Differences from other entity renderers​

This compares the other renderers that draw entities or characters. The keys and behavior of each were read from the client code (Android 1.26.52), and apart from the measured actor_portrait_renderer row nothing in this section was tested in game (code).

RendererWhat it drawsHow it is pickedRotationVanilla use
actor_portrait_renderera mob in the worldinteger actor_id in property_bag (static values only)size, rotation and offset in property_bag (changeable at runtime through bindings), and rotate_mode: "auto". Does not look at the cursorNPC screen
live_horse_renderera mob in the world#entity_id (string only; written as an integer it draws nothing)always looks at the cursor, with no key to turn it offhorse screen
live_player_rendererthe local playercannot be pickedfixed front view. With #look_at_cursor: true the head and body look at the cursorinventory screen
hud_player_rendererthe local playercannot be pickedfixed at an angle. Drawn only for a few seconds after the player state changesHUD doll
paper_doll_renderera model built from a skin, not a world entitythe selected skin, #skin_idx with #pack_id, #skin_name, #player_uuidrotation (auto, gesture_x, custom_y), #custom_rot_y, #set_target_rotation. Animations are picked with #animation_to_playpause screen, skin screens
equipment_preview_rendererthe item worn by an armor stand it creates itself#item_id_aux, dye color, armor trimfixed anglesmithing table

7.1 Keys and conditions per renderer​

live_horse_renderer

  • Key read: only #entity_id in property_bag. It must be a string, which the engine parses as a decimal integer. Written as a JSON integer it cannot be read and nothing is drawn. The vanilla horse screen gets this value through a binding.
  • Condition: the entity found must be in the mob category. Item entities, projectiles and the like are not drawn. It does not check for the horse screen, so it would likely draw on other screens too when given #entity_id (inferred).
  • Rotation: the head and body always face the cursor (the arctangent of the horizontal and vertical distance divided by 40, times 20 degrees). Inputs other than the mouse use a fixed distance. The size follows the control width.
  • Measured (Windows 1.26.65, 2026-11-28, InventoryMonitor in a chest screen): a fake player (AddPlayer) and a wither skeleton (AddActor) that the server sent only to the viewer were drawn, with their armor and items in both hands. A mob is drawn with its feet at the middle of the control, so move the renderer down to fit the whole body in the box. With two renderers given the same #entity_id, only the last one was drawn. When the value comes from a slot name (#hover_text), it is emptied for a moment on every slot press and the model flickers, so read it through a BND-18 latch (HOST-50).

live_player_renderer

  • Draws: only the local player. It takes no id. There is a loop that also draws entities linked to the player (not identified).
  • Key read: #look_at_cursor in property_bag (on only when it is boolean true). The vanilla PC inventory screen sets true; the pocket inventory screen has no key.
  • Rotation: turned 180 degrees to face front. With #look_at_cursor the head and body face the cursor, otherwise they are fixed. The size is the smaller of width and height. There is a branch that shrinks it to 0.6 and tilts it for player states such as sleeping (state names inferred).

hud_player_renderer

  • Draws: only the local player. It reads no keys.
  • Rotation: a fixed angled pose with the body and head turned -22.5 degrees.
  • Condition: when the player state changes it sets a timer to 3 seconds and draws only during that time. This is the doll that briefly appears at the top left of the HUD.

paper_doll_renderer

  • Draws: a player model built from a skin, not a world entity. It draws even in menus without a world.
  • Skin choice: the control properties use_selected_skin (default true), use_uuid, use_skin_by_name, and #skin_idx, #pack_id, #skin_name, #player_uuid in property_bag.
  • Rotation: the control property rotation picks auto (accumulated time x 30 degrees), gesture_x (drag) or custom_y (the #custom_rot_y value), and starting_rotation and camera_tilt_degrees set the start angle and camera tilt. Given #set_target_rotation, it turns to that angle and then goes back to its previous mode. Vanilla turns on auto with #skin_rotation.
  • Animation: picked with #animation_to_play, #animation_to_play_when_done and #sound_to_play. With #disable_head_follow_mouse the head does not follow the cursor.

equipment_preview_renderer

  • Draws: the item worn by a minecraft:armor_stand the renderer creates itself.
  • Keys read: #item_id_aux, #item_custom_color, #armor_trim_pattern, #armor_trim_material.
  • Rotation: a fixed angle. The vanilla smithing table gives rotation_x 30 and rotation_y -30.

7.2 Which to use​

GoalRenderer
One given entity at a chosen angle and size, or turning continuouslyactor_portrait_renderer
A mob the screen tells you about (string id), shown looking at the cursorlive_horse_renderer
Your own look without an id, also in multiplayer worldslive_player_renderer, paper_doll_renderer
Skin preview, drag to rotate or picking animations in menus outside a worldpaper_doll_renderer
Previewing armor or trim itemsequipment_preview_renderer
  • actor_portrait_renderer is the only one that picks a mob by an integer id and freely changes its size and direction. In exchange the id has to be written into the resource pack in advance (section 4.3).
  • live_horse_renderer takes the id as a string, so a binding might be able to change it. It always looks at the cursor, so it does not suit a HUD portrait.
  • The three renderers that draw the player need no id but have no transform keys.

8. Example add-on​

Download: [bedrock-research]actor-portrait_v1.1.0.mcaddon
[bedrock-research]actor-portrait v1.1.0 · 4.3 KB · Test item bwiki:actor_portrait_test
  1. Open the file to import it (on mobile, tap the file and open it with Minecraft). In a new single player world, turn on the behavior pack starting with [bedrock-research]actor-portrait-bp. The resource pack comes along as a dependency and no experiment toggles are needed.
  2. Take "Actor Portrait" (spyglass) from the end of the items category in the creative inventory, or use /give @s bwiki:actor_portrait_test.
  3. While it is held, four portraits appear at the top left of the HUD. Still stays as is, Auto keeps turning, Back shows the back at half size and Tilt leans forward. They disappear when you put it away.
  • v1.1.0 uses the candidate method of section 4.4. The script sends your entity.id as the subtitle of the title apt, and each cell picks with requires the value equal to the subtitle among 32 candidates -k x 2^32 + 1 (k = 1 to 32) and puts it in actor_id. If your id is not among the candidates, the portraits are empty and the action bar says so.
  • When you put the item away, the title @s clear command clears the title. Whether it was shown is kept in a player dynamic property, so it is cleared even after the script reloads. v1.0.0 called clearTitle, which Script API 2.0.0 does not have, so it errored and the title stayed.
  • The apt text in the middle and the id below it are the vanilla title and subtitle. They are not hidden so that other HUD examples can run alongside.
  • v1.1.0 has not been run in game yet. Picking candidates with requires and the way of clearing the title were each confirmed with probe packs (sections 4.3 and 9).
  • The on-screen text is in English.

The example add-on v1.0.0 HUD. At the top left are four cells: Still (front), Auto (turning, seen from the side), Back (half size, back) and Tilt (leaning forward so the top of the head shows), and the action bar reads Actor Portrait v1.0.0 portraits show you

9. Measurement record​

Measured on a touch input device on 2026-11-17 with the research repository probe pack (ui-key-probe v1.0.0~v1.0.1, source abbreviation UKP). Besides the four cells above, the probe pack also had cells for translate_x, use_live_animation and an expression id, plus the NPC screen change. The example add-on carries over only the keys whose behavior was confirmed. The example add-on v1.0.0 was also run on the same device, and all four cells were drawn as planned (picture above).

On 2026-11-20, probe packs in a Windows 1.26.65.1 single player world measured why the v1.0.0 title stayed (the clearTitle call errored) and the fix with title @s clear (cleared even after /reload), the id rule and the injection methods of section 4, rotate_z, translate_*, skin, use_live_animation and non-mob entities of section 2, and the runtime transforms of section 4.2. The code content of section 4.3 was read by decompiling the Android 1.26.52.3 client library.

What is left​

  • The owner's id on first entry into a new world (whether k is always 1).
  • What use_live_animation changes. The code sets part of the body and head rotation to 0 when it is false, but no difference showed with the head angle.
  • Whether it draws with ids set by a custom server, consoles and mobile, and multiplayer worlds.
IDPageContent
ANI-40, ANI-41, ANI-42Images and animationMeasured property_bag of actor_portrait_renderer
ANI-12Images and animationAnimations restart when a factory rebuilds the control
Sources
idSourceLicenseCommitAccessed
repo-guideJSON UI comprehensive guide (this repository) (guide/)This project's material2026-11-13