Creating your first plugin

  • Views Views: 3,044
  • Last updated Last updated:
  • Java:
    @Plugin(
    id = "ExamplePlugin",
    name = "Example Plugin",
    version = "1.0.0"
    )
    public class ExamplePlugin {
    private final PluginDescription description;
    private final Logger logger;
    private final Path dataDir;

    @Inject
    public ExamplePlugin(PluginDescription description, Logger logger, Path dataDir) {
    this.description = description;
    this.logger = logger;
    this.dataDir = dataDir;
    }

    @Listener
    public void onInitialization(ServerInitializationEvent event) {
    this.logger.info("Example plugin has loaded!");
    }
    }
  • Loading…
Top