Interface PluginAPI

All Known Implementing Classes:
InstancedPluginAPI

public interface PluginAPI
  • Method Details

    • registerConfig

      <T> T registerConfig(String fileName, Class<T> configClass)
      Initializes and loads a configuration file for your plugin.
      Parameters:
      fileName - The name of the file to save and load. Example: "example-config" would have its config at: "plugins/config/example-config.json"
      configClass - The configuration POJO class that is saved and loaded
      Returns:
      Configuration instance. This instance must be used for access and modifications to the configuration. If no configuration file exists yet, a new instance will still be created and returned.
    • registerConfig

      <T> T registerConfig(String fileName, Class<T> configClass, ConfigSerializer serializer)
      Initializes and loads a configuration file for your plugin, using a custom serializer. May be useful for serializing types that do not have a default GSON serializer. Or if you want to use a different file format (NBT, YAML, TOML, etc).
    • registerModule

      void registerModule(Module module)
      Registers a Module. Modules can listen to events, be toggled on and off, and register packet handlers
    • registerCommand

      void registerCommand(Command command)
      Registers a Command. Commands can be executed in the terminal, by players in-game, and in discord.
    • getLogger

      net.kyori.adventure.text.logger.slf4j.ComponentLogger getLogger()
      Gets a logger configured for the plugin instance.
    • getPluginInfo

      PluginInfo getPluginInfo()
      Gets the PluginInfo for the plugin instance. This is the data encoded in the @Plugin annotation.