# Animated Items

### 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.


---

# 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://glitchtechs.gitbook.io/galaxy/starapi-spigot-paper/inventory-utilities/animated-items.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.
