Skip to content

Public API

LandClaimPlugin exposes its core managers through the main plugin instance, allowing other plugins to integrate with the claim system.

Getting the Plugin Instance

java
// Get the LandClaimPlugin instance from Bukkit
LandClaimPlugin plugin = (LandClaimPlugin) Bukkit.getPluginManager().getPlugin("LandClaimPlugin");
if (plugin == null) {
    // Plugin not installed
    return;
}

Checking if a Chunk is Claimed

java
ClaimManager claimManager = plugin.getClaimManager();

// From a Bukkit Chunk
Chunk chunk = player.getLocation().getChunk();
ChunkPosition pos = new ChunkPosition(chunk);

boolean isClaimed = claimManager.isChunkClaimed(pos);

Getting Claim Info at a Location

java
ClaimManager claimManager = plugin.getClaimManager();
ChunkPosition pos = new ChunkPosition(player.getLocation().getChunk());

// Get the profile that owns this chunk (null if unclaimed)
ClaimProfile profile = claimManager.getProfileAt(pos);

if (profile != null) {
    String claimName = profile.getName();
    UUID ownerId = profile.getOwnerId();
    int chunkCount = profile.getOwnedChunks().size();
}

Checking Player Permissions in a Claim

java
ClaimProfile profile = claimManager.getProfileAt(pos);
if (profile != null) {
    UUID playerId = player.getUniqueId();

    // Check if a player has a specific permission flag
    boolean canOpenDoors = PermissionResolver.hasPermission(profile, playerId, "USE_DOORS");
    boolean canUseChests = PermissionResolver.hasPermission(profile, playerId, "USE_CONTAINERS");

    // Get the player's status in this claim
    String status = PermissionResolver.getPlayerStatus(profile, playerId);
    // Returns: "owner", "member", "trusted", "visitor", or "wilderness"
}

Getting a Player's Profile

java
// Get the profile owned by this player
ClaimProfile profile = claimManager.getProfile(player.getUniqueId());

// Get profile by display name
ClaimProfile namedProfile = claimManager.getProfileByName("MyBase");

// Check if a player can create a new profile
boolean canCreate = claimManager.canCreateProfile(player.getUniqueId());

// Get the player's effective chunk limit (includes permission overrides + bonus)
int limit = claimManager.getClaimLimit(player);

Working with Warps

java
WarpManager warpManager = plugin.getWarpManager();

// Set a warp
warpManager.setWarp(profileId, "home", player.getLocation(), Material.OAK_DOOR);

// Get a warp
Warp warp = warpManager.getWarp(profileId, "home");
if (warp != null) {
    Location loc = warp.getLocation();
}

// Delete a warp
warpManager.deleteWarp(profileId, "home");

// Get all warps for a profile
Map<String, Warp> warps = warpManager.getWarps(profileId);

Combat Status Check

java
CombatManager combatManager = plugin.getCombatManager();

// Check if a player is currently in combat
boolean inCombat = combatManager.isInCombat(player);

Available Managers

ManagerAccess MethodPurpose
ClaimManagerplugin.getClaimManager()Core claim operations (claim, unclaim, profiles)
ConfigManagerplugin.getConfigManager()Configuration and messages
CacheManagerplugin.getCacheManager()In-memory caches for profiles and players
WarpManagerplugin.getWarpManager()Warp CRUD operations
CombatManagerplugin.getCombatManager()Combat tag detection
VisualizationManagerplugin.getVisualizationManager()Claim boundary rendering
HookManagerplugin.getHookManager()Third-party plugin integrations
DatabaseManagerplugin.getDatabaseManager()Direct database access (DAOs)
RedisManagerplugin.getRedisManager()Cross-server pub/sub

Permission Flags Reference

These are the flags you can check using PermissionResolver.hasPermission():

FlagDescription
USE_DOORSOpen/close doors
USE_TRAPDOORSOpen/close trapdoors
USE_FENCE_GATESOpen/close fence gates
USE_CONTAINERSAccess chests, barrels, hoppers
USE_WORKSTATIONSCrafting tables, anvils, etc.
USE_BEDSSleep in beds
USE_REDSTONEButtons, levers, pressure plates
USE_LECTERNSRead lecterns
USE_BELLSRing bells
DAMAGE_ANIMALSHarm passive mobs
DAMAGE_MONSTERSHarm hostile mobs
BREED_ANIMALSBreed animals
SHEAR_ENTITIESShear sheep
TRADE_VILLAGERSTrade with villagers
FEED_ANIMALSFeed animals
LEASH_ENTITIESUse leads
MODIFY_ARMOR_STANDSEdit armor stands
MODIFY_ITEM_FRAMESItem frame interaction
RIDE_VEHICLESEnter vehicles
PLACE_VEHICLESPlace vehicles
DESTROY_VEHICLESBreak vehicles
USE_ENDER_PEARLSThrow ender pearls
USE_CHORUS_FRUITEat chorus fruit
PICKUP_ITEMSPick up items
DROP_ITEMSDrop items

Adding as a Dependency

Maven

To use LandClaimPlugin as a dependency, add the JitPack repository and the dependency to your pom.xml:

xml
<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.github.synkfr</groupId>
        <artifactId>LandClaimPlugin</artifactId>
        <version>2.1.3</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

plugin.yml

yaml
depend: [LandClaimPlugin]  # Hard dependency
# or
softdepend: [LandClaimPlugin]  # Optional dependency

TIP

Always use provided scope — LandClaimPlugin will already be loaded on the server. You don't need to shade it.

Released under the MIT License.