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
  • Step 1
  • Step 2
  1. Developer API

New LootChest Type

After you do all the steps in the Getting Started page. Now you are started to make a new LootChest type:

Step 1

Create a class

public class NewLC extends BoxManager {
    //This is the constructor and you should keep the parameter unchanged
    public NewLC(Location location, Player player, ItemStack icon, TConfigManager config, String boxid, Location initialLocation) {
        //Your code...
    }
    
    @Override
    public boolean open() {
        //You must add this checker!
        if (!super.open()) {
            return false;
        }
        //Your code...
    }
    
    @Override
    public void remove() {
        super.remove();
        //Your code...
    }    
}

Step 2

After that you have to register this lootchest using:

api.getNMS().register("newlc", NewLC::new);

You must take into account the "newlc" is extremely essential. This is the identifier of this box and you have to use this id in all configurations, commands ...

PreviousGetting Started

Last updated 3 months ago

📦