Interface EventBus
public interface EventBus
-
Method Summary
Modifier and TypeMethodDescriptionvoidpublish(@NotNull org.bukkit.NamespacedKey channelId, @NotNull com.google.gson.JsonObject payload) Publishes an event to all compatible subscribers of the given channel.voidregisterChannel(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull EventChannel channel) Registers a channel that this plugin intends to publish events on.voidregisterSubscription(@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 duringBuildMcRegistryEvent. -
registerSubscription
void registerSubscription(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull EventSubscription subscription) Registers a subscription to a channel. Must be called duringBuildMcRegistryEvent. -
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.
-