# Welcome

### What is CraftVentory? <a href="#fastinventory" id="fastinventory"></a>

**CraftVentory** is a **Java** / **Spigot** library that facilitates the development of **Minecraft inventories**. It enables **developers** to define **fully configurable** inventories in **configuration files** and provide them with **Java code** in **their plugins**.

This library was developed to facilitate the development of in-game inventories. Indeed, making them **fully configurable** is an important feature for **server administrators** but this process is very tedious without an appropriate tool. CraftVentory solves this problem by providing a lot of **built-in features** to help **developers** implement **fully customizable** inventories very easily.

### Features <a href="#features" id="features"></a>

**CraftVentory** comes with the following features:

* Fully customizable **inventories** / **items** / **paginations** from configuration files (**YAML** support).
* Fully customizable **actions** when **clicking** on **items** like sending messages / sounds, executing commands, inventory navigation, etc.
* **Paginations** to paginate a large list of results in an inventory.
* **Placeholders** to display custom values in texts (inventory title, item name / lore, etc.).
* **Inventory history** to enable players to easily navigate between inventories (home, backward, forward).
* **I18n** support.
* **Enhancements** to dynamically modify inventory properties with **Java code**.
* **Hooks** to execute custom **Java code** for an inventory when specific **events** happen.

### Setup

To use CraftVentory, you can directly include the JAR file as a dependency of your plugin. This JAR file can be downloaded on the [Releases page](https://github.com/Syr0ws/CraftVentory/releases) of the GitHub repository of the project.

The library can also be included in your project by using a dependency manager like **Maven** or **Gradle**.

{% tabs %}
{% tab title="Maven" %}

```xml
<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>

<dependency>
    <groupId>com.github.Syr0ws</groupId>
    <artifactId>CraftVentory</artifactId>
    <version>{VERSION}</version>
    <scope>compile</scope>
</dependency>
```

{% endtab %}

{% tab title="Gradle" %}

```gradle
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
}

dependencies {
    implementation 'com.github.Syr0ws:CraftVentory:{VERSION}'
}
```

{% endtab %}
{% endtabs %}

After being added as a dependency, you must initialize the library by following this [tutorial](https://syrows-development.gitbook.io/craftventory/get-started/initialize-the-library).

### Useful links <a href="#useful-links" id="useful-links"></a>

* [GitHub](https://github.com/Syr0ws/CraftVentory)
* [Spigot](https://www.spigotmc.org/resources/craftventory-create-configurable-inventories-1-17.119850/)
* [Discord](https://discord.gg/sPUSHb2xDK)

### Example <a href="#useful-links" id="useful-links"></a>

<div align="left"><figure><img src="/files/KPj0Si71I3QZnERdCERc" alt=""><figcaption></figcaption></figure></div>

**Configuration :**

```yaml
inventory-id: "warp-inventory"

type: "CHEST_9x6"

title: "&6Warps"

pattern:
  - "OOOOOOOOO"
  - "OYYWWWYYO"
  - "OY1W2W3YO"
  - "OYW4W5WYO"
  - "OYYWWWYYO"
  - "OOOOOOOOC"

content:
  orange-stained-glass:
    item:
      type: ORANGE_STAINED_GLASS_PANE
      display-name: " "
    symbol: "O"
  yellow-stained-glass:
    item:
      type: YELLOW_STAINED_GLASS_PANE
      display-name: " "
    symbol: "Y"
  white-stained-glass:
    item:
      type: WHITE_STAINED_GLASS_PANE
      display-name: " "
    symbol: "W"
  warp-world:
    item:
      type: GRASS_BLOCK
      display-name: "&aOverworld"
      lore:
        - ""
        - "&fClick to be teleported to the overworld."
    symbol: "1"
    actions:
      - action: "CLOSE"
      - action: "PLAYER_COMMAND"
        command: "warp overworld"
  warp-nether:
    item:
      type: NETHERRACK
      display-name: "&cNether"
      lore:
        - ""
        - "&fClick to be teleported to the nether."
    symbol: "2"
    actions:
      - action: "CLOSE"
      - action: "PLAYER_COMMAND"
        command: "warp nether"
  warp-end:
    item:
      type: END_STONE
      display-name: "&5End"
      lore:
        - ""
        - "&fClick to be teleported to the End."
    symbol: "3"
    actions:
      - action: "CLOSE"
      - action: "PLAYER_COMMAND"
        command: "warp end"
  warp-mining:
    item:
      type: "IRON_ORE"
      display-name: "&7Mining"
      lore:
        - ""
        - "&fClick to be teleported to the mining world."
    symbol: "4"
    actions:
      - action: "CLOSE"
      - action: "PLAYER_COMMAND"
        command: "warp mining"
  warp-enchant:
    item:
      type: ENCHANTING_TABLE
      display-name: "&5Enchantment"
      lore:
        - ""
        - "&fClick to be teleported to the enchantment room."
    symbol: "5"
    actions:
      - action: "CLOSE"
      - action: "PLAYER_COMMAND"
        command: "warp enchant"
  close:
    item:
      type: BARRIER
      display-name: "&cClose"
    symbol: "C"
    actions:
      - action: "CLOSE"
```


---

# 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://syrows-development.gitbook.io/craftventory/welcome.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.
