# Entity creation

{% hint style="warning" %}
Do not abuse the spawning of these mobs.\
The plugin is very optimized but it can cause lag if you are crazy enough to spawn 600+ entities in front of a player.
{% endhint %}

![](https://2228257718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Faipc4QQKwVS0w1Q604ya%2Fuploads%2Fgit-blob-85ba70aa85a6ae02293a193ef3bf2ff7f07e07aa%2Fezgif.com-gif-maker.webp?alt=media)

{% embed url="<https://youtu.be/cQpIqExVpR0>" %}
Advanced animation features
{% endembed %}

### Main features

* [Blockbench](https://www.blockbench.net/) extension to convert models
* Completely Async, no TPS drops
* Optimized for big servers
* Damage animation
* Fire animation when entity is on fire
* Animate size of bones
* Animate rotation of bones without angles limitations
* Multiple mount seats
* Play sounds and particles in animations
* Show entity hands equipment
* Custom hitbox
* MythicMobs compatibility
* Citizens compatibility

### Limitations

* Head bone rotation works only if the mob head is not too far from the center of the body
* Pressing SHIFT on flying mobs to move down works only on 1.15, 1.17 and 1.18 clients as 1.16 clients have this bug: <https://bugs.mojang.com/browse/MC-202202> .\
  1.16 clients will see players flying if they press SHIFT while on a flying entity while they should still be riding the entity.
* This plugin uses multiple entities to create the animation.\
  Network delay can cause slight animation glitches.\
  It can cause a little lag on servers if you spawn too many entities around players and if your models have too many bones.\
  (NOTE: this plugin is highly optimized so you won't get lag if your server is not a potato)
* Hitbox of Citizens NPCs can't be changed for now, it's a Citizens limitation

## Installing the Blockbench extension

{% hint style="warning" %}
**Before continuing:**

* Make sure you're running **Blockbench 4.1.5** or **greater**
* Make sure you're running the latest ItemsAdder and latest ItemsAdder Blockbench extension
  {% endhint %}

[Download Blockbench](https://www.blockbench.net/) (don't use the web app).

![](https://2228257718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Faipc4QQKwVS0w1Q604ya%2Fuploads%2Fgit-blob-090f37255cc727b9d2a60eba71742df79c64bf38%2Fimage%20\(98\)%20\(1\).png?alt=media)

\
[Download the zip](https://github.com/LoneDev6/itemsadder-entity/releases) `iaentitymodel.zip`

![](https://2228257718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Faipc4QQKwVS0w1Q604ya%2Fuploads%2Fgit-blob-4eae0115d28534b6cdc27549dddeb7fd15aad823%2Fimage%20\(61\).png?alt=media)

Extract it somewhere, then open **Blockbench** and click on File -> Plugins.

![](https://2228257718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Faipc4QQKwVS0w1Q604ya%2Fuploads%2Fgit-blob-f7f9f400f4fd99e2dbb0b4ded13f9395c14be9d5%2Fimage%20\(48\)%20\(1\)%20\(1\).png?alt=media)

Click on the icon to load plugins from file, then select the file `iaentitymodel.js`.

![](https://2228257718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Faipc4QQKwVS0w1Q604ya%2Fuploads%2Fgit-blob-bd4d520839fec0db986934507aa5aada4366ff48%2Fimage%20\(74\)%20\(1\)%20\(1\).png?alt=media)

Press OK

![](https://2228257718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Faipc4QQKwVS0w1Q604ya%2Fuploads%2Fgit-blob-334ee5eda47d912a0440cc9206b1995b2b276459%2Fimage%20\(71\).png?alt=media)

## Converting the model

{% hint style="danger" %}
Remember to make a <mark style="color:red;">**backup**</mark> of your `.bbmodel` file before using this tool!
{% endhint %}

Open your `.bbmodel` project with Blockbench, then click on File -> Convert Project

![](https://2228257718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Faipc4QQKwVS0w1Q604ya%2Fuploads%2Fgit-blob-c6eaa34ccd2a49f1eb740f5f6bef638f4d6ce460%2Fimage%20\(54\).png?alt=media)

![](https://2228257718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Faipc4QQKwVS0w1Q604ya%2Fuploads%2Fgit-blob-b6a9037aabd2019c17c9bcc29650fbb6c9deeb0e%2Fimage%20\(94\)%20\(1\).png?alt=media)

Select "**ItemsAdder Entity Model**" in the **Format** setting, then press **Confirm**.\
Now save the new converted model file in a new folder where you will put only this file.

You will have something like that

![](https://2228257718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Faipc4QQKwVS0w1Q604ya%2Fuploads%2Fgit-blob-9d05e56049b8b21369b9a714c507ed3035846466%2Fimage%20\(60\)%20\(1\)%20\(1\)%20\(1\).png?alt=media)

### Configuring the model

Now you can configure your model based on your preferences. The ItemsAdder extension automatically decided some settings for you but you might need to change them.\
Click on the **ItemsAdder** tab and press **Settings**.

![](https://2228257718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Faipc4QQKwVS0w1Q604ya%2Fuploads%2Fgit-blob-a95c372d5cca27d020c2c4f71b19166453c5e6d2%2Fimage%20\(57\).png?alt=media)

Here you have to decide a namespace for your custom entities.\
The default one is `custom`, but you should decide your own, for example `my_entities`, `hell_mobs`, `npcs`...

![](https://2228257718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Faipc4QQKwVS0w1Q604ya%2Fuploads%2Fgit-blob-b67a92375a1149b2a1521bbcccb9001868fa1771%2Fimage%20\(99\)%20\(1\)%20\(1\).png?alt=media)

The other thing you might need to change is the "**Model Scaling Mode**":

* Max Model size provides 7x7x7 block wide models but limits scaling to shrinking only.
* Max Scaling range provides shrinking and growing up to 3.125x in size, but limits the maximum model size to 3x3x3 blocks

Change "**Max Model Size**" only if you have animated the size of some bones.

![](https://2228257718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Faipc4QQKwVS0w1Q604ya%2Fuploads%2Fgit-blob-d0892334322f9389b7cc0f2bfe88c0997348478c%2Fimage%20\(66\).png?alt=media)

### Export the model

Click on the **ItemsAdder** tab and press **Export**.

![](https://2228257718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Faipc4QQKwVS0w1Q604ya%2Fuploads%2Fgit-blob-e6960f97de6ec021c90e6b0596d8ea78a06e3e70%2Fimage%20\(56\).png?alt=media)

You should get a success message.

![](https://2228257718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Faipc4QQKwVS0w1Q604ya%2Fuploads%2Fgit-blob-f94eab1bc2408f04a048a453fac820391e0f60dc%2Fimage%20\(81\)%20\(1\).png?alt=media)

Now open the folder where you have your model and copy/cut the new generated folder `assets`.

![](https://2228257718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Faipc4QQKwVS0w1Q604ya%2Fuploads%2Fgit-blob-efc243d2ea4854fff37a4290489b28299ac5fd54%2Fimage%20\(83\).png?alt=media)

Now create a new folder inside `ItemsAdder/contents/`, it's your namespace folder. For example mine is `custom`, so the path is `ItemsAdder/contents/custom/`.

Paste the `assets` folder inside the ItemsAdder folder `ItemsAdder/contents/custom/resourcepack/`.

### Creating the ingame entity configuration

Create a new `.yml` configuration file inside `ItemsAdder/contents/custom/configs/` and call it as you prefer, in this example I use one file per-entity, to keep things organized.

{% code title="barman\_robot.yml" %}

```yaml
info:
  namespace: custom
entities:
  barman_robot:
    display_name: "Barman Robot"
    type: ZOMBIE
    model_folder: entity/barman_robot
    silent: true
    can_sun_burn: false
    speed:
      movement: 1
      flying: 0
    max_health: 20
      
```

{% endcode %}

In this example my custom entity will use a ZOMBIE as base entity for its AI.\
You can use any living entity as base entity, depending on your needs.

### Summoning the entity

Use the summon command: `/iaentity summon <entity>`

## Notes

{% hint style="info" %}
Do not create too many bones, keep the model simple, remember this is a blocky pixelated game, use [its style](https://github.com/LoneDev6/Wiki-ItemsAdder/blob/japanese/plugin-usage/adding-content/mobs/advanced-method/broken-reference/README.md).
{% endhint %}
