> For the complete documentation index, see [llms.txt](https://twightlight.gitbook.io/hlootchest/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://twightlight.gitbook.io/hlootchest/developer-api/getting-started.md).

# Getting Started

### 1. Adding HLootChest as a soft dependency.[​](https://docs.mher.am/cosmetics/developer-api/getting-started#1-adding-cosmetics-as-a-soft-dependency) <a href="#id-1-adding-cosmetics-as-a-soft-dependency" id="id-1-adding-cosmetics-as-a-soft-dependency"></a>

First, please make sure to add `HLootChest` as a **soft dependency.**

```
softdepend: [HLootchest]
```

### 2. Adding HLootChest existence check.[​](https://docs.mher.am/cosmetics/developer-api/getting-started#2-adding-cosmetics-existence-check) <a href="#id-2-adding-cosmetics-existence-check" id="id-2-adding-cosmetics-existence-check"></a>

You **must** add a check for HLootChest plugin existence, before initializing the API.

Checking if the plugin exists on the server startup, this check is important, otherwise your plugin won't work properly.

The sample check below will shut down the plugin, if it doesn't detect the plugin.

```
@Override
public void onEnable() {
    if (Bukkit.getPluginManager().getPlugin("HLootchest") == null) {
        getLogger().severe("HLootchest wasn't found. Disabling...");
        Bukkit.getPluginManager().disablePlugin(this);
        return;
    }
}
```

### 3. Initializing the API[​](https://docs.mher.am/cosmetics/developer-api/getting-started#3-initializing-the-cosmetics-api) <a href="#id-3-initializing-the-cosmetics-api" id="id-3-initializing-the-cosmetics-api"></a>

The final step is to initialize the API, below shown the method to access it from Bukkit Services Manager.

```
HLootchest api = Bukkit.getServicesManager().getRegistration(HLootchest.class).getProvider();
```
