resourcepack.ai
DOCS

Models

Working furniture

A placed model (furniture or decoration put down from an item) can do more than stand there. It can be a cabinet you fill, a gramophone that plays discs, an oven that cooks, a lamp a click switches on, a sofa that joins the pieces beside it, or a sapling that grows. Each is one key in the item's place: block, and a piece can have several:

Furniture models: a stool, a sofa, a desk setup and a drum kit

cabinet:
  material: PAPER
  model: cabinet
  place:
    storage: true        # a container. Right-click to open it
    jukebox: true        # plays music discs
    states: [...]        # looks a click cycles through: a lamp, a door, a TV
    connects: true       # joins its neighbours, like a sofa
    grow: { ... }        # turns into another piece over time

Whatever a piece holds (a container's contents, a disc, its current state, how long it has been growing) is saved on the piece itself, in the world. It survives a restart, moves with a copied region and goes back with a rolled-back one.

Storage#

A cabinet, a wardrobe, a bin, a crate:

cabinet:
  material: PAPER
  model: cabinet
  name: "&6Oak Cabinet"
  place:
    storage:
      type: chest        # chest | personal | enderchest | disposal | shulker
      rows: 3            # 1-6
      title: "Cabinet"   # & colour codes. Default: the item's name, else "Storage"
      open-sound: minecraft:block.chest.open
      close-sound: minecraft:block.chest.close

storage: true is a three-row chest, and storage: personal is that type with everything else left at its default. Right-click to open it.

TypeWhose contentsWhen it is broken
chestThe piece's. Everybody who opens it sees the same inventory, liveSpills on the ground
personalEach player's own, shared by every piece of that kind: every wardrobe opens the same wardrobe for the same person, and nobody else sees inNothing to spill
enderchestThe player's own vanilla ender chestNothing
disposalNobody's. What goes in is deleted when it closesNothing
shulkerThe piece's, like a chestGives back the item with the contents inside it. Place it again and they are back
  • Two players in one chest share one live inventory and see each other's moves, so items cannot be duplicated between them.
  • Breaking a piece closes anyone's open screen first, then spills the contents. A break another plugin cancels spills nothing. A creative-mode break gives no piece back but still spills the contents, as a chest does.
  • A shulker piece always gives back itself, so it ignores drop:. Empty, it is the same item as a new one and stacks with them.
  • personal is keyed by the item's ID. Rename mypack:wardrobe and everybody's wardrobe starts empty; change the ID back and the old contents return.
  • You can change rows: after people have filled things. A cabinet made smaller still opens big enough for what is in it, and shrinks once the extra rows are empty.

Custom blocks take the same storage: block.

A jukebox#

A gramophone, a radio, a boombox:

gramophone:
  material: PAPER
  model: gramophone
  place:
    jukebox:
      volume: 1.0                       # 1 is a vanilla jukebox, heard ~64 blocks away. Up to 16
      pitch: 1.0                        # 0.5-2
      permission: mypack.jukebox.use    # leave out and anybody may
      playing-model: mypack:gramophone_on   # what it looks like while a disc is in it

jukebox: true is one with every default. A piece can't be a jukebox and a container at once: the container takes the click, and the load warns you. Right-click it holding a music disc to put the disc in (it leaves your hand unless you are in creative) and the record plays at the piece. Right-click again and the disc pops out and the music stops for everyone. Breaking the piece also gives the disc back.

Every vanilla disc works. From Minecraft 1.21, so does a disc a datapack adds, but the server is not told which sound that disc plays, so it plays nothing unless your server has a sound with the song's own ID. The console tells you once per song.

playing-model is an item ID (or a model ID with no item of its own) whose model the piece wears while a disc is in it. It does nothing on an animated piece.

Late arrivals hear nothing

The record is sent once, when the disc goes in, as with a vanilla jukebox. Somebody who walks up halfway through hears nothing until the next disc, and a restart does not resume it. The disc stays in the piece either way.

A furnace#

An oven, a stove, a forge. It works like the real thing and looks like your model:

oven:
  material: PAPER
  model: oven
  place:
    solid: true
    furnace:
      type: furnace             # furnace, smoker or blast_furnace
      title: "Oven"             # leave out for the item's name
      lit-model: mypack:oven_on # what it looks like while it burns
      speed: 2                  # 2 cooks twice as fast as the recipe says
      recipes: [mypack:pizza]   # only these recipes. Leave out for all of its kind's
      screen: mypack:oven_ui    # art for its screen, drawn as a furnace screen
      effects:                  # what it does while it burns. false turns it all off
        particles: { type: flame, count: 2, every: 4, offset: [0, 0.4, 0.45] }
        sound: false            # or a sound id. Leave out for the normal crackle
        glow: true              # the model is drawn fully lit
        light: 13               # real light, 0-15. Not on a solid piece
        animation: burning      # an animated piece's animation while it burns

Left alone, a burning furnace gives off a little smoke and crackles. A solid piece can't give off light, because its block is already a barrier: use glow for those.

furnace: true is a plain furnace, and furnace: smoker is a smoker with everything else left alone. Right-click opens the game's own furnace screen, and it uses fuel, cooks your server's recipes and gives experience as a furnace does.

TypeCooksSpeed
furnaceEverything a furnace smeltsNormal
smokerFoodTwice as fast, and fuel lasts half as long
blast_furnaceOres, armor and toolsTwice as fast, and fuel lasts half as long

It keeps cooking while its chunk is loaded and carries on after a restart. Breaking it drops what is inside and its experience. A smoker or blast furnace shows the furnace screen.

Hoppers work as on the real block: from above fills the input, from the side fills the fuel, and a hopper directly underneath takes the result.

A work block#

A crafting table, an anvil or a loom that looks like your model:

workbench:
  material: PAPER
  model: workbench
  place:
    solid: true
    station: crafting_table

station: can be crafting_table, enchanting_table, anvil, stonecutter, smithing_table, grindstone, loom, cartography_table or brewing_stand. Right-click opens the game's own screen for that block, and everything in it works as usual. An enchanting table counts the bookshelves around the piece, and an anvil never wears out.

A brewing_stand keeps its bottles and fuel on the piece: it brews while its chunk is loaded, carries on after a restart, drops what is inside when broken, and hoppers work on it. It needs Paper 1.20.5 or newer, or Minecraft 26.1 or newer. All the others except the crafting table and enchanting table need Paper, or Spigot 1.21 or newer.

On a custom block#

A custom block can be a furnace, a brewing stand or a work block too, with the same keys. lit-into names another block to become while it burns, which is where its burning look and light go:

stone_oven:
  model: stone_oven
  furnace: { speed: 2, lit-into: mypack:stone_oven_lit }
stone_oven_lit:
  model: stone_oven_lit
  light: 13

In Studio, a model's Edit details has a Works as setting that does this for a placed model without any YAML.

States: lamps, doors and screens#

A click can change a piece. Each entry under states: is one more look that a right-click moves to, after the piece as you defined it. One entry is a switch; three are a television with three channels. After the last state, the next click goes back to the start.

lamp:
  material: PAPER
  model: lamp
  place:
    light: 0                    # dark as placed
    states:
      - model: mypack:lamp_on   # an item whose model to wear. Leave out to keep it
        light: 15               # light in this state. Leave out for the piece's own
        sound: minecraft:block.lever.click   # played on arriving in this state
 
door:
  material: PAPER
  model: door
  place:
    solid: true
    base-sound: minecraft:block.wooden_door.close   # played on going back to the start
    reset-after: 5s             # shuts itself 5 seconds after the last click
    states:
      - turn: 90                # degrees added to the way it faces
        offset: [-0.4, 0, 0.4]  # blocks it moves: right, up, forward
        solid: false
        sound: minecraft:block.wooden_door.open

Anything a state leaves out stays as the piece was defined: a state that only says light: 15 keeps its model, its collision and its angle.

KeyIn a state
modelAn item whose model it wears, or a model ID with no item of its own
light0-15. 0 is dark
solidWhether a barrier stands in it, like the piece's own solid:
turnDegrees added to the way it faces. A hinged door
offset[right, up, forward] in blocks, the same directions as a seat's x, y and z. A sliding door
soundPlayed on arriving in this state

Beside states::

  • reset-after: takes the piece back to the start that long after the last click. Write 10t for ticks, 10s for seconds or 2m for minutes; a bare number is ticks.
  • base-sound: plays when it goes back to the start, by click or by timer.

A state's model: can name a model you never made an item for, such as mypack:lamp_on with only assets/models/lamp_on.bbmodel in the pack. The same goes for playing-model and the connects shapes below. If there is no item or model by that name, the build says so.

A piece turns about its own center and then moves, so a door hinged at one edge is a quarter turn plus an offset that puts that edge back where it was. It swings over a quarter of a second. Its hitbox, and what a vehicle drives into, stay where it was placed.

The state is saved, so a lamp left on is still on after a restart. A piece left open when its chunk unloaded starts its reset-after countdown again when the chunk loads.

Light and collision follow the piece's rules

A solid state gives no light. And the piece only ever changes a block it put there itself: if a player has put a block in the space a model stands in, the model leaves it alone and goes without being solid or lit in that state.

On an animated piece, light, solid and sound work, but model, turn and offset do not, and the load says so. Give it a right-click animation as well and a click does both: the state changes and the animation plays.

Joining up: sofas and counters#

Pieces of the same kind put side by side can join into one run, the way a sofa or a kitchen counter does:

sofa:
  material: PAPER
  model: sofa
  place:
    connects: true      # or name any of them: { straight: ..., left: ..., right: ..., inner: ..., outer: ... }
LookWhere the piece is
straightThe middle of a row, with one of its kind either side
leftThe end with one only on its right
rightThe other end, with one only on its left
innerA corner its back touches
outerA corner its front touches

Each is an item (or a model) to wear. connects: true names them after the piece: sofa_straight, sofa_left and so on. A piece standing alone wears its own model. A joining piece always faces one of four ways (its facing: is treated as cardinal) and joins only pieces of its own kind.

Corners follow the game's own rule for stairs, and a corner model is turned the way the game turns corner stairs, so a corner drawn like vanilla's inner and outer stairs comes out right. Placing or removing a piece updates the row around it.

Which click does what#

A piece can be several of these at once, so a right-click goes to the first that wants it:

  1. The piece's own interact actions run first, and a cancel in them stops the rest.
  2. Sneaking on a piece that has a seat sits, and nothing below runs.
  3. A container opens.
  4. A furnace opens.
  5. A work block opens.
  6. A jukebox takes a click that puts a disc in or takes one out.
  7. States move to the next one, and a right-click animation plays with them.
  8. A right-click animation plays.
  9. Otherwise, a seat is sat on.

Growing#

A piece can turn into another piece over time: a sapling into a tree, a crop through its stages.

rose:
  material: PAPER
  model: rose
  place:
    grow:
      into: mypack:rose_stage2   # the item whose placed piece replaces this one
      after: 10s                 # the least time it stands first. t, s, m; bare = ticks
      chance: 0.5                # the chance per check once that has passed. Default 1
      light: 9                   # the least light at its block. Leave out for any
 
rose_stage2:
  material: PAPER
  model: rose2
  place:
    grow:
      into: mypack:rose_stage3
      after: 2m
 
rose_stage3:
  material: PAPER
  model: rose3
  place: {}                      # the last stage stays

Each piece is checked about once a second. Once it has stood for after, each check has chance of growing it, so a field does not all change at once. The new piece goes in the same block, facing the same way, and starts its own clock.

into has to be an item with a place: block. If it is not, the load says so and the piece never grows.

Growing is not breaking and placing: no break or place event fires, no remove or place actions run, and the piece itself is not given back. Anything it was holding (a disc, a container's contents) drops on the ground.

A piece is only checked while its chunk is loaded. The time keeps counting while nobody is there, so a piece left long enough grows one stage at the first check after somebody comes back. The clock is the game's tick count, so /time set or a frozen daylight cycle does not stop growth.

Custom blocks grow differently, through stages of one block. Use those for crops you want to farm in rows.

From your own plugin#

ModelInfo says what a piece's place: block declared: storage(), jukebox(), states() and grow(). The engine handles every click itself; canceling ModelInteractEvent stops all of it. Growing fires neither ModelBreakEvent nor ModelPlaceEvent. See the plugin API.