Overview
Hubbly provides custom Bukkit events that developers can listen to for extending functionality or integrating with other plugins. All events are cancellable and follow standard Bukkit event patterns.All Hubbly events extend
org.bukkit.event.Event and implement Cancellable, allowing developers to prevent default behavior by calling setCancelled(true).ActionEvent
Triggered when a Hubbly action is about to be executed. Actions are the core of Hubbly’s interactive system, used in menus, items, and configuration.Event Properties
The player who triggered the action.
The Action object being executed. Use
getActionIdentifier() to get the action type as a string.The data/parameters passed to the action. Format varies by action type.
Whether the event is cancelled. If true, the action will not execute.
Available Methods
Returns the player who triggered this action.
Returns the identifier of the action (e.g., “PLAYER”, “SOUND”, “MESSAGE”).
Returns the data string passed to the action.
Returns whether this event is cancelled.
Set whether this event should be cancelled.
Usage Example
Action Types
The following action identifiers are available in Hubbly:Available Action Types
Available Action Types
Executes a command as the player.Format:
[PLAYER] commandExample: [PLAYER] spawnExecutes a command from the console.Format:
[CONSOLE] commandExample: [CONSOLE] give %player% diamond 1Sends a message to the player.Format:
[MESSAGE] textExample: [MESSAGE] &aWelcome to the hub!Broadcasts a message to all players.Format:
[BROADCAST] textExample: [BROADCAST] &e%player% &7found a secret!Plays a sound to the player.Format:
[SOUND] sound_nameExample: [SOUND] ENTITY_PLAYER_LEVELUPDisplays a title to the player.Format:
[TITLE] title;subtitle;fadeIn;stay;fadeOutExample: [TITLE] &aWelcome!;&7Enjoy your stay;10;70;20Changes the player’s game mode.Format:
[GAMEMODE] modeExample: [GAMEMODE] CREATIVESpawns a firework at the player’s location.Format:
[FIREWORK]Applies a potion effect to the player.Format:
[EFFECT] effect:duration:amplifierExample: [EFFECT] SPEED:200:1Gives an item to the player.Format:
[ITEM] item_idExample: [ITEM] custom_item_1Launches the player into the air.Format:
[LAUNCH] x,y,zExample: [LAUNCH] 0,2,0Sends the player to another BungeeCord server.Format:
[BUNGEE] server_nameExample: [BUNGEE] lobby-2Opens a custom menu for the player.Format:
[MENU] menu_idExample: [MENU] selectorSends a clickable link to the player.Format:
[LINK] urlExample: [LINK] https://example.comCloses the player’s currently open inventory.Format:
[CLOSE]Clears the player’s inventory.Format:
[CLEAR]Gives an item to a specific inventory slot.Format:
[SLOT] slot:item_idExample: [SLOT] 4:compassHubblySpawnEvent
Triggered when a player is being teleported to the hub spawn location.Event Properties
The player being teleported to spawn.
The spawn location the player will be teleported to.
Whether the event is cancelled. If true, the teleport will not occur.
Available Methods
Returns the player being teleported.
Returns the spawn location.
Returns whether this event is cancelled.
Set whether this event should be cancelled.
Usage Example
When It’s Called
TheHubblySpawnEvent is triggered:
- When a player executes
/spawn - When a player joins the server (if configured)
- When Hubbly programmatically sends a player to spawn
Event Registration
To listen to Hubbly events in your plugin, register your listener class:Event Priorities
You can control when your listener runs relative to other listeners using event priorities:Priority Levels
- LOWEST - Runs first
- LOW - Runs early
- NORMAL - Default priority (most listeners)
- HIGH - Runs late
- HIGHEST - Runs last
- MONITOR - Read-only, runs after everything (don’t modify events here)
Best Practices
Event Handling Tips
Event Handling Tips
Don’t Cancel Unnecessarily
Only cancel events when you have a good reason. Cancelling events can break other plugins’ functionality.Use Appropriate Priorities
- Use LOWEST if you need to modify event data before others
- Use NORMAL for most cases
- Use HIGH if you want to override others’ decisions
- Use MONITOR only for logging/tracking (never modify)