Items

Back to PackEngine

A minimal item

{
  "id": "medkit",
  "type": "consumable",
  "model": "my_pack:geo/item/medkit.geo.json",
  "texture": "my_pack:textures/item/medkit.png",
  "animation": "my_pack:animations/item/medkit.animation.json",
  "idle_animation": "idle",
  "use_animation": "use"
}

Item IDs

The item above has the logical ID my_pack:medkit. Packs are found at runtime, after mods have registered their items, so the real registry ID is packengine:my_pack_medkit. Use that one in /give, recipes and tags.

Core fields

Field Type Default Meaning
id string required The item’s path inside the pack namespace.
display_name string id, tidied up Name in the inventory and tooltip.
translation_key string none Lang key for the name. Wins over display_name.
lore string or array empty Gray tooltip lines, as written.
lore_translation_keys string or array empty Gray tooltip lines from lang keys.
type enum device consumable, device or equippable.
stack_size integer 1 Largest stack. Ignored when use_mode is multiple.
model resource location required Bedrock .geo.json model.
texture resource location required Item texture .png.
animation resource location required Bedrock or GeckoLib animation JSON.
camera_bone string none Bone whose pivot is the first-person camera origin.
first_person_offset 3 numbers none XYZ offset in Bedrock units, set by hand.
hide_second_skin_layer boolean false Hide the second skin layer on the first-person arms.
flip_arms boolean true Turn the first-person arms 180 degrees on X when camera_bone is set.
icon resource location none Flat inventory sprite (ns:textures/item/x.png). The 3D model still shows in hand, on the ground and in item frames.
held_icon resource location none Flat sprite shown in third-person hands and on the ground in place of the 3D model, sized like a vanilla item. Without it the first-person model is drawn there.
third_person_animation resource location none Animation file that poses the holder’s body in third person. See Third-person animations.
follow_head list of part names [] Parts of third_person_animation that also turn with the head, e.g. ["left_arm"] for a hand reaching to the face.

Item types

consumable and device both use the use system. A consumable is used up once by default (single_use); a device can be used forever by default (infinite).

equippable has no use behavior yet, but its equip and unequip animations play. The old misspelling equipable still works.

Translations

Folder packs keep translations in lang/<locale>.json:

{
  "item.my_pack.medkit": "Field Medkit",
  "tooltip.my_pack.medkit": "Restores health over time"
}

First-person arms

Give the model a left_hand and a right_hand bone. The player’s arms are drawn at them. A camera_bone can also animate the camera’s rotation. Avoid position keyframes on the camera bone, because its position is used to center the model.

The second skin layer

The arms are the player’s own and have two parts: the solid arm, and the second skin layer that a skin draws slightly outside the arm for sleeves and jackets. If your model has something wrapped tight around the arm, like a bandage or a splint, a bulky sleeve layer pokes through it. Turn the layer off for that item:

{
  "hide_second_skin_layer": true
}

The solid arm still uses the player’s skin, and only this item’s first-person arms change.

Arm orientation

With a camera_bone, the arms are turned 180 degrees on X. A proxy arm built the usual way points the opposite way to a vanilla arm hanging from its shoulder, and the turn lines them up. Every camera-bone pack made so far has needed it, so it’s on by default.

A model rigged the other way comes out with its arms reversed, shoulder where the hand should be. You can tell from the hand bones’ rest rotation:

Rig Hand bone rest rotation
Usual Negative X, around -120, with no large Z.
Reversed Positive X of about the same size, usually with a Z roll near 180 to make up for it.

For a reversed rig, turn the flip off:

{
  "flip_arms": false
}

flip_arms does nothing without a camera_bone. You could instead re-rig the hand bones the usual way, but then the rest pose has to be fixed in every clip.