How joshuadevelopsgames/ironhold works
Purpose and runtime
Ironhold is a Java 21, Minecraft 26.1.2 NeoForge RPG-overhaul mod, loaded on both dedicated server and clients. Its primary mod entry points are src/main/java/kingdom/smp/Ironhold.java and src/main/java/kingdom/smp/IronholdClient.java; game registration is centralized through ModItems, ModBlocks, ModEntities, effects, sounds, particles, attachments, and worldgen registries.
Bootstrap, events, and client/server boundary
NeoForge lifecycle and gameplay events drive server-authoritative systems; client initialization installs renderers, screens, HUD, and input behavior. src/main/java/kingdom/smp/IronholdGameEvents.java, src/main/java/kingdom/smp/ModAttachments.java, and src/main/java/kingdom/smp/client/ClientNeoForgeEvents.java are key integration points. Mixins alter vanilla behavior where events/registries are insufficient, with declarations in src/main/resources/ironhold.mixins.json and implementations under src/main/java/kingdom/smp/mixin.
RPG progression and persistent player/world state
Classes, kingdoms, class XP, skills, and abilities form the core progression domain. src/main/java/kingdom/smp/rpg/PlayerKingdomRpgData.java, src/main/java/kingdom/smp/rpg/RpgProgression.java, and src/main/java/kingdom/smp/rpg/ability/AbilityDispatch.java define player progression and execution. Profession progression is parallel in src/main/java/kingdom/smp/skill/PlayerSkillState.java and src/main/java/kingdom/smp/skill/SkillEventHandlers.java. World/server persistence uses SavedData-style components such as src/main/java/kingdom/smp/world/KingdomWorldData.java; client mirrors receive synchronized state rather than owning it.
Networking and interactive UI
src/main/java/kingdom/smp/net/ModNetworking.java is the explicit client/server protocol boundary. Payloads carry player input and UI actions—class choices, ability casts, minigame results, dialogue, and state synchronization—between client screens/HUD and server services. Examples include src/main/java/kingdom/smp/net/AbilityCastPayload.java, src/main/java/kingdom/smp/net/SyncRpgDataPayload.java, and src/main/java/kingdom/smp/client/screen/KingsConsoleScreen.java. Server validates and mutates authoritative state; clients render cached/synced views.
Content, combat, and game systems
Custom items, blocks, entities, effects, and event handlers implement the playable content layer. Registries expose them to Minecraft, while domain packages implement behavior: src/main/java/kingdom/smp/entity/, src/main/java/kingdom/smp/item/, and src/main/java/kingdom/smp/block/. Cross-cutting systems include gear quality/affixes (src/main/java/kingdom/smp/gear/AffixRoller.java), quests (src/main/java/kingdom/smp/quest/QuestService.java), and minigames (src/main/java/kingdom/smp/fishing/FishingMinigameManager.java, src/main/java/kingdom/smp/blacksmithing/BlacksmithingMinigameManager.java).
World simulation and generation
The mod adds dimensions, portals, moon gravity, seasons, biome content, and a substantial RTF terrain generator. Major boundaries are src/main/java/kingdom/smp/moon/ModMoonDimensions.java, src/main/java/kingdom/smp/seasons/Seasons.java, and src/main/java/kingdom/smp/rtf/RTFBootstrap.java. Runtime code combines with data-driven dimensions, biome modifiers, features, tags, and recipes under src/main/resources/data/ironhold/. A separate embedded milkucha.trmt erosion module has its own bootstrap at src/main/java/milkucha/trmt/TRMT.java.
AI NPC and voice integration
Voiced NPCs bridge in-game entities/dialogue to optional external AI services. src/main/java/kingdom/smp/ai/NpcSpeech.java coordinates conversation; OpenRouterClient, ElevenLabsClient, and OpenAiWhisperClient call LLM, text-to-speech, and speech-to-text services. Voice capture integrates the bundled Simple Voice Chat dependency via src/main/java/kingdom/smp/ai/svc/IronholdVoicechatPlugin.java. Keys remain server-side in world-specific configuration (src/main/java/kingdom/smp/Config.java); absent credentials disable this subsystem without blocking gameplay.
Delivery and adjacent modules
Gradle builds the primary mod from build.gradle; scripts/deploy-mod.sh packages and uploads the jar to a remote Minecraft deployment. The repository also contains independently buildable/packaged adjuncts: a mirror-rendering NeoForge mod under mirrors mod/src/main/java/kingdom/smp/mirrors/, an admin datapack under admin_datapack/, and a shaderpack under shaderpack/Lanthorn/. They are operational companions, not core Ironhold runtime packages.
Main entry points: Ironhold.java Ironhold server entry · ModNetworking.java Mod networking · IronholdGameEvents.java Gameplay events · PlayerKingdomRpgData.java RPG progression
Components 22
Mod Runtime
- Ironhold server entry
src/main/java/kingdom/smp/Ironhold.java - Content registries · Registers items, blocks, entities, effects, sounds, particles, attachments, and worldgen.
- Gameplay events
src/main/java/kingdom/smp/IronholdGameEvents.java - State attachments
src/main/java/kingdom/smp/ModAttachments.java - Vanilla mixins
src/main/resources/ironhold.mixins.json
Authoritative RPG
- RPG progression · Classes, kingdoms, XP, skills, and abilities are server-authoritative.
src/main/java/kingdom/smp/rpg/PlayerKingdomRpgData.java - Ability execution
src/main/java/kingdom/smp/rpg/ability/AbilityDispatch.java - Profession skills
src/main/java/kingdom/smp/skill/PlayerSkillState.java - World persistent state
src/main/java/kingdom/smp/world/KingdomWorldData.java - Content & game systems · Implements playable content, affixes, quests, fishing, and blacksmithing.
src/main/java/kingdom/smp/quest/QuestService.java
Client & Protocol
- Mod networking · Carries validated actions and synchronized state.
src/main/java/kingdom/smp/net/ModNetworking.java - Ironhold client entry
src/main/java/kingdom/smp/IronholdClient.java - Client event integration
src/main/java/kingdom/smp/client/ClientNeoForgeEvents.java - Screens & HUD · Renders cached synchronized state and sends player actions.
src/main/java/kingdom/smp/client/screen/KingsConsoleScreen.java
World Systems
- Dimensions & seasons · Provides moon dimension, portals, gravity, and seasonal behavior.
src/main/java/kingdom/smp/moon/ModMoonDimensions.java - RTF terrain generator
src/main/java/kingdom/smp/rtf/RTFBootstrap.java - Worldgen data assets · Dimensions, biome modifiers, features, tags, and recipes.
- TRMT erosion module
src/main/java/milkucha/trmt/TRMT.java
Optional AI Voice
- NPC speech coordinator · Optional server-side bridge for conversation and voice.
src/main/java/kingdom/smp/ai/NpcSpeech.java - Voice chat bridge
src/main/java/kingdom/smp/ai/svc/IronholdVoicechatPlugin.java
Delivery & Companions
- Build & deployment
build.gradle - Companion modules · Mirror mod, admin datapack, and shaderpack ship independently.
Connections 26
- Ironhold server entry → Content registries: registers
- Ironhold server entry → Gameplay events: subscribes
- Ironhold server entry → State attachments: installs
- Ironhold server entry → Vanilla mixins: loads with mod
- Gameplay events → RPG progression: updates
- Gameplay events → Profession skills: updates
- Gameplay events → Content & game systems: drives
- State attachments → RPG progression: persists player state
- RPG progression → Ability execution: authorizes casts
- Ability execution → Content & game systems: applies gameplay effects
- World persistent state → Dimensions & seasons: persists world state
- Content registries → Content & game systems: exposes content
- Content registries → Dimensions & seasons: registers world content
- Worldgen data assets → Dimensions & seasons: defines content
- RTF terrain generator → Dimensions & seasons: generates terrain for
- TRMT erosion module → RTF terrain generator: provides erosion
- Ironhold client entry → Client event integration: initializes
- Client event integration → Screens & HUD: installs UI and input
- Screens & HUD → Mod networking: sends actions
- Mod networking → RPG progression: syncs and validates
- Mod networking → Ability execution: forwards casts
- Mod networking → Content & game systems: forwards UI results
- NPC speech coordinator → Voice chat bridge: receives voice capture
- NPC speech coordinator → Mod networking: synchronizes dialogue
- Build & deployment → Ironhold server entry: packages mod
- Companion modules → Build & deployment: operationally adjacent