This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
# Build
mvn clean package
# Run all tests
mvn test
# Run a single test class
mvn test -Dtest=TestClassName
# Run a single test method
mvn test -Dtest=TestClassName#methodName
# Full verify with coverage (JaCoCo)
mvn verifyAOneBlock is a BentoBox GameModeAddon for Minecraft. Players start on a single magic block in the sky; mining that block cycles through 18+ sequential phases (Plains, Underground, Ocean, Jungle, etc.), each with its own blocks, mobs, and chest loot. The plugin extends GameModeAddon from BentoBox and hooks into the Bukkit event system.
Entry point: AOneBlock.java — registers listeners, commands, generators, and the OneBlocksManager.
Phase system (oneblocks/):
OneBlocksManager— loads phase YAML files fromsrc/main/resources/phases/, tracks per-island block counts, handles phase transitions, and resolves what block/mob/chest appears next.OneBlockPhase— represents a single phase with its block pool, mob pool, and chest tables.OneBlockObject— a single block-pool entry (can be a vanilla block, custom block, or mob spawn).customblock/— adapters for custom block types (ItemsAdder, Mob, raw BlockData).
Data persistence: OneBlockIslands (in dataobjects/) is stored via BentoBox's database abstraction. It tracks block count, phase name, and hologram state per island.
Listeners (listeners/): Handle the magic block break event (core gameplay loop), boss bar updates, hologram placement, island join/leave hooks, and protection flags.
Events (events/): MagicBlockEvent, MagicBlockPhaseEvent, and BlockClearEvent are fired during gameplay so other plugins can react.
Commands:
- Player:
/ob(PlayerCommand) — sub-commands: count, phases, actionbar, bossbar, respawnblock, setcount - Admin:
/oba(AdminCommand) — sub-commands: setchest, sanitycheck, setcount
World generation: ChunkGeneratorWorld generates the empty void world with the single starter block.
GUI: PhasesPanel provides a clickable phase browser.
All tests extend CommonTestSetup, which sets up a MockBukkit server, mocks BentoBox and its managers (islands, players, worlds), and tears everything down after each test. Use Mockito and the repository's world.bentobox.aoneblock.WhiteBox helper for injecting state into private fields.
Phase YAML files under src/main/resources/phases/ are loaded at startup; tests that exercise OneBlocksManager need those resources on the classpath (they are by default via Maven's test resource path).
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/