# Animations

## Opening the animations editor

Create a new "`ItemsAdder Entity Model`".\
You can create as many as animations files you want.

<figure><img src="https://708574821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M28TcKgSDvuFN510qye-887967055%2Fuploads%2Fgit-blob-675a9df6a10222c056b1d603421347636075bc2f%2Fia-entities-new.png?alt=media" alt=""><figcaption></figcaption></figure>

Decide if you want to create an emotes file with examples or a blank emotes file.

<figure><img src="https://708574821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M28TcKgSDvuFN510qye-887967055%2Fuploads%2Fgit-blob-c7e679f64293a92a62b1d70540f73d2505d6f7a1%2Fia-entities-new2.png?alt=media" alt=""><figcaption></figcaption></figure>

Decide a name for your emotes pack.

<figure><img src="https://708574821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M28TcKgSDvuFN510qye-887967055%2Fuploads%2Fgit-blob-49b12b89c2771a49a000cdb84ffcda11cdb4015c%2Fia-entities-new3.png?alt=media" alt=""><figcaption></figcaption></figure>

You can notice a lot of example animations on the left.

![](https://708574821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M28TcKgSDvuFN510qye-887967055%2Fuploads%2Fgit-blob-9e81497930aec142dc46be05dd40d4bafd945d73%2Fimage.png?alt=media)

Delete all the emotes and edit/rename the ones you want.\
They are useful only as base for your new emotes, to have an example to learn from.

![](https://708574821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M28TcKgSDvuFN510qye-887967055%2Fuploads%2Fgit-blob-83ab86223ffbee004f063a04b1743e9b361961cd%2Fimage.png?alt=media)

You can animate your models normally, like you would do with normal Blockbench models.\
You can find a lot of tutorials on YouTube.

{% embed url="<https://www.youtube.com/results?search_query=blockbench+animation+tutorial>" %}

When you are finished, save your `.iaentitymodel` project file into this folder (change `my_emotes` to your namespace, this one is an example):\
`ItemsAdder/contents/my_emotes/`

<figure><img src="https://708574821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M28TcKgSDvuFN510qye-887967055%2Fuploads%2Fgit-blob-a1b885e47ee5291cce30ee915967797fb8b0a50b%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Then continue following the tutorial to know how to export the emotes into ItemsAdder.

### Apply the changes to ItemsAdder

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

![](https://708574821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M28TcKgSDvuFN510qye-887967055%2Fuploads%2Fgit-blob-db50cf90c1777919244cb567874e9df62895681e%2Fimage.png?alt=media)

You should get a success message.

![](https://708574821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M28TcKgSDvuFN510qye-887967055%2Fuploads%2Fgit-blob-c7e1614f5b730a2f4b25f6f04a7f831fd2df0992%2Fimage.png?alt=media)

{% hint style="success" %}
If you didn't add any custom model into your emote there is <mark style="color:green;">no need</mark> to use `/iazip`!\
Use the command `/iareload` to load the new animation in the game.
{% endhint %}

## Playing the animations

Use the emote command: `/iaemote <emote> [player]` or `/emote <emote> [player]`

## Emote permission

Use the `/iaemote` command: `ia.user.iaemote`

Use an emote: `ia.user.iaemote.use.<emote>`\
Example: `ia.user.iaemote.use.yes`

### More info about permissions

{% content-ref url="../../plugin-usage/plugin-configuration/permissions" %}
[permissions](https://itemsadder.devs.beer/plugin-usage/plugin-configuration/permissions)
{% endcontent-ref %}

### Showcase of some examples

{% embed url="<https://youtu.be/VnFNzmhAVIM>" %}

{% embed url="<https://youtu.be/aP5Jz9OW208>" fullWidth="false" %}

### Here you can download an example project:

{% embed url="<https://raw.githubusercontent.com/LoneDev6/SpigotUtilities/master/ItemsAdder/various_files/example_advanced_emotes.iaentitymodel>" %}

You can add custom models to your emotes, for example: items, monsters, furniture, animated effects.

### Important

{% hint style="warning" %}

* DO NOT delete any built-in player bone.
* DO NOT resize any built-in player bone, it simply won't work ingame.
* Edit built-in player bones only in the animation view (rotate, move).
* You can hide the built-in player bones using scale to `0,0,0`. Set to `1,1,1` to show them again.
  {% endhint %}

### Different type of emotes

* `.player_advanced_animations` file format is now used to identify player animations which also add custom models to the emote.
* `.player_animations` are the player animations which don't add any custom model but will be loaded into the default player model.

In order to decide that you have to set this option in the **Blockbench** extension settings.

[![image](https://708574821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M28TcKgSDvuFN510qye-887967055%2Fuploads%2Fgit-blob-709ef135958aee6f3cbff88ca61a4cdd2870b007%2Femotes_advanced_1.png?alt=media)](https://user-images.githubusercontent.com/27242001/244145963-c9ca9a77-bb79-4804-92e4-8708eac41517.png)

<figure><img src="https://708574821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M28TcKgSDvuFN510qye-887967055%2Fuploads%2Fgit-blob-5d55a32cc97dabe24c0647e0f64fcefce5d0868b%2Femotes_advanced_2.png?alt=media" alt=""><figcaption></figcaption></figure>

### Importing elements into the scene

You can import any `.bbmodel` into the scene and use it in your animation.\
You can also import extruded textures to show items dynamically.

<figure><img src="https://708574821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M28TcKgSDvuFN510qye-887967055%2Fuploads%2Fgit-blob-a978f7011b43be4e0cfa354d025f29c32ec1d093%2Femotes_advanced_3.png?alt=media" alt=""><figcaption></figcaption></figure>

### Hiding unused elements in other animations of the game `.iaentitymodel` emotes file

1. select the animation
2. select the element you want to hide for a particular animation
3. move to the first frame of the animation, using the timeline
4. create a new scale key, make sure to set it to the first keyframe
5. set scale to 0

Now your model won't be shown for this particular animation.\
You can show/hide it in the middle of the animation just by doing the same thing but setting scale to 1.

<figure><img src="https://708574821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M28TcKgSDvuFN510qye-887967055%2Fuploads%2Fgit-blob-03bed5281faed49a7525a9a63960e658859ab6e5%2Femotes_advanced_4.png?alt=media" alt=""><figcaption></figcaption></figure>

## Lock the player movement

You can specify if the player can move while playing one specific animation or not.

![](https://708574821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M28TcKgSDvuFN510qye-887967055%2Fuploads%2Fgit-blob-d6187eecdaff3582037be61d4c79f9df22712039%2Fimage.png?alt=media)

## Looping animations

You can create animations which would play `start` -> `loop` -> `end` sub-animation.\
This allows you to create complex looping animations, for example a sleep animation where your player would lay and stay there until the player presses SHIFT.

### Step 1

Create the animation, in this example a death animation.

![](https://708574821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M28TcKgSDvuFN510qye-887967055%2Fuploads%2Fgit-blob-e1d6866e890f475d015ad644b0bf3d419ca3a275%2Fimage.png?alt=media)

Right click it and mark it as `Loop`.

![](https://708574821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M28TcKgSDvuFN510qye-887967055%2Fuploads%2Fgit-blob-bd73e693b4e608a8efa092ec5988b408b1992232%2Fimage.png?alt=media)

### Step 2

Now place the cursor on the frame where you want the loop to start, in this case when the player is on the ground.

![](https://708574821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M28TcKgSDvuFN510qye-887967055%2Fuploads%2Fgit-blob-35897386f4ee128c909c3eaad5337e89453f971f%2Fimage.png?alt=media)

### Step 3

Click on the `Add Loop Start/End marker` icon to add a `start loop` marker.

![](https://708574821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M28TcKgSDvuFN510qye-887967055%2Fuploads%2Fgit-blob-89677e607c0b7d7cc56ee543bf8869ef126aa7aa%2Fimage.png?alt=media)

Now place the animation cursor on the frame where you want the loop to stop and press again on the `Add Loop Start/End marker` icon.

![](https://708574821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M28TcKgSDvuFN510qye-887967055%2Fuploads%2Fgit-blob-c2b9010cc29b3e34ce4349ecceb5a5ea58f9bed5%2Fimage.png?alt=media)

The result will be like this:

![](https://708574821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M28TcKgSDvuFN510qye-887967055%2Fuploads%2Fgit-blob-c98513a6b9f0e630807ac12179ced420282ee9e1%2Fimage.png?alt=media)
