> For the complete documentation index, see [llms.txt](https://glitchtechs.gitbook.io/galaxy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://glitchtechs.gitbook.io/galaxy/starapi-spigot-paper/inventory-utilities/animated-items.md).

# Animated Items

Create animated items in guis easier

### Overview

The `AnimatedItems` class provides utility methods for adding animated items to inventories in a Minecraft Bukkit server environment. It allows developers to create items that change appearance over time, creating visual effects or dynamic elements in inventories.

### Methods

#### `addAniToInventory`

```java
public static void addAniToInventory(Inventory inventory, Material[] animationMaterials, int amount, int slot, int animationSpeedTicks, String itemName, String... lore)
```

Adds an animated item to the specified inventory with the provided properties.

**Parameters**

* `inventory`: The inventory to add the animated item to.
* `animationMaterials`: An array of materials representing the frames of the animation.
* `amount`: The amount of the item to add to the inventory.
* `slot`: The slot in the inventory where the item should be placed. If negative, the item will be added to the inventory normally.
* `animationSpeedTicks`: The speed of the animation, in server ticks.
* `itemName`: The display name of the animated item. Can be `null` for no name.
* `lore`: An optional array of strings representing the lore of the animated item.

#### `updateAnimatedItem`

```java
private static void updateAnimatedItem(Inventory inventory, int slot, Material material, int amount, String itemName, String... lore)
```

Updates an existing animated item in the specified inventory with new properties.

**Parameters**

* `inventory`: The inventory containing the animated item to be updated.
* `slot`: The slot in the inventory where the item is located.
* `material`: The new material of the animated item.
* `amount`: The new amount of the item.
* `itemName`: The new display name of the animated item.
* `lore`: An optional array of strings representing the new lore of the animated item.

### Notes

* The `AnimatedItems` class allows for the creation of dynamic and visually appealing inventory items that change appearance over time.
* Developers can use the `addAniToInventory` method to add animated items to inventories, specifying the animation frames, speed, and other properties.
* The `updateAnimatedItem` method can be used to modify existing animated items in inventories with new properties, enabling dynamic updates and changes during gameplay.
