Solved solved

Discussion in 'Spigot Plugin Development' started by Mhalllz, Feb 13, 2018.

  1. solved
     
    #1 Mhalllz, Feb 13, 2018
    Last edited: Feb 13, 2018
  2. Load your Config
    Check for the boolean
    if true register the command
     
  3. You can do as @Bagga said, or load commands runtime using reflection.

    Code (Java):
    try {
       final Field bukkitCommandMap = Bukkit.getServer().getClass().getDeclaredField("commandMap");

       bukkitCommandMap.setAccessible(true);
       CommandMap commandMap = (CommandMap) bukkitCommandMap.get(Bukkit.getServer());

       commandMap.register("command", new Command("command"));
    } catch(Exception e) {
       e.printStackTrace();
    }
     

Share This Page