HLootChest
  • 🎁HLootchest
  • Getting Started
    • ⬇️How to install?
    • ✨Features
    • 💻Commands & Permissions
  • Configurations
    • 📪Creating a custom template
    • 📎LootChest config
    • ® LootChest Type registration
  • Hooks
    • PlaceholderAPI
  • HeadDatabase
  • BedWars
  • Developer API
    • 🖥️Getting Started
    • 📦New LootChest Type
Powered by GitBook
On this page
  • 1. Adding HLootChest as a soft dependency.​
  • 2. Adding HLootChest existence check.​
  • 3. Initializing the API​
  1. Developer API

Getting Started

PreviousBedWarsNextNew LootChest Type

Last updated 4 days ago

1. Adding HLootChest as a soft dependency.

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

softdepend: [HLootchest]

2. Adding HLootChest existence check.

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

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();
🖥️
​
​
​