Furniture - simple

Tutorial on how to create your first furniture

A furniture is a decorative object which can be solid, emit light, used as chair and can have other features.

Creating a simple furniture

Configuration file

The first step is to create a configuration file in your namespace folder. In this example I called it furniture_example.yml.

furniture_example.yml
info:
  namespace: myitems
items:
  lamp:
    display_name: "Lamp"
    permission: myitems.decorative.lamp
    lore:
    - lore-decorative-item
    resource:
      material: PAPER
      generate: false
      model_path: lamp
    behaviours:
      furniture:
        light_level: 13

As you can see I created the item with some special properties.

behaviours attribute has a special sub-attribute called furniture, this attribute tells ItemsAdder that this item is a placeable furniture model.

Let's add some more settings to it:

furniture_example.yml
  lamp:
    display_name: "Lamp"
    permission: myitems.decorative.lamp
    lore:
    - lore-decorative-item
    resource:
      material: PAPER
      generate: false
      model_path: lamp
    behaviours:
      furniture:
        light_level: 13
        solid: true
        placeable_on:
          floor: true
          ceiling: false
          walls: false
        hitbox:
          height: 1
        sound:
          place:
            name: block.metal.fall
          break:
            name: block.metal.break

I added some properties, in this case I specified where the furniture can be placed (only on the floor), the hitbox size and place/break sounds.

By default the hitbox is 1x1x1, so it's not really needed to specify these options.

Specify them only if the model is bigger than 1x1x1.

For example if you have a furniture which is 1x2x1 you can set it like that:

hitbox:
  height: 2
  length: 1
  width: 1
furniture_example.yml
info:
  namespace: myitems
items:
  lamp:
    display_name: "Lamp"
    permission: myitems.decorative.lamp
    lore:
    - lore-decorative-item
    resource:
      material: PAPER
      generate: false
      model_path: lamp
    behaviours:
      furniture:
        light_level: 13
        solid: true
        placeable_on:
          floor: true
          ceiling: false
          walls: false
        hitbox:
          height: 1
        sound:
          place:
            name: block.metal.fall
          break:
            name: block.metal.break

Model file

Now open BlockBench and create a "Java Block/Item".

Now create your model, in this example I'm modelling an ugly minimal modern lamp.

Edit how the model is shown on player hand:

Configure how the model is shown ingame

Using armor_stand

You have to select the head icon and then small armorstand:

Then you have to shift your model down until it matches the armorstand base:

Using item_display

You have to select the Image icon and then set the Z-offset to -16. This will display the model slighly of the block the Item Frame is attached to, but will be seamless when an invisible Item Frame is used. This is because of how items in invisible Item Frames are slightly lower than usual.

Using item_frame

Same thing of item_display.

Export the model

Now let's save the model file into the correct folder, in this case I set this property in the yml configuration file: model_path: lamp, so you have to save the .json file inside this path: contents/myitems/models/lamp.json.

To achieve this, click on "File" followed by "Export Model" and finally "Export Block/Item Model". In the new window, head over to the path you want to save your model under, give it the right name and confirm the changes.

Saving changes

Now run /iazip (and follow the hosting tutorial if needed).

To obtain the item use this command: /iaget myitems:lamp.

Chair

To create a chair you just have to follow the furniture creation tutorial and add a simple attribute to the furniture to make it "sittable".

Just add the furniture_sit behaviour and specify the sit_height.

behaviours:
  furniture:
    # .....
  furniture_sit:
    sit_height: 0.5

Furniture entity types

item_display

This type of furniture entity is useful for any type of furniture you want to create.

behaviours:
  furniture:
    entity: item_display
    solid: true
    fixed_rotation: true
    hitbox:
      length: 1
      width: 2
      height: 1
      width_offset: 0.5
    placeable_on:
      walls: false
      ceiling: false
      floor: true
  furniture_sit:
    sit_height: 0.5

Special properties

item_display allows you to do some special adjustments to your furniture model using the display_transformation property. You can resize it, rotate it and move it freely. This feature uses the native item_display feature of Minecraft, you can read more here and online. You can also use this tool to preview your changes.

Example

  lava_lamp_new:
    enabled: true
    display_name: display-name-lava_lamp
    permission: iadeco.decorations.lava_lamp
    lore:
      - lore-decorative-item
    resource:
      material: PAPER
      generate: false
      model_path: lava_lamp
    behaviours:
      furniture:
        entity: item_display
        light_level: 7
        display_transformation:
          transform: HEAD
          right_rotation:
            axis_angle:
              angle: 180
              axis:
                x: 0
                y: 1
                z: 0
          translation:
            x: 0
            y: 0.92
            z: 0
          scale:
            x: 0.45
            y: 0.45
            z: 0.45

armor_stand

This type of furniture entity is useful when you want to create chairs, plants, columns, lamps and similar environment decorations which don't need to rotate based on the surface on which you place them.

behaviours:
  furniture:
    entity: armor_stand
    small: true
    solid: true
    fixed_rotation: true
    hitbox:
      length: 1
      width: 2
      height: 1
      width_offset: 0.5
    placeable_on:
      walls: false
      ceiling: false
      floor: true
  furniture_sit:
    sit_height: 0.5

item_frame

This type of furniture entity is useful when you want to make the furniture rotate based on the surface on which you place it.

For example if you have a decorative lamp you can make it placeable on walls, ceiling and ground and and make it oriented automatically based on the surface inclination.

behaviours:
  furniture:
    entity: item_frame
    light_level: 15
    solid: false
    hitbox:
      length: 1
      width: 1
      height: 1.5
    placeable_on:
      walls: true
      ceiling: true
      floor: true

Hitbox

You can make a furniture solid adding the "solid" attribute and specifying a hitbox (if you want > 1x1x1)

  table:
    display_name: display-name-table
    permission: table
    lore:
      - 'lore-decorative-item'
    resource:
      material: OAK_WOOD
      generate: false
      model_path: item/table
    behaviours:
      furniture:
        small: true
        solid: true
        entity: armor_stand
        hitbox:
          length: 1
          width: 1
          height: 1
          length_offset: 0
          width_offset: 0
          height_offset: 0

Hitbox has wrong location

Correct location

I had to set a width offset of 0.5. You can also use negative values if needed.

        hitbox:
          length: 1
          width: 2
          height: 1
          width_offset: 0.5

Preview the hitbox

You can use the command /iahitbox to see the hitbox when you pleace a furniture, it's very useful to detect mistakes in the hitbox configuration

Hitboxes limitations

Limitations

Last updated

Was this helpful?