plugins/minecraft-codex-skills/skills/minecraft-modding/SKILL.md
Full-stack Minecraft mod development skill for both NeoForge (1.21+) and Fabric (1.21+). Scaffolds new mods, adds custom blocks, items, entities, recipes, commands, GUIs, dimensions, and data generation. Knows the NeoForge DeferredRegister + event-bus system and the Fabric Registry + ModInitializer system. Use when the user asks to create a Minecraft mod, add a feature to an existing mod, fix a mod bug, generate JSON assets/data, or migrate between modding platforms. Prefer NeoForge unless the user specifies Fabric or Multiloader.
npx skillsauth add jahrome907/minecraft-codex-skills minecraft-moddingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill guides Codex through developing open-source Minecraft mods. Target platforms:
| Platform | MC Version | Java | Build System | |---|---|---|---| | NeoForge | 1.21.x with 1.21.11 examples | Java 21 | Gradle + ModDevGradle | | Fabric | 1.21.x with 1.21.11 examples | Java 21 | Gradle + Fabric Loom | | Architectury (multiloader) | 1.21.x | Java 21 | Gradle + Architectury Loom |
Always confirm the platform and Minecraft version from gradle.properties or build.gradle
before writing any mod-specific code.
Use when: the task is Java/Kotlin mod code, registry/event work, networking, datagen wiring, and loader APIs.Do not use when: the task is command-only vanilla logic (minecraft-commands-scripting) or pure datapacks (minecraft-datapack).Do not use when: the task targets Paper/Bukkit plugins (minecraft-plugin-dev).# NeoForge project signature
grep -r "net.neoforged" gradle.properties build.gradle settings.gradle 2>/dev/null | head -5
# Fabric project signature
grep -r "fabric" gradle.properties build.gradle settings.gradle 2>/dev/null | head -5
# Read mod ID and version
cat gradle.properties
Key files per platform:
src/main/resources/META-INF/neoforge.mods.toml, annotated @Mod main classsrc/main/resources/fabric.mod.json, class implementing ModInitializercommon/, fabric/, neoforge/ subprojects# Build the mod jar
./gradlew build
# Run the Minecraft client to test
./gradlew runClient
# Run a dedicated server to test
./gradlew runServer
# Run game tests (NeoForge JUnit-style game tests)
./gradlew runGameTestServer
# Run data generation (generates JSON assets automatically)
./gradlew runData
# Clean build cache
./gradlew clean
# Check for dependency updates (optional)
./gradlew dependencyUpdates
After ./gradlew build, the mod jar is at:
build/libs/<mod_id>-<version>.jar
src/
main/
java/<groupId>/<modid>/
MyMod.java ← @Mod entry point
block/
ModBlocks.java ← DeferredRegister<Block>
MyCustomBlock.java
item/
ModItems.java ← DeferredRegister<Item>
entity/
ModEntities.java ← DeferredRegister<EntityType<?>>
menu/ ← custom GUI containers
recipe/
worldgen/
datagen/
ModDataGen.java ← GatherDataEvent handler
providers/
resources/
META-INF/
neoforge.mods.toml ← mod metadata (renamed from mods.toml in NeoForge 1.20.5+)
assets/<modid>/
blockstates/ ← JSON blockstate definitions
models/
block/ ← block model JSON
item/ ← item model JSON
textures/
block/ ← 16×16 PNG textures
item/
lang/
en_us.json ← translation strings
data/<modid>/
recipes/ ← crafting recipe JSON
loot_table/
blocks/ ← per-block loot table JSON
tags/
blocks/
items/
src/
main/
java/<groupId>/<modid>/
MyMod.java ← implements ModInitializer
client/
MyModClient.java ← implements ClientModInitializer
block/
item/
mixin/ ← Mixin classes
resources/
fabric.mod.json
assets/<modid>/ ← same as NeoForge
data/<modid>/ ← same as NeoForge
<modid>.mixins.json ← mixin configuration
@OnlyIn(Dist.CLIENT) (NeoForge) or @Environment(EnvType.CLIENT) (Fabric)
must NEVER run on the server.Everything in Minecraft lives in a registry. Always register objects; never construct them at field initializer time outside a registry call.
Registry.BLOCKRegistry.ITEMRegistry.ENTITY_TYPERegistry.BLOCK_ENTITY_TYPERegistry.MENU (NeoForge) / Registry.MENU_TYPE (Fabric)Registry.SOUND_EVENTRegistry.BIOMEEvery registry entry needs a namespaced ID:
// NeoForge / vanilla Java
ResourceLocation id = ResourceLocation.fromNamespaceAndPath("mymod", "my_block");
// Fabric with Yarn mappings
Identifier id = Identifier.of("mymod", "my_block");
See full patterns in references/neoforge-api.md.
// Main mod class
@Mod(MyMod.MOD_ID)
public class MyMod {
public static final String MOD_ID = "mymod";
public MyMod(IEventBus modEventBus) {
ModBlocks.BLOCKS.register(modEventBus);
ModItems.ITEMS.register(modEventBus);
modEventBus.addListener(this::commonSetup);
}
private void commonSetup(FMLCommonSetupEvent event) {
// runs after all mods are registered
}
}
// Block registration
public class ModBlocks {
public static final DeferredRegister<Block> BLOCKS =
DeferredRegister.create(BuiltInRegistries.BLOCK, MyMod.MOD_ID);
public static final DeferredBlock<Block> MY_BLOCK =
BLOCKS.registerSimpleBlock("my_block",
BlockBehaviour.Properties.of()
.mapColor(MapColor.STONE)
.strength(1.5f, 6.0f)
.sound(SoundType.STONE)
.requiresCorrectToolForDrops());
}
See full patterns in references/fabric-api.md.
// Main mod class
public class MyMod implements ModInitializer {
public static final String MOD_ID = "mymod";
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
@Override
public void onInitialize() {
ModBlocks.register();
ModItems.register();
}
}
// Block registration
public class ModBlocks {
public static final Block MY_BLOCK = new Block(
AbstractBlock.Settings.create()
.mapColor(MapColor.STONE)
.strength(1.5f, 6.0f)
.sounds(BlockSoundGroup.STONE)
.requiresTool()
);
public static void register() {
Registry.register(Registries.BLOCK,
Identifier.of(MyMod.MOD_ID, "my_block"), MY_BLOCK);
}
}
Always provide matching JSON assets for every registered block/item. Codex should generate or update these files alongside Java code.
See references/common-patterns.md for full JSON templates for:
en_us.json) entriesPrefer data generation over hand-authored JSON for maintainability.
// NeoForge – register data gen providers in GatherDataEvent
@SubscribeEvent
public static void gatherData(GatherDataEvent event) {
DataGenerator gen = event.getGenerator();
PackOutput output = gen.getPackOutput();
ExistingFileHelper helper = event.getExistingFileHelper();
CompletableFuture<HolderLookup.Provider> lookupProvider = event.getLookupProvider();
gen.addProvider(event.includeClient(), new ModBlockStateProvider(output, helper));
gen.addProvider(event.includeClient(), new ModItemModelProvider(output, helper));
gen.addProvider(event.includeServer(), new ModRecipeProvider(output, lookupProvider));
gen.addProvider(event.includeServer(), new ModLootTableProvider(output, lookupProvider));
gen.addProvider(event.includeServer(), new ModBlockTagsProvider(output, lookupProvider, helper));
}
Run data generation with ./gradlew runData, then commit the generated files.
When adding a new block:
Block subclass (or use vanilla Block with properties)ModBlocks.BLOCKS / Registries.BLOCKBlockItem in ModItems.ITEMS / Registries.ITEMassets/<modid>/blockstates/<name>.jsonassets/<modid>/models/block/<name>.jsonassets/<modid>/models/item/<name>.json (or inherits from block)assets/<modid>/textures/block/<name>.pngdata/<modid>/loot_table/blocks/<name>.jsonen_us.jsonWhen adding a new item:
Item subclass (or use new Item(properties))ModItems / Registries.ITEMBuildCreativeModeTabContentsEvent; Fabric: ItemGroupEvents)When adding a new entity:
Mob, Animal, TamableAnimal, etc.)EntityType registration@OnlyIn(Dist.CLIENT))@OnlyIn(Dist.CLIENT))EntityRenderersEvent.RegisterRenderers (NeoForge) or
EntityModelLayerRegistry (Fabric)LICENSE file and SPDX-License-Identifier header{mod_version}+{mc_version} (e.g., 2.0.0+1.21.11)CHANGELOG.md up to date with semver notesgradle-modrinth or curseforgegradle plugins for CurseForge / Modrinth./gradlew build and ./gradlew runGameTestServer./references/neoforge-api.md./references/fabric-api.md./references/common-patterns.mdtools
Operate WorldEdit safely and efficiently for Minecraft 1.21.x server build/admin workflows. Covers selection mechanics, region operations, masks and patterns, clipboards and schematics, brushes and terraforming, undo/history safety, and practical runbooks for spawn edits, arena resets, block cleanup, and path shaping. Use for command-driven world operations, not plugin development.
development
Create custom world generation content for Minecraft 1.21.x including custom biomes, dimensions, noise settings, surface rules, placed/configured features, carvers, structure sets, and biome modifiers. Covers both the datapack-only approach (JSON worldgen files) and the mod-code approach (NeoForge BiomeModifiers, Fabric BiomeModification API, code-driven worldgen registration with DeferredRegister). Includes compact JSON patterns and validator-backed reference checks for biome, dimension, placed_feature, configured_feature, structure, structure_set, and biome_modifier files. Targets Minecraft 1.21.x with official Mojang mappings. Use when the user asks about Minecraft worldgen, custom biomes, datapack JSON for dimensions or features, or mod-based biome modification with NeoForge or Fabric.
tools
Write automated tests for Minecraft mods and plugins for 1.21.x. Covers NeoForge GameTests (@GameTest annotation, GameTestHelper assertions, test structure placement), Fabric game tests (fabric-gametest-api-v1), unit testing non-Minecraft logic with JUnit 5, MockBukkit for Paper/Bukkit plugin testing (mock server, mock player, event dispatching, inventory checking), integration testing with a test server via Gradle, and GitHub Actions CI workflows that run GameTests headlessly. Includes patterns for mocking registries, testing event handlers, testing commands, and test-driven development for Minecraft projects. Use when the user asks about testing Minecraft mods or plugins, writing GameTests, setting up MockBukkit, or configuring CI for Minecraft projects.
tools
Set up, configure, and operate Minecraft Java Edition servers for 1.21.x across Paper, Purpur, Folia, Velocity networks, and modded (Fabric/NeoForge) deployments. Covers deployment selection, performance tuning playbooks, plugin operations, proxy/forwarding setup, backup and recovery runbooks, live incident troubleshooting, Docker/Pterodactyl patterns, and security hardening. Use for server infrastructure and operations, not plugin or mod feature development.