This repository was archived by the owner on Mar 31, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Developer Documentation
DarkLash edited this page Jan 20, 2026
·
8 revisions
API Version: 1.0.0
Compatibility: Spigot / Paper / Folia
Status: Stable
RegenSystem provides a public and stable API allowing external plugins to interact with regenerable zones, flags, and regeneration events without accessing internal code.
repositories {
maven("https://jitpack.io")
}repositories {
maven { url 'https://jitpack.io' }
}<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>dependencies {
compileOnly("com.github.DarkLashDev:RegenSystem:v2.0.2")
}<dependency>
<groupId>com.github.DarkLashDev</groupId>
<artifactId>RegenSystem</artifactId>
<version>v2.0.2</version>
<scope>provided</scope>
</dependency>depend:
- RegenSystemif (!RegenSystemAPI.isInitialized()) {
throw new IllegalStateException("RegenSystem API not available");
}
ZoneRegistry zones = RegenSystemAPI.getZones();Central entry point of the API.
ZoneRegistry registry = RegenSystemAPI.getZones();RegenSystemAPI.API_VERSION
RegenSystemAPI.API_MAJOR
RegenSystemAPI.API_MINOR
RegenSystemAPI.API_PATCHAccess and query all registered zones.
| Method | Description |
|---|---|
| getZone(String) | Get a zone by name |
| getZones() | Get all zones |
| getZoneNames() | Get all zone names |
| isRegistered(String) | Check if a zone exists |
| getTimeLeft(String) | Time before regeneration |
| getZonesContaining(Location) | Zones containing a location |
| getZonesByFlag(ZoneFlag) | Zones with a flag |
| getZonesNear(Location, int) | Zones near a location |
Example:
Optional<RegenZone> zone = RegenSystemAPI.getZones().getZone("mine");
// Another way
RegenZone zone = RegenSystemAPI.getZones().getZone("mine").orElse(null);Represents a regenerable area.
| Method | Description |
|---|---|
| getName() | Zone name |
| getCorner1() | First corner |
| getCorner2() | Second corner |
| getCenter() | Center location |
| isEnabled() | Enabled state |
| getBlockCount() | Stored blocks |
| Method | Description |
|---|---|
| contains(Location) | Check if location is inside |
| regenerate() | Trigger regeneration |
| countPlayersInside() | Count players |
RegenResult result = zone.regenerate();boolean pvp = zone.hasFlag(ZoneFlag.PVP);
zone.setFlag(ZoneFlag.PVP, false);
Map<ZoneFlag, Boolean> flags = zone.getFlags();zone.highlight(Particle.VILLAGER_HAPPY, Duration.ofSeconds(5));Available flags:
- PVP
- EXPLOSION
- BLOCK_BREAK
- BLOCK_PLACE
- ITEM_DROP
- ITEM_PICKUP
- MOB_SPAWN
- MOB_DAMAGE
Parsing:
ZoneFlag flag = ZoneFlag.fromString("bb");| Result | Meaning |
|---|---|
| SUCCESS | Regeneration done |
| SKIP | Nothing to regenerate |
| STOP | Cancelled or disabled |
| ERROR | Internal error |
if (result.isSuccess()) {
// success
}@EventHandler
public void onCreate(ZoneCreateEvent e) {
e.setCancelled(true);
}Called before a zone is deleted.
Called before a zone is reloaded.
@EventHandler
public void onPreRegen(ZonePreRegenEvent e) {
if (e.getZone().countPlayersInside() > 0) {
e.setCancelled(true);
}
}Called after regeneration.
@EventHandler
public void onFlagChange(ZoneFlagChangeEvent e) {
if (e.getFlag() == ZoneFlag.PVP) {
e.setCancelled(true);
}
}- fr.darklash.regensystem.api.*
- Backward compatible inside major version
- Casting to internal classes
- Using core packages
- Reflection on internals
Methods annotated with:
@ApiStatus.Internal
Must not be used by addons.
Future experimental APIs will be placed in:
fr.darklash.regensystem.api.experimental
They may change or be removed without notice.