API Events

HuskClaims provides several API events your plugin can listen to when players do certain town-related things. These events deal in HuskClaims class types, so you may want to familiarize yourself with the API basics first. Note that on cross-server setups, events only fire on the server the event occurred on and will not fire as a result of API calls/updates.

Bukkit Platform Events

Tip:
Remember to register your listener when listening for these event calls.
Bukkit Event classSinceCancellableDescription
BukkitCreateClaimEvent1.0When a player creates a claim or admin claim
BukkitCreateChildClaimEvent1.0When a player creates a child claim
BukkitDeleteClaimEvent1.0When a player deletes a claim or admin claim
BukkitDeleteChildClaimEvent1.0When a player deletes a child claim
BukkitDeleteAllClaimsEvent1.0When a player deletes all their claims or all admin claims
BukkitResizeClaimEvent1.0When a player resizes a claim or admin claim
BukkitResizeChildClaimEvent1.0When a player resizes a child claim
BukkitTrustEvent1.0When a player trusts a user, group or trust tag in any kind of claim
BukkitUnTrustEvent1.0When a player removes trust from a user, group, or trust tag
BukkitTransferClaimEvent1.0When a player changes who owns a claim or admin claim
BukkitEnterClaimEvent1.0When a player walks into a (child/admin/regular) claim
BukkitExitClaimEvent1.1.2When a player walks out of a (child/admin/regular) claim
BukkitClaimBlocksChangeEvent1.0When a user has their claim block balance changed
BukkitClaimWorldPruneEvent1.3When a claim world is pruned of its claims (on startup)
BukkitClaimBanEvent1.3When a player bans someone from a claim
BukkitClaimUnBanEvent1.3When a player unbans someone from a claim
BukkitClaimMakePrivateEvent1.4.1When a player makes a claim private (cant be entered without trust)
BukkitClaimMakePublicEvent1.4.1When a player makes a claim public

Fabric Platform Callbacks

On Fabric, access the EVENT callback object in each class to register a handler function.

HuskClaims and Fabric callbacks
FabricCreateClaimEvent.EVENT.register((event) -> {
    // Do something with the event object - e.g. event.getRegion();
    return ActionResult.SUCCESS; // Return an appropriate ActionResult
});.
Fabric Event classSinceCancellableDescription
FabricCreateClaimEvent1.5When a player creates a claim or admin claim
FabricCreateChildClaimEvent1.5When a player creates a child claim
FabricDeleteClaimEvent1.5When a player deletes a claim or admin claim
FabricDeleteChildClaimEvent1.5When a player deletes a child claim
FabricDeleteAllClaimsEvent1.5When a player deletes all their claims or all admin claims
FabricResizeClaimEvent1.5When a player resizes a claim or admin claim
FabricResizeChildClaimEvent1.5When a player resizes a child claim
FabricTrustEvent1.5When a player trusts a user, group or trust tag in any kind of claim
FabricUnTrustEvent1.5When a player removes trust from a user, group, or trust tag
FabricTransferClaimEvent1.5When a player changes who owns a claim or admin claim
FabricEnterClaimEvent1.5When a player walks into a (child/admin/regular) claim
FabricExitClaimEvent1.5When a player walks out of a (child/admin/regular) claim
FabricClaimBlocksChangeEvent1.5When a user has their claim block balance changed
FabricClaimWorldPruneEvent1.5When a claim world is pruned of its claims (on startup)
FabricClaimBanEvent1.5When a player bans someone from a claim
FabricClaimUnBanEvent1.5When a player unbans someone from a claim
FabricClaimMakePrivateEvent1.5When a player makes a claim private (cant be entered without trust)
FabricClaimMakePublicEvent1.5When a player makes a claim public