# Furniture - complex

{% hint style="warning" %}

#### Requires **ItemsAdder 4.0.9** or greater.

{% endhint %}

To create advanced furniture you have to use the custom entities feature of ItemsAdder.\
Please read the tutorial on how to create custom entities before:

{% content-ref url="/pages/sQ6lt98szIPnHEjj6I9T" %}
[Entities](/japanese/plugin-usage/adding-content/mobs.md)
{% endcontent-ref %}

{% hint style="danger" %}
Custom entities were developed with performance in mind, but they might cause high CPU usage if abused.\
It's advised to limit the amount of complex furnitures using the `max_per_chunk` property and the `config.yml` option `max_per_chunk`.
{% endhint %}

## Furniture item settings

In this example I will create a simple Ceiling Fan furniture.\
This will be used to spawn the furniture on interaction.

```yaml
  ceiling_fan:
    name: Ceiling Fan
    resource:
      material: PAPER
      generate: true
      texture: item/ceiling_fan
    behaviours:
      complex_furniture:
        entity: ceiling_fan
        light_level: 10 # Emits light
        solid: true # Hitbox made of BARRIER blocks
        drop_when_mined: true # Will be dropped when attacked by player
        max_per_chunk: 2 # Max amount of furnitures in chunk
        placement_offset: # Used to adjust the spawn location
          ceiling: -0.5
          wall: 0
          floor: 0
```

Create a file `my_furniture/textures/item/ceiling_fan.png`.

## Furniture custom entity settings

```yaml
entities:
  ceiling_fan:
    model_folder: entity/ceiling_fan
    type: ARMOR_STAND
    gravity: false
```

## Furniture model

Create a new `ItemsAdder Entity Model`.

<figure><img src="/files/CGWKWKVlrlUy2J1Bq1F6" alt=""><figcaption></figcaption></figure>

In this example I called it `ceiling_fan`.

<figure><img src="/files/IwE0DFmLatvddQeXXhTk" alt=""><figcaption></figcaption></figure>

Create your model.

<figure><img src="/files/2UJQmDY2s6JkjXyFLxnC" alt=""><figcaption></figcaption></figure>

Switch to the animation panel.

<figure><img src="/files/MWOHm83ySdX1ZHauCP5S" alt=""><figcaption></figcaption></figure>

Create a new `idle` animation.

<figure><img src="/files/xXclXzuPgjJdT6yzBcge" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/CLyfNL045L8K3C3kbs6S" alt=""><figcaption></figcaption></figure>

Animate the entity as you wish.

<figure><img src="/files/igG6LO5WNpoEyKuZXniS" alt=""><figcaption></figcaption></figure>

Open the entity settings and set the correct namespace. In my example I use `my_furniture`.

<figure><img src="/files/ogXKZAKrhFF5oypkilKe" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/6bJSyFElXOmC3TnAbHmf" alt=""><figcaption></figcaption></figure>

Save the project as `ceiling_fan.iaentity` (for example) inside your namespace folder root.\
You will be able to edit it anytime you want in the future.

<figure><img src="/files/7lA7dh8lLwV4WrtUxejY" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/pMDpUmqcjqxEf4nzgAtj" alt=""><figcaption></figcaption></figure>

Export the model. This is the model file that will be loaded by ItemsAdder.

<figure><img src="/files/7LgeEPEWr6Z3daySopmE" alt=""><figcaption></figcaption></figure>

Get the item ingame using `/iaget my_furniture:ceiling_fan`.

<figure><img src="/files/sqIJWyy3iniWcfCP0f6X" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://itemsadder.devs.beer/japanese/plugin-usage/adding-content/furniture-complex.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
