Skip to main content

Documentation Index

Fetch the complete documentation index at: https://velas.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

VelaBoard fires Bukkit events when key actions occur — you can listen to them and optionally cancel them before they take effect. This lets you enforce permissions, apply conditional logic, or integrate with other systems. Both events extend Bukkit’s Event and implement Cancellable; register your listener the standard Bukkit way.

SidebarShowEvent

SidebarShowEvent fires when a sidebar is about to be shown to a player. Cancelling it prevents the sidebar from appearing.
MethodDescription
getPlayer()The player about to see the sidebar.
getSidebar()The Sidebar being shown.
getReason()Why the sidebar is being shown: PLAYER_JOIN, MANUALLY, or OTHER.
setCancelled(true)Prevents the sidebar from being displayed.
Use getSidebar().isPlayerSidebar() or getSidebar().isSharedSidebar() to determine which type is being shown before acting on it.
@EventHandler
public void onSidebarShow(SidebarShowEvent event) {
    if (event.getReason() == SidebarShowEvent.Reason.PLAYER_JOIN) {
        // Allow join sidebars only for players with a permission
        if (!event.getPlayer().hasPermission("myplugin.sidebar")) {
            event.setCancelled(true);
        }
    }
}

AddMemberToTeamEvent

AddMemberToTeamEvent fires when a player or entity is about to be added to a team. Cancelling it prevents the member from being added.
MethodDescription
getUniqueIdOfMember()UUID of the player or entity being added.
getTeam()The Team they are being added to.
getReason()Why the member is being added: PLAYER_JOIN, PLAYER_ADD, ENTITY_ADD, or OTHER.
setCancelled(true)Prevents the member from joining the team.
@EventHandler
public void onTeamAdd(AddMemberToTeamEvent event) {
    // Prevent players from joining the "admin" team programmatically
    if (event.getTeam().getName().equals("admin") 
            && event.getReason() != AddMemberToTeamEvent.Reason.PLAYER_JOIN) {
        event.setCancelled(true);
    }
}