Negative Games Wiki
Discord
  • 👋Landing
  • 🎬Projects
    • 👮Punishments
      • 🖋️Commands
      • 📜Configuration
        • main.yml
        • messages.yml
        • Menus
          • history-main.yml
          • history.yml
          • note-delete-confirmation.yml
          • note-editor.yml
          • notes.yml
          • punish-confirm.yml
          • punish.yml
          • records-main.yml
          • records.yml
          • records-single.yml
          • staff-history-main.yml
          • staff-history.yml
          • staff-leaderboard.yml
    • 📑alumina
      • ItemBuilder
      • PotionBuilder
      • InputListener
      • Commands
      • DependencyLoader
      • Events Subscriber
      • Static Logger
Powered by GitBook
On this page

Was this helpful?

  1. Projects
  2. alumina

Events Subscriber

This utility allows you to statically and dynamically subscribe, listen, and react to events.

Example
public class ExamplePlugin extends AluminaPlugin {

    @Override
    public void load() {

    }

    @Override
    public void enable() {
        Events.listen(PlayerJoinEvent.class, event -> {
            Player player = event.getPlayer();
            
            player.sendMessage(Component.text("Welcome to the server! :)").color(NamedTextColor.GREEN));
        });
    }

    @Override
    public void disable() {

    }

}
PreviousDependencyLoaderNextStatic Logger

Last updated 1 year ago

Was this helpful?

🎬
📑