2.4.1
Compatibility
Changes
Changelog:
Public API Added: Other developers can now hook into ClanForge to interact with clans, ranks, and economies using our new API.
- Fixed minor issues with the Member GUI (sorting and filtering).
- Updated internal dependencies.
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.Clemmie1</groupId>
<artifactId>ClanForge-API</artifactId>
<version>2.4.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
Quick Example:
1. Getting player's clan & info
Player player = ...;
Clan clan = ClanAPI.getPlayerClan(player.getUniqueId());
if (clan != null) {
player.sendMessage("Clan: " + clan.getName());
player.sendMessage("Level: " + clan.getLevel());
player.sendMessage("Leader: " + clan.getLeaderName());
player.sendMessage("Bank: " + clan.getCoins() + " coins");
}
2. Checking permissions & ranks
Clan clan = ClanAPI.getPlayerClan(player.getUniqueId());
if (clan != null) {
// Check if player can kick members in their clan
boolean canKick = ClanAPI.hasPermission(clan.getCid(), player.getUniqueId(), "clan.member.kick");
// Get player's current rank
ClanRank rank = ClanAPI.getMemberRank(clan.getCid(), player.getUniqueId());
if (canKick) {
player.sendMessage("You have permission to kick members! Your rank is: " + rank.getDisplayName());
}
}
3. Modifying clan economy & experience
Clan clan = ClanAPI.getClanById(1234567); // Or use getClanByName("ClanName")
if (clan != null) {
// Add 5000 coins to the clan bank
ClanAPI.addClanCoins(clan.getCid(), 5000);
// Remove 1000 coins
ClanAPI.removeClanCoins(clan.getCid(), 1000);
// Give 250 experience to the clan (handles level-ups automatically)
ClanAPI.addClanExperience(clan.getCid(), 250);
}
No configuration changes are required. Just replace the old JAR with the new one and restart your server.
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:P8E5nb4w:VisTuIiB"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:P8E5nb4w:VisTuIiB"
}

