This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
AcidIsland is a BentoBox GameModeAddon for Minecraft (Paper). It implements a Skyblock-like game mode where the ocean is acid that damages players, mobs, and items. Requires BentoBox 3.12.0+ as the parent plugin framework.
mvn clean package # Build (default goal)
mvn clean test # Run all tests
mvn test -Dtest=AcidEffectTest # Run a single test class
mvn test -Dtest=AcidEffectTest#testMethod # Run a single test method
mvn -DskipTests clean package # Build without testsJava 21 is required. The project uses Maven with the Shade plugin to produce the final JAR.
This is a BentoBox addon, not a standalone plugin. The lifecycle flows through:
AcidIslandPladdon— Bukkit plugin entry point (Pladdon wrapper), instantiates the addonAcidIsland(extendsGameModeAddon) — Main addon class withonLoad()→createWorlds()→onEnable()→allLoaded()lifecycleAISettings— Configuration POJO with BentoBox@ConfigEntryannotations, implementsWorldSettings
listeners/—AcidEffectis the core gameplay listener handling all acid damage (players, mobs, items, armor protection, potion effects, Essentials integration).LavaCheckprevents normal stone generation from lava+acid water.world/—ChunkGeneratorWorldgenerates ocean floor terrain using Perlin noise.AcidTaskis a repeating task applying acid damage to entities in water.AcidBiomeProviderprovides biomes per environment type.events/— Custom Bukkit events (AcidEvent,AcidRainEvent,EntityDamageByAcidEvent, etc.) that are cancellable, allowing other plugins to modify acid behavior.
Tests use JUnit 5 + MockBukkit + Mockito 5. The standard pattern for each test class:
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.LENIENT)
public class MyTest {
private ServerMock server;
private MockedStatic<Bukkit> mockedBukkit;
@BeforeEach
void setUp() {
server = MockBukkit.mock(); // always first
mockedBukkit = Mockito.mockStatic(Bukkit.class, Mockito.RETURNS_DEEP_STUBS);
mockedBukkit.when(Bukkit::getMinecraftVersion).thenReturn("1.21.11");
mockedBukkit.when(Bukkit::getServer).thenReturn(server);
// ...
}
@AfterEach
void tearDown() {
mockedBukkit.closeOnDemand();
MockBukkit.unmock();
}
}Key rules:
- Do NOT call
Mockito.framework().clearInlineMocks()in@AfterEach— it disables@BeforeAllmocks and interferes with MockitoExtension's mock lifecycle for subsequent tests. - Always mock
Bukkit::getMinecraftVersion— BentoBox 3.12.0 calls it in a static initializer and Paper API is required for it to exist on the classpath. paper-apiis aprovideddependency (notspigot-api) — this is what putsgetMinecraftVersion()on the compile/test classpath.- MockBukkit's JUnit transitive deps are excluded in
pom.xmlto avoid JUnit 6 version conflicts with surefire. - Do not use
new ItemStack(Material.AIR)in tests — usenullfor empty armor slots; Paper 1.21's ItemStack handles AIR differently. - Do not reference
world.bentobox.bentobox.lists.Flagsstatic fields in tests — the class static initializer requires full BentoBox initialization. Use the string flag ID instead (e.g.,"ANIMAL_NATURAL_SPAWN"). - No
publicmodifier on test methods (@Test,@BeforeEach,@AfterEach,@BeforeAll,@AfterAll) — JUnit 5 does not require it and SonarCloud flags it. - No
throws Exceptionon@BeforeEach/@AfterEachunless the method body actually declares a checked exception. assertDoesNotThrow(() -> ...)for tests that verify no exception is thrown — bare method calls with no assertions are flagged by SonarCloud.assertEquals(expected, actual)for numeric equality —assertTrue(x == y)is flagged (S5785).@Disabledmust include a reason string — e.g.@Disabled("PotionEffectType cannot be mocked without full server initialisation").- Do not use
eq()inverify()orwhen()for concrete values — pass the value directly;eq()wrappers on non-matcher arguments are redundant and flagged (S6068).
All 24 locale files use MiniMessage format (e.g., <red>, <dark_blue>). Legacy & color codes must not be used. BentoBox 3.12.0+ is required for MiniMessage support.
src/main/resources/config.yml— Default config with acid damage values, rain settings, potion effects, world generation paramssrc/main/resources/addon.yml— BentoBox addon metadata and permissions (requiresapi-version: 3.12.0)src/main/resources/locales/— 24 language translation files (MiniMessage format)src/main/resources/blueprints/— Island templates (overworld, nether, end)
- Pattern-matching instanceof — use
instanceof Type varNameinstead ofinstanceof Type+ explicit cast (S6201). Math.clamp— useMath.clamp(value, min, max)instead ofMath.max(min, Math.min(max, value))(S6885).Map.putIfAbsent— replaceif (!map.containsKey(k)) { map.put(k, v); ... }withif (map.putIfAbsent(k, v) == null) { ... }(S3824).@Deprecatedannotation — always includesinceandforRemovalarguments, e.g.@Deprecated(since = "1.21", forRemoval = true)(S6355). IfforRemovalintent is unclear usesinceonly (S1123).- Reduce cognitive complexity by extracting private helper methods rather than nesting conditions.
Query open issues via the public API (no auth needed for public projects):
curl -s "https://sonarcloud.io/api/issues/search?componentKeys=BentoBoxWorld_AcidIsland&statuses=OPEN&impactSeverities=MEDIUM&ps=100" \
| python3 -c "import json,sys; [print(f'{i[\"component\"].split(\":\",1)[-1]}:{i.get(\"line\",\"?\")} [{i[\"rule\"]}] {i[\"message\"]}') for i in json.load(sys.stdin)[\"issues\"]]"Change impactSeverities to HIGH, MEDIUM, or LOW as needed.
GitHub Actions workflow on develop branch and PRs: builds with Java 21, runs JaCoCo coverage, reports to SonarCloud.
When you need to inspect source code for a dependency (e.g., BentoBox, addons):
- Check local Maven repo first:
~/.m2/repository/— sources jars are named*-sources.jar - Check the workspace: Look for sibling directories or Git submodules that may contain the dependency as a local project (e.g.,
../bentoBox,../addon-*) - Check Maven local cache for already-extracted sources before downloading anything
- Only download a jar or fetch from the internet if the above steps yield nothing useful
Prefer reading .java source files directly from a local Git clone over decompiling or extracting a jar.
In general, the latest version of BentoBox should be targeted.
Related projects are checked out as siblings under ~/git/:
Core:
bentobox/— core BentoBox framework
Game modes:
addon-acidisland/— AcidIsland game modeaddon-bskyblock/— BSkyBlock game modeBoxed/— Boxed game mode (expandable box area)CaveBlock/— CaveBlock game modeOneBlock/— AOneBlock game modeSkyGrid/— SkyGrid game modeRaftMode/— Raft survival game modeStrangerRealms/— StrangerRealms game modeBrix/— plot game modeparkour/— Parkour game modeposeidon/— Poseidon game modegg/— gg game mode
Addons:
addon-level/— island level calculationaddon-challenges/— challenges systemaddon-welcomewarpsigns/— warp signsaddon-limits/— block/entity limitsaddon-invSwitcher//invSwitcher/— inventory switcheraddon-biomes//Biomes/— biomes managementBank/— island bankBorder/— world border for islandsChat/— island chatCheckMeOut/— island submission/votingControlPanel/— game mode control panelConverter/— ASkyBlock to BSkyBlock converterDimensionalTrees/— dimension-specific treesdiscordwebhook/— Discord integrationDownloads/— BentoBox downloads siteDragonFights/— per-island ender dragon fightsExtraMobs/— additional mob spawning rulesFarmersDance/— twerking crop growthGravityFlux/— gravity addonGreenhouses-addon/— greenhouse biomesIslandFly/— island flight permissionIslandRankup/— island rankup systemLikes/— island likes/dislikesLimits/— block/entity limitslost-sheep/— lost sheep adventureMagicCobblestoneGenerator/— custom cobblestone generatorPortalStart/— portal-based island startpp/— pp addonRegionerator/— region managementResidence/— residence addonTopBlock/— top ten for OneBlockTwerkingForTrees/— twerking tree growthUpgrades/— island upgrades (Vault)Visit/— island visitingweblink/— web link addonCrowdBound/— CrowdBound addon
Data packs:
BoxedDataPack/— advancement datapack for Boxed
Documentation & tools:
docs/— main documentation sitedocs-chinese/— Chinese documentationdocs-french/— French documentationBentoBoxWorld.github.io/— GitHub Pages sitewebsite/— websitetranslation-tool/— translation tool
Check these for source before any network fetch.
world.bentobox:bentobox→~/git/bentobox/src/