Interface EventBus


public interface EventBus
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    publish(@NotNull org.bukkit.NamespacedKey channelId, @NotNull com.google.gson.JsonObject payload)
    Publishes an event to all compatible subscribers of the given channel.
    void
    registerChannel(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull EventChannel channel)
    Registers a channel that this plugin intends to publish events on.
    void
    registerSubscription(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull EventSubscription subscription)
    Registers a subscription to a channel.
  • Method Details

    • registerChannel

      void registerChannel(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull EventChannel channel)
      Registers a channel that this plugin intends to publish events on. Must be called during BuildMcRegistryEvent.
    • registerSubscription

      void registerSubscription(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull EventSubscription subscription)
      Registers a subscription to a channel. Must be called during BuildMcRegistryEvent.
    • publish

      void publish(@NotNull @NotNull org.bukkit.NamespacedKey channelId, @NotNull @NotNull com.google.gson.JsonObject payload)
      Publishes an event to all compatible subscribers of the given channel. Can be called at any point after the server has fully started.