Skip to content

Architecture

unknown edited this page Nov 14, 2026 · 1 revision

🧩 Architecture

ManhuntStar is one game written once, in a platform-independent core, and run by three thin platforms: the Paper plugin and the Fabric and NeoForge mods. The plugin and the mods play the same because they run the same code.

                      ┌──────────────────────────────┐
                      │             core             │  no Paper, no Minecraft
                      │  AI, hunt rules, config, UI  │
                      └──────────────┬───────────────┘
                 platform interfaces │ (dev.manhuntstar.platform, .host)
            ┌────────────────────────┼─────────────────────────┐
            │                        │                         │
   ┌────────┴────────┐     ┌─────────┴─────────┐               │
   │      paper      │     │    mod-common     │  plain Minecraft (NeoForm) + mixins
   │  Paper plugin   │     └─────────┬─────────┘
   └─────────────────┘        ┌──────┴──────┐
                          ┌───┴────┐   ┌────┴─────┐
                          │ fabric │   │ neoforge │  loader entry points
                          └────────┘   └──────────┘

Modules

Module What it is Depends on
core Everything that doesn't depend on a platform: the bots' AI, pathfinding, combat, mobility, tactics, the hunt rules, settings, languages, file upgrades, the command tree (Brigadier), the menus, storage, skins, update check, statistics. Adventure, SnakeYAML, Gson, Brigadier (compile only)
paper The Paper plugin: Bukkit/Paper implementations of the platform interfaces, listeners, the command, TAB list, glow, death messages, mob goals, FastStats, the public API. Shadow jar with core inside. core, Paper API
mod-common The mods' shared code, using only Minecraft itself: implementations of the platform interfaces, the mixins that feed the game's events to core, permissions, statistics. core, Minecraft (NeoForm), Mixin
fabric The Fabric entry point (server events, commands, permissions API). Compiles mod-common's sources with Fabric's Minecraft. mod-common, Fabric API
neoforge The NeoForge entry point (events, commands, permission node). Compiles mod-common's sources with NeoForge's Minecraft. mod-common, NeoForge

core has no Paper and no Minecraft on its classpath: anything platform-specific put there doesn't compile. That's what keeps the plugin and the mods identical.

How core talks to a platform

  • dev.manhuntstar.platform: the game as core sees it: GameServer, GameWorld, GameEntity, GameLiving, GamePlayer, GameMob, BotBody (a vanilla Mannequin), GameItem, BlockType, ItemType, EntityKind, ConfigNode, YamlFiles... Each platform implements them (Paper* classes in paper, Mod* classes in mod-common).
  • dev.manhuntstar.host: what the platform provides to core: ManhuntPlatform (server, YAML, logger, data folder, resources, lifecycle hooks) and PlatformServices (TAB list, glow, death messages, path debug, events, aim diagnostics, menu screens).
  • ManhuntCore is ManhuntStar itself. A platform creates it with its ManhuntPlatform, then calls enable(), tick() every server tick and disable(). ManhuntHost is what the bots see of it.

Startup (ManhuntCore.enable)

  1. Migrates a 1.5.x config.yml and messages.yml if present.
  2. Creates or upgrades config.yml (ConfigUpgrade), carrying over a bStats opt-out.
  3. Installs or upgrades the language files (Messages.install).
  4. Loads the settings and texts.
  5. Starts the path service, skins, storage, bot manager, mob targeting, update checker, platform services and menus.
  6. Restores the bots, groups and the hunt from bots.yml.

Inside core

Package What's there
bot Bot, BotManager (creation, ticking, respawn, groups, silent deaths), Progression (phases), BotDifficulty, BotInventory, Hunger, MobTargeting, Modes (option enums)
bot.ai Brain (target choice and decisions), Navigator (following A* paths), Towering, IdleBehavior (waiting in the ring), Personality
bot.combat Combat: melee, shield, bow, crossbow, trident, humanization
bot.mobility BoatRoutine, HorseRoutine, ElytraFlight, MlgClutch, PortalEntrance
bot.motor Motor: a player's movement input applied to the Mannequin
bot.world Mining, TemporaryBlocks, PlayerBlockTracker
bot.survival, bot.ability Eating, golden apples, fire; ender pearls
pathfinding AStar, PathService (thread pool), chunk snapshots and block costs
tactics TacticsManager (TNT ambush, bow burst, firework crossbow), CaveAmbush
manhunt RingService, HuntPolicy (who's hunted, late joiners), PauseService
command ManhuntCommand: the whole /manhunt tree in Brigadier, for every platform
gui MenuManager: the chest menus
config Settings, Setting, Messages, YAML, and upgrade (file versions and steps)
persistence BotStorage (bots.yml)
skin, update, metrics Skins, update check, FastStats statistics and error reports

Threads

Everything that touches the game runs on the server thread. Off it:

  • the A* searches (PathService), on copies of the chunks taken on the server thread;
  • HTTP calls (skins, update check);
  • writing bots.yml (the text is built on the server thread, written on another, then swapped in);
  • FastStats, which reads copies of the values that core makes once a minute.

Supporting several game versions

  • Paper: one jar. It's compiled against the oldest supported Paper API (paper-api-min), and PaperCompat looks up newer calls by reflection once. compileAgainstLatest checks the code against the newest API.
  • Mods: one jar per Minecraft version. Each module's build.gradle.kts is the build of one version, and Gradle creates a project per version (:fabric:26.3, :mod-common:26.2...). What changed between Minecraft versions goes in mod-common/versions/<version>/src/ (for example MinecraftCompat). Since Minecraft is no longer obfuscated (26.1+), Fabric and NeoForge use the same names and share mod-common.

Tests

  • core/src/test: settings, file upgrades, languages (LanguageFilesTest checks every bundled language has en.yml's keys and placeholders), hunt policy, ring exit, pathfinding, ballistics, metrics, update checker.
  • core/src/testFixtures: a fake server and world (FakeServer, FakeWorld, FakeItem) and YamlFilesContract, a contract every platform's YAML implementation runs (BukkitYamlFilesTest on Paper, ModYamlFilesTest on the mods).
  • paper/src/test: PaperCompat and BotStorage.

Clone this wiki locally