Dataset Viewer
Auto-converted to Parquet Duplicate
task_id
stringlengths
7
13
module
stringclasses
6 values
target_loader
stringclasses
2 values
target_version
stringclasses
2 values
task_scope
stringclasses
2 values
instruction
stringlengths
74
889
context
unknown
golden_reference
unknown
eval_criteria
dict
entry_path
stringclasses
20 values
API_001
api
neoforge
1.21.1
single_file
In NeoForge 1.21.1, register a mod item `example_item` with an EPIC rarity using DeferredRegister, and bind the registry to the correct event bus from the mod constructor. The mod id is `examplemod`.
""
"package com.example.examplemod;\n\nimport net.minecraft.world.item.Item;\nimport net.minecraft.world.item.Rarity;\nimport net.neoforged.bus.api.IEventBus;\nimport net.neoforged.fml.common.Mod;\nimport net.neoforged.neoforge.registries.DeferredItem;\nimport net.neoforged.neoforge.registries.DeferredRegister;\n\n@Mod(Ex...
{ "must_compile": true, "required_annotations": [ "@Mod" ], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
API_002
api
neoforge
1.21.1
single_file
NeoForge 1.21.1: register a simple block `example_block` and its BlockItem under the same name using DeferredRegister.Blocks and DeferredRegister.Items. Bind both registries in the mod constructor.
""
"package com.example.examplemod;\n\nimport net.minecraft.world.item.BlockItem;\nimport net.minecraft.world.level.block.Block;\nimport net.minecraft.world.level.block.state.BlockBehaviour;\nimport net.minecraft.world.level.material.MapColor;\nimport net.neoforged.bus.api.IEventBus;\nimport net.neoforged.fml.common.Mod;\...
{ "must_compile": true, "required_annotations": [ "@Mod" ], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
API_003
api
neoforge
1.21.1
single_file
NeoForge 1.21.1: register a `BlockEntityType` named `example_block_entity` that is valid for the block `ExampleMod.EXAMPLE_BLOCK`, bound to the mod event bus. Use BlockEntityType.Builder with a supplier.
"public class ExampleBlockEntity extends BlockEntity {\n public ExampleBlockEntity(BlockPos pos, BlockState state) {\n super(ModBlockEntities.EXAMPLE_BLOCK_ENTITY.get(), pos, state);\n }\n}"
"package com.example.examplemod;\n\nimport com.example.examplemod.block.ExampleBlockEntity;\nimport net.minecraft.core.registries.Registries;\nimport net.minecraft.world.level.block.entity.BlockEntityType;\nimport net.neoforged.bus.api.IEventBus;\nimport net.neoforged.fml.common.Mod;\nimport net.neoforged.neoforge.regi...
{ "must_compile": true, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
API_004
api
neoforge
1.21.1
single_file
NeoForge 1.21.1: register a creative mode tab `example_tab` titled 'Example Tab' whose icon is `ExampleMod.EXAMPLE_ITEM` and which displays that item. Bind the registry to the mod event bus.
"Existing item registry:\npublic static final DeferredRegister.Items ITEMS = DeferredRegister.createItems(MODID);\npublic static final DeferredItem<Item> EXAMPLE_ITEM = ITEMS.registerSimpleItem(\"example_item\");"
"package com.example.examplemod;\n\nimport net.minecraft.core.registries.Registries;\nimport net.minecraft.network.chat.Component;\nimport net.minecraft.world.item.CreativeModeTab;\nimport net.minecraft.world.item.ItemStack;\nimport net.neoforged.bus.api.IEventBus;\nimport net.neoforged.fml.common.Mod;\nimport net.neof...
{ "must_compile": true, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
API_005
api
neoforge
1.21.1
single_file
NeoForge 1.21.1: register a `DataComponentType<Integer>` named `charge` with an INT persistent codec and VAR_INT network codec. Use DeferredRegister over Registries.DATA_COMPONENT_TYPE and DeferredRegister#registerComponent.
""
"package com.example.examplemod;\n\nimport com.mojang.serialization.Codec;\nimport net.minecraft.core.component.DataComponentType;\nimport net.minecraft.core.registries.Registries;\nimport net.minecraft.network.codec.ByteBufCodecs;\nimport net.neoforged.bus.api.IEventBus;\nimport net.neoforged.fml.common.Mod;\nimport n...
{ "must_compile": true, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
API_006
api
neoforge
1.21.1
single_file
NeoForge 1.21.1: register an `AttachmentType<Integer>` named `mana` that defaults to 50, is serialized with Codec.INT and survives player death (copyOnDeath). Show how to read/write it on an Entity.
""
"package com.example.examplemod;\n\nimport com.mojang.serialization.Codec;\nimport net.neoforged.bus.api.IEventBus;\nimport net.neoforged.fml.common.Mod;\nimport net.neoforged.neoforge.attachment.AttachmentType;\nimport net.neoforged.neoforge.registries.DeferredRegister;\nimport net.neoforged.neoforge.registries.NeoFor...
{ "must_compile": true, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
API_007
api
neoforge
1.21.1
single_file
NeoForge 1.21.1: a mod constructor receives `IEventBus modEventBus`. Explain with code which events go on the mod event bus and which go on `NeoForge.EVENT_BUS`, and demonstrate registering a `RegisterCapabilitiesEvent` listener on the correct bus from the constructor.
""
"package com.example.examplemod;\n\nimport net.neoforged.bus.api.IEventBus;\nimport net.neoforged.fml.common.Mod;\nimport net.neoforged.neoforge.capabilities.Capabilities;\nimport net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent;\nimport net.neoforged.neoforge.common.NeoForge;\nimport net.neoforged.neoforg...
{ "must_compile": true, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
API_008
api
neoforge
1.21.1
single_file
NeoForge 1.21.1: register a creature entity `example_creature` (EntityType) and give it attributes (MAX_HEALTH 20, MOVEMENT_SPEED 0.25) via EntityAttributeCreationEvent. Show both the registry and the correct event-bus subscription.
"public class ExampleCreature extends PathfinderMob {\n public ExampleCreature(EntityType<? extends PathfinderMob> type, Level level) { super(type, level); }\n}"
"package com.example.examplemod;\n\nimport net.minecraft.core.registries.Registries;\nimport net.minecraft.world.entity.EntityType;\nimport net.minecraft.world.entity.MobCategory;\nimport net.minecraft.world.entity.ai.attributes.AttributeSupplier;\nimport net.minecraft.world.entity.ai.attributes.Attributes;\nimport net...
{ "must_compile": true, "required_annotations": [ "@SubscribeEvent" ], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
API_009
api
neoforge
1.21.1
single_file
NeoForge 1.21.1: register a `MenuType` for `ExampleMenu` (constructor `(int containerId, Inventory playerInv, FriendlyByteBuf data)`) using `IMenuTypeExtension.create`, and register its screen on the correct client event. Use mod id `examplemod`.
"public class ExampleMenu extends AbstractContainerMenu {\n public ExampleMenu(int containerId, Inventory playerInv, FriendlyByteBuf data) {\n super(ModMenuTypes.EXAMPLE_MENU.get(), containerId);\n }\n @Override\n public ItemStack quickMoveStack(Player player, int index) { return ItemStack.EMPTY; }\n...
"package com.example.examplemod;\n\nimport net.minecraft.core.registries.Registries;\nimport net.minecraft.world.inventory.MenuType;\nimport net.neoforged.api.Dist;\nimport net.neoforged.bus.api.IEventBus;\nimport net.neoforged.fml.common.Mod;\nimport net.neoforged.neoforge.client.event.RegisterMenuScreensEvent;\nimpor...
{ "must_compile": true, "required_annotations": [ "@SubscribeEvent" ], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
API_010
api
neoforge
1.21.1
single_file
NeoForge 1.21.1: define a serverbound custom payload `UseWandPayload(int x, int y, int z)` implementing CustomPacketPayload with a VAR_INT StreamCodec, and register a server-side handler via RegisterPayloadHandlersEvent. Mod id `examplemod`.
""
"package com.example.examplemod.net;\n\nimport com.example.examplemod.ExampleMod;\nimport io.netty.buffer.ByteBuf;\nimport net.minecraft.network.codec.StreamCodec;\nimport net.minecraft.network.protocol.common.custom.CustomPacketPayload;\nimport net.minecraft.resources.ResourceLocation;\n\npublic record UseWandPayload(...
{ "must_compile": true, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
API_011
api
neoforge
1.21.1
single_file
NeoForge 1.21.1: register a `SoundEvent` named `example_sound` using SoundEvent.createVariableRangeEvent and a fixed-range variant `example_fixed_sound` with a 32-tick range. Bind to the mod event bus.
""
"package com.example.examplemod;\n\nimport net.minecraft.core.registries.Registries;\nimport net.minecraft.resources.ResourceLocation;\nimport net.minecraft.sounds.SoundEvent;\nimport net.neoforged.bus.api.IEventBus;\nimport net.neoforged.fml.common.Mod;\nimport net.neoforged.neoforge.registries.DeferredHolder;\nimport...
{ "must_compile": true, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
API_012
api
neoforge
1.21.1
single_file
NeoForge 1.21.1: register a particle type `sparkle` as a `SimpleParticleType` and expose a `ParticleOptions` for spawning. Bind to the mod event bus; only registration and holder are required.
""
"package com.example.examplemod;\n\nimport net.minecraft.core.particles.ParticleType;\nimport net.minecraft.core.particles.SimpleParticleType;\nimport net.minecraft.core.registries.Registries;\nimport net.neoforged.bus.api.IEventBus;\nimport net.neoforged.fml.common.Mod;\nimport net.neoforged.neoforge.registries.Deferr...
{ "must_compile": true, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
API_013
api
neoforge
1.21.1
single_file
NeoForge 1.21.1: register a recipe serializer for `ExampleRecipe implements Recipe<RecipeInput>` using `SimpleCraftingRecipeSerializer`, and register the matching RecipeType. Bind both to the mod event bus.
"public class ExampleRecipe implements Recipe<RecipeInput> {\n // 1.21.1 Recipe<T> methods: matches(RecipeInput, Level), assemble(RecipeInput, HolderLookup.Provider),\n // canCraftInDimensions(int, int), getResultItem(HolderLookup.Provider), getSerializer(), getType()\n}"
"package com.example.examplemod;\n\nimport net.minecraft.core.registries.Registries;\nimport net.minecraft.world.item.crafting.RecipeSerializer;\nimport net.minecraft.world.item.crafting.RecipeType;\nimport net.minecraft.world.item.crafting.SimpleCraftingRecipeSerializer;\nimport net.neoforged.bus.api.IEventBus;\nimpor...
{ "must_compile": true, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
API_014
api
neoforge
1.21.1
single_file
NeoForge 1.21.1: create a tool item `example_pickaxe` with Tiers.IRON, durability override 512, and an `Item.Properties` that also stores a custom data component `ExampleMod.CHARGE` defaulting to 0. Show the registration only.
""
"package com.example.examplemod;\n\nimport net.minecraft.world.item.Item;\nimport net.minecraft.world.item.PickaxeItem;\nimport net.minecraft.world.item.Tiers;\nimport net.neoforged.bus.api.IEventBus;\nimport net.neoforged.fml.common.Mod;\nimport net.neoforged.neoforge.registries.DeferredItem;\nimport net.neoforged.neo...
{ "must_compile": true, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
API_015
api
neoforge
1.21.1
single_file
NeoForge 1.21.1: register a game-bus event handler class for `LivingDeathEvent` that prints the dead entity name, using @Mod.EventBusSubscriber with the correct bus, and a mod-bus class for `FMLCommonSetupEvent`. Show both classes.
""
"package com.example.examplemod;\n\nimport net.neoforged.bus.api.SubscribeEvent;\nimport net.neoforged.fml.common.Mod;\nimport net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;\nimport net.neoforged.neoforge.common.NeoForge;\nimport net.neoforged.neoforge.event.entity.living.LivingDeathEvent;\n\n// GAME bus (NeoFo...
{ "must_compile": true, "required_annotations": [ "@SubscribeEvent", "@Mod.EventBusSubscriber" ], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
API_016
api
neoforge
1.21.1
single_file
NeoForge 1.21.1: register a command `/example hello` that replies 'Hello from examplemod!' via RegisterCommandsEvent. Put the handler on the correct event bus and use Brigadier's literal().
""
"package com.example.examplemod;\n\nimport com.mojang.brigadier.CommandDispatcher;\nimport com.mojang.brigadier.builder.LiteralArgumentBuilder;\nimport net.minecraft.commands.CommandSourceStack;\nimport net.minecraft.commands.Commands;\nimport net.minecraft.network.chat.Component;\nimport net.neoforged.bus.api.Subscrib...
{ "must_compile": true, "required_annotations": [ "@SubscribeEvent" ], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
API_017
api
neoforge
1.21.1
single_file
NeoForge 1.21.1: define a `ModConfigSpec` with a boolean `enabled=true` and an int `maxRange=32`, register it as a COMMON config from the mod constructor, and add a reload listener on the mod bus.
""
"package com.example.examplemod;\n\nimport net.neoforged.bus.api.IEventBus;\nimport net.neoforged.bus.api.SubscribeEvent;\nimport net.neoforged.fml.ModContainer;\nimport net.neoforged.fml.config.ModConfig;\nimport net.neoforged.fml.event.config.ModConfigEvent;\nimport net.neoforged.fml.common.Mod;\nimport net.neoforged...
{ "must_compile": true, "required_annotations": [ "@SubscribeEvent" ], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
API_018
api
neoforge
1.21.1
single_file
NeoForge 1.21.1: register a `PoiType` named `example_poi` bound to `ExampleMod.EXAMPLE_BLOCK` with maxTickets 1 and validRange 16, and register the matching `VillagerProfession` `example_prof`. Bind to the mod event bus.
""
"package com.example.examplemod;\n\nimport net.minecraft.core.HolderGetter;\nimport net.minecraft.core.HolderSet;\nimport net.minecraft.core.registries.BuiltInRegistries;\nimport net.minecraft.core.registries.Registries;\nimport net.minecraft.world.entity.ai.village.poi.PoiType;\nimport net.minecraft.world.entity.npc.V...
{ "must_compile": true, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
API_019
api
neoforge
1.21.1
single_file
NeoForge 1.21.1 client: register a `KeyMapping` (key R, category 'key.categories.examplemod') via RegisterKeyMappingsEvent and poll `consumeClick()` in a ClientTickEvent.Post handler. Both handlers belong on which bus? Write the class with the correct annotations.
""
"package com.example.examplemod.client;\n\nimport com.example.examplemod.ExampleMod;\nimport com.mojang.blaze3d.platform.InputConstants;\nimport net.minecraft.client.KeyMapping;\nimport net.neoforged.api.Dist;\nimport net.neoforged.bus.api.SubscribeEvent;\nimport net.neoforged.fml.common.Mod;\nimport net.neoforged.neof...
{ "must_compile": true, "required_annotations": [ "@SubscribeEvent", "RegisterKeyMappingsEvent", "ClientTickEvent" ], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
API_020
api
neoforge
1.21.1
single_file
NeoForge 1.21.1: an event handler must run ONLY on the physical client. Show a @Mod.EventBusSubscriber with dist filtering using the correct NeoForge `Dist` import, and explain why @OnlyIn must not be used.
""
"package com.example.examplemod.client;\n\nimport com.example.examplemod.ExampleMod;\nimport net.neoforged.api.Dist;\nimport net.neoforged.bus.api.SubscribeEvent;\nimport net.neoforged.fml.common.Mod;\nimport net.neoforged.neoforge.client.event.RenderLevelStageEvent;\n\n// NeoForge: Dist lives in net.neoforged.api.Dist...
{ "must_compile": true, "required_annotations": [ "@Mod.EventBusSubscriber", "Dist.CLIENT" ], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
MIXIN_001
mixin
neoforge
1.21.1
single_file
Write a Mixin that logs the player's position at the END of every Player#tick(). Use @Inject at TAIL. Vanilla target (Mojang mappings): net.minecraft.world.entity.player.Player#tick()V.
"Vanilla target (Mojang mappings):\npackage net.minecraft.world.entity.player;\npublic abstract class Player extends LivingEntity {\n public void tick() { ... }\n}"
"package com.example.examplemod.mixin;\n\nimport net.minecraft.world.entity.player.Player;\nimport org.spongepowered.asm.mixin.Mixin;\nimport org.spongepowered.asm.mixin.injection.At;\nimport org.spongepowered.asm.mixin.injection.Inject;\nimport org.spongepowered.asm.mixin.injection.callback.CallbackInfo;\n\n@Mixin(Pla...
{ "must_compile": true, "required_annotations": [ "@Inject", "@Mixin" ], "forbidden_apis": [ "net.minecraftforge" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
MIXIN_002
mixin
neoforge
1.21.1
single_file
Write a Mixin that cancels ALL fire damage in LivingEntity#hurt. Target (Mojang mappings): net.minecraft.world.entity.LivingEntity#hurt(Lnet/minecraft/world/damagesource/DamageSource;F)Z. Cancel only when the DamageSource type is IN_FIRE.
""
"package com.example.examplemod.mixin;\n\nimport net.minecraft.world.damagesource.DamageSource;\nimport net.minecraft.world.damagesource.DamageTypes;\nimport net.minecraft.world.entity.LivingEntity;\nimport org.spongepowered.asm.mixin.Mixin;\nimport org.spongepowered.asm.mixin.injection.At;\nimport org.spongepowered.as...
{ "must_compile": true, "required_annotations": [ "@Inject" ], "forbidden_apis": [ "net.minecraftforge" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
MIXIN_003
mixin
neoforge
1.21.1
single_file
Write a @Redirect Mixin inside LivingEntity#hurt that skips the call to actuallyHurt(...) when the incoming amount is 0. Give the exact INVOKE target string in Mojang mappings.
"Decompiled call site (Mojang mappings):\npublic boolean hurt(DamageSource source, float amount) {\n ...\n this.actuallyHurt(source, amount);\n ...\n}"
"package com.example.examplemod.mixin;\n\nimport net.minecraft.world.damagesource.DamageSource;\nimport net.minecraft.world.entity.LivingEntity;\nimport org.spongepowered.asm.mixin.Mixin;\nimport org.spongepowered.asm.mixin.injection.At;\nimport org.spongepowered.asm.mixin.injection.Redirect;\n\n@Mixin(LivingEntity.cla...
{ "must_compile": true, "required_annotations": [ "@Redirect" ], "forbidden_apis": [ "net.minecraftforge" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
MIXIN_004
mixin
neoforge
1.21.1
single_file
Use @ModifyVariable to double the food parameter passed into FoodData#eat(IF)V (Mojang mappings). Modify only the first int argument, not any fields.
"Vanilla target:\npackage net.minecraft.world.food;\npublic class FoodData {\n public void eat(int food, float saturation) { ... }\n}"
"package com.example.examplemod.mixin;\n\nimport net.minecraft.world.food.FoodData;\nimport org.spongepowered.asm.mixin.Mixin;\nimport org.spongepowered.asm.mixin.injection.At;\nimport org.spongepowered.asm.mixin.injection.ModifyVariable;\n\n@Mixin(FoodData.class)\npublic abstract class FoodDataMixin {\n\n // argsOn...
{ "must_compile": true, "required_annotations": [ "@ModifyVariable" ], "forbidden_apis": [ "net.minecraftforge" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
MIXIN_005
mixin
neoforge
1.21.1
single_file
Use @ModifyConstant to raise the hardcoded saturation cap `20` inside FoodData#eat(IF)V (Mojang mappings) to 40.
"Decompiled snippet:\npublic void eat(int food, float saturation) {\n this.foodLevel = Math.min(food + this.foodLevel, 20);\n ...\n}"
"package com.example.examplemod.mixin;\n\nimport net.minecraft.world.food.FoodData;\nimport org.spongepowered.asm.mixin.Mixin;\nimport org.spongepowered.asm.mixin.injection.Constant;\nimport org.spongepowered.asm.mixin.injection.ModifyConstant;\n\n@Mixin(FoodData.class)\npublic abstract class FoodDataConstantMixin {\n\...
{ "must_compile": true, "required_annotations": [ "@ModifyConstant" ], "forbidden_apis": [ "net.minecraftforge" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
MIXIN_006
mixin
neoforge
1.21.1
single_file
Fill in the missing pieces (FIM) of this Mixin so it shadows the private final field `cooldowns` of net.minecraft.world.entity.player.Player and prints the cooldown item count at Player#tick TAIL. The private field is declared as `private final ItemCooldowns cooldowns;`.
"Partial mixin (incomplete):\npackage com.example.examplemod.mixin;\n\n@Mixin(Player.class)\npublic abstract class PlayerShadowMixin {\n // TODO: shadow `private final ItemCooldowns cooldowns`\n // TODO: inject at TAIL of tick()V and print cooldowns.size()\n}"
"package com.example.examplemod.mixin;\n\nimport net.minecraft.world.entity.player.Player;\nimport net.minecraft.world.item.ItemCooldowns;\nimport org.spongepowered.asm.mixin.Final;\nimport org.spongepowered.asm.mixin.Mixin;\nimport org.spongepowered.asm.mixin.Shadow;\nimport org.spongepowered.asm.mixin.injection.At;\n...
{ "must_compile": true, "required_annotations": [ "@Shadow", "@Inject" ], "forbidden_apis": [ "net.minecraftforge" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
MIXIN_007
mixin
neoforge
1.21.1
single_file
Write an @Accessor Mixin interface exposing the private field `target` of net.minecraft.world.entity.monster.Mob (declared `private LivingEntity target;`) as a getter, and show how it is called from mod code.
""
"package com.example.examplemod.mixin;\n\nimport net.minecraft.world.entity.LivingEntity;\nimport net.minecraft.world.entity.monster.Mob;\nimport org.spongepowered.asm.mixin.Mixin;\nimport org.spongepowered.asm.mixin.gen.Accessor;\n\n@Mixin(Mob.class)\npublic interface MobAccessor {\n\n // The accessor method name m...
{ "must_compile": true, "required_annotations": [ "@Accessor" ], "forbidden_apis": [ "net.minecraftforge" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
MIXIN_008
mixin
neoforge
1.21.1
single_file
Write an @Invoker Mixin exposing Entity's private collision callback `private void touch(Entity entity)` (Mojang mappings) as a public method named `examplemod$tryTouch`, and show a call site.
"Vanilla declaration (Mojang mappings):\npackage net.minecraft.world.entity;\npublic abstract class Entity {\n private void touch(Entity entity) { ... }\n}"
"package com.example.examplemod.mixin;\n\nimport net.minecraft.world.entity.Entity;\nimport org.spongepowered.asm.mixin.Mixin;\nimport org.spongepowered.asm.mixin.gen.Invoker;\n\n@Mixin(Entity.class)\npublic interface EntityInvoker {\n\n // @Invoker exposes the private method; the annotation value is the vanilla met...
{ "must_compile": true, "required_annotations": [ "@Invoker" ], "forbidden_apis": [ "net.minecraftforge" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
MIXIN_009
mixin
neoforge
1.21.1
single_file
Use MixinExtras' @ModifyReturnValue to make Item#use return pass-through logic: if the vanilla result is `success`, return `consume` instead. Target (Mojang mappings): net.minecraft.world.item.Item#use(Lnet/minecraft/world/level/Level;Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/InteractionHand;)Lnet/...
"MixinsExtras is bundled with NeoForge 1.21.1 (com.llamalad7.mixinextras)."
"package com.example.examplemod.mixin;\n\nimport com.llamalad7.mixinextras.injector.ModifyReturnValue;\nimport net.minecraft.world.InteractionHand;\nimport net.minecraft.world.InteractionResultHolder;\nimport net.minecraft.world.entity.player.Player;\nimport net.minecraft.world.item.Item;\nimport net.minecraft.world.it...
{ "must_compile": true, "required_annotations": [ "@ModifyReturnValue" ], "forbidden_apis": [ "net.minecraftforge" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
MIXIN_010
mixin
neoforge
1.21.1
single_file
Use MixinExtras' @WrapOperation to double the healing amount that HoneyBottleItem passes to LivingEntity#heal(float) inside finishUsingItem. Give the exact INVOKE target string.
"Decompiled call site (Mojang mappings):\npackage net.minecraft.world.item;\npublic class HoneyBottleItem extends Item {\n public ItemStack finishUsingItem(ItemStack stack, Level level, LivingEntity entity) {\n ...\n entity.heal(6.0F);\n ...\n }\n}"
"package com.example.examplemod.mixin;\n\nimport com.llamalad7.mixinextras.injector.wrapoperation.Operation;\nimport com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;\nimport net.minecraft.world.entity.LivingEntity;\nimport net.minecraft.world.item.HoneyBottleItem;\nimport org.spongepowered.asm.mixin.Mixi...
{ "must_compile": true, "required_annotations": [ "@WrapOperation" ], "forbidden_apis": [ "net.minecraftforge" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
MIXIN_011
mixin
neoforge
1.21.1
single_file
Write an @Inject with LocalCapture.CAPTURE_FAILHARD into Entity#move(MoverType, Vec3) that captures the local `Vec3 vec3 = this.getDeltaMovement();` assigned right after movement starts, and logs it. Provide the exact @At with INVOKE_ASSIGN.
"Decompiled opening of the target (Mojang mappings):\npublic void move(MoverType type, Vec3 pos) {\n ...\n Vec3 vec3 = this.getDeltaMovement();\n ...\n}"
"package com.example.examplemod.mixin;\n\nimport net.minecraft.world.entity.Entity;\nimport net.minecraft.world.entity.MoverType;\nimport net.minecraft.world.phys.Vec3;\nimport org.spongepowered.asm.mixin.Mixin;\nimport org.spongepowered.asm.mixin.injection.At;\nimport org.spongepowered.asm.mixin.injection.Inject;\nimp...
{ "must_compile": true, "required_annotations": [ "@Inject", "LocalCapture" ], "forbidden_apis": [ "net.minecraftforge" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
MIXIN_012
mixin
neoforge
1.21.1
single_file
Write an @Inject that runs exactly when LivingEntity#tick writes to the field `deathTime` (public int deathTime). Use a FIELD @At with the correct opcode, and complete it with the correct import for Opcodes.
"Field: public int deathTime; written as this.deathTime++ inside LivingEntity#tick()V."
"package com.example.examplemod.mixin;\n\nimport net.minecraft.world.entity.LivingEntity;\nimport org.objectweb.asm.Opcodes;\nimport org.spongepowered.asm.mixin.Mixin;\nimport org.spongepowered.asm.mixin.injection.At;\nimport org.spongepowered.asm.mixin.injection.Inject;\nimport org.spongepowered.asm.mixin.injection.ca...
{ "must_compile": true, "required_annotations": [ "@Inject" ], "forbidden_apis": [ "net.minecraftforge" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
MIXIN_013
mixin
neoforge
1.21.1
single_file
Write `examplemod.mixins.json`: common mixins in the package com.example.examplemod.mixin, CLIENT-only mixins in com.example.examplemod.mixin.client, refmap `examplemod.refmap.json`, Mixin 0.8.7, JAVA_21 compatibility, require=1. Explain why client mixins must go into the `client` section on a NeoForge dedicated server...
""
"{\n \"required\": true,\n \"minVersion\": \"0.8.5\",\n \"package\": \"com.example.examplemod.mixin\",\n \"compatibilityLevel\": \"JAVA_21\",\n \"refmap\": \"examplemod.refmap.json\",\n \"injectors\": {\n \"defaultRequire\": 1\n },\n \"mixins\": [\n \"PlayerMixin\",\n \"LivingEntityMixin\",\n \"MobA...
{ "must_compile": false, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
MIXIN_014
mixin
neoforge
1.21.1
single_file
Register `examplemod.mixins.json` for NeoForge 1.21.1 in `neoforge.mods.toml` (1.21.1 style). Show the exact TOML table. Also state where the mixin config file must be located in the jar.
""
"# neoforge.mods.toml (inside src/main/resources/META-INF/)\nmodLoader = \"javafml\"\nloaderVersion = \"[4,)\"\nlicense = \"MIT\"\n\n[[mods]]\nmodId = \"examplemod\"\nversion = \"1.0.0\"\ndisplayName = \"Example Mod\"\n\n# Mixin configs are registered per config file, one [[mixins]] table each:\n[[mixins]]\nconfig = \"...
{ "must_compile": false, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
MIXIN_015
mixin
neoforge
1.21.1
single_file
Write a cancellable @Inject into net.minecraft.world.item.ItemStack#isEnchantable()Z that returns false when a custom data component `ExampleMod.CURSED` is present on the stack. Explain the required return type of the CallbackInfo for a boolean method.
""
"package com.example.examplemod.mixin;\n\nimport net.minecraft.world.item.ItemStack;\nimport org.spongepowered.asm.mixin.Mixin;\nimport org.spongepowered.asm.mixin.injection.At;\nimport org.spongepowered.asm.mixin.injection.Inject;\nimport org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;\n\n@Mixin...
{ "must_compile": true, "required_annotations": [ "@Inject", "CallbackInfoReturnable" ], "forbidden_apis": [ "net.minecraftforge" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
MIXIN_016
mixin
neoforge
1.21.1
single_file
Write an @Inject into the HEAD of net.minecraft.world.entity.Entity#setPos(DDD)V that logs position writes only when the entity is a ServerPlayer. Explain why the instanceof check is done on the casted `this`.
""
"package com.example.examplemod.mixin;\n\nimport net.minecraft.server.level.ServerPlayer;\nimport net.minecraft.world.entity.Entity;\nimport org.spongepowered.asm.mixin.Mixin;\nimport org.spongepowered.asm.mixin.injection.At;\nimport org.spongepowered.asm.mixin.injection.Inject;\nimport org.spongepowered.asm.mixin.inje...
{ "must_compile": true, "required_annotations": [ "@Inject" ], "forbidden_apis": [ "net.minecraftforge" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
MIXIN_017
mixin
neoforge
1.21.1
single_file
FIM: complete the @At("INVOKE_ASSIGN") injection that captures the boolean returned by ItemStack#hurt(int, RandomSource, ServerPlayer) inside ItemStack#hurtAndBreak(int, LivingEntity, EquipmentSlot). Vanilla 1.21.1 uses the EquipmentSlot overload.
"Partial mixin:\n@Mixin(ItemStack.class)\npublic abstract class ItemStackHurtMixin {\n @Inject(\n method = \"hurtAndBreak(ILnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/world/entity/EquipmentSlot;)V\",\n at = @At(/* TODO */) )\n private void examplemod$onDurabilityDamage(int amount...
"package com.example.examplemod.mixin;\n\nimport net.minecraft.server.level.ServerPlayer;\nimport net.minecraft.util.RandomSource;\nimport net.minecraft.world.entity.EquipmentSlot;\nimport net.minecraft.world.entity.LivingEntity;\nimport net.minecraft.world.item.ItemStack;\nimport org.spongepowered.asm.mixin.Mixin;\nim...
{ "must_compile": true, "required_annotations": [ "@Inject", "INVOKE_ASSIGN" ], "forbidden_apis": [ "net.minecraftforge" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
MIXIN_018
mixin
neoforge
1.21.1
single_file
Write a mixin that adds a private helper method `examplemod$isFullMoon(Level)` to Player via @Unique and calls it from a TAIL injection of tick()V. Explain why @Unique is mandatory here.
""
"package com.example.examplemod.mixin;\n\nimport net.minecraft.server.level.ServerLevel;\nimport net.minecraft.world.entity.player.Player;\nimport net.minecraft.world.level.Level;\nimport org.spongepowered.asm.mixin.Mixin;\nimport org.spongepowered.asm.mixin.Unique;\nimport org.spongepowered.asm.mixin.injection.At;\nim...
{ "must_compile": true, "required_annotations": [ "@Unique", "@Inject" ], "forbidden_apis": [ "net.minecraftforge" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
MIXIN_019
mixin
neoforge
1.21.1
single_file
Given the decompiled vanilla method below, write the EXACT `method` and `at` target strings for an @Inject that fires when Item#appendHoverText adds its first tooltip line. Vanilla 1.21.1 signature: appendHoverText(ItemStack, Item.TooltipContext, List<Component>, TooltipFlag).
"Decompiled (Mojang mappings, 1.21.1):\npublic void appendHoverText(ItemStack stack, Item.TooltipContext context,\n List<Component> tooltip, TooltipFlag flag) {\n ...\n}"
"package com.example.examplemod.mixin;\n\nimport org.spongepowered.asm.mixin.Mixin;\nimport org.spongepowered.asm.mixin.injection.At;\nimport org.spongepowered.asm.mixin.injection.Inject;\nimport org.spongepowered.asm.mixin.injection.callback.CallbackInfo;\n\n@Mixin(net.minecraft.world.item.Item.class)\npublic abstract...
{ "must_compile": true, "required_annotations": [ "@Inject" ], "forbidden_apis": [ "net.minecraftforge" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
MIXIN_020
mixin
neoforge
1.21.1
single_file
A user reports: `InjectionError: Critical injection failure: @Inject annotation on examplemod$afterHurt could not find any targets matching 'hurt(Lnet/minecraft/world/damagesource/DamageSource;F)V' in net.minecraft.world.entity.LivingEntity`. Diagnose the bug and provide the corrected mixin.
"Failing handler:\n@Inject(method = \"hurt(Lnet/minecraft/world/damagesource/DamageSource;F)V\",\n at = @At(\"TAIL\"))\nprivate void examplemod$afterHurt(CallbackInfo ci) { ... }\n\nActual vanilla signature (Mojang mappings):\npublic boolean hurt(DamageSource source, float amount) - returns boolean, not void."
"/* Diagnosis:\n * The declared descriptor says the method returns V ('V' = void) but LivingEntity#hurt returns\n * boolean (Z). Mixin resolves `method` by exact descriptor match when a descriptor is present;\n * no overload with (DamageSource, float) -> void exists, so the injection target set is EMPTY\n * and Mixin's...
{ "must_compile": true, "required_annotations": [ "@Inject" ], "forbidden_apis": [ "net.minecraftforge" ], "gametest_required": false, "allowed_legacy_apis": [] }
null
MIG_001
migration
neoforge
1.21.1
single_file
Migrate this Forge 1.20.1 event handler to NeoForge 1.21.1: replace the game event bus and update all imports.
"// Forge 1.20.1\nimport net.minecraftforge.common.MinecraftForge;\nimport net.minecraftforge.event.entity.living.LivingDeathEvent;\nimport net.minecraftforge.eventbus.api.IEventBus;\nimport net.minecraftforge.fml.common.Mod;\n\n@Mod(\"examplemod\")\npublic class ExampleMod {\n public ExampleMod() {\n IEventB...
"// NeoForge 1.21.1\npackage com.example.examplemod;\n\nimport net.neoforged.bus.api.IEventBus;\nimport net.neoforged.fml.common.Mod;\nimport net.neoforged.neoforge.common.NeoForge;\nimport net.neoforged.neoforge.event.entity.living.LivingDeathEvent;\n\n@Mod(ExampleMod.MODID)\npublic class ExampleMod {\n public stat...
{ "must_compile": true, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text", "LazyOptional", "getOrCreateTag", "NetworkRegistry", "SimpleChannel", "FMLJavaModLoadingContext", "ForgeConfigSpec", "DistExe...
null
MIG_002
migration
neoforge
1.21.1
single_file
Migrate these two @Mod.EventBusSubscriber classes from Forge 1.20.1 to NeoForge 1.21.1 (bus enum values changed).
"// Forge 1.20.1\nimport net.minecraftforge.api.distmarker.Dist;\nimport net.minecraftforge.common.MinecraftForge;\nimport net.minecraftforge.eventbus.api.SubscribeEvent;\nimport net.minecraftforge.fml.common.Mod;\nimport net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;\nimport net.minecraftforge.event.entit...
"// NeoForge 1.21.1\npackage com.example.examplemod;\n\nimport net.neoforged.api.Dist;\nimport net.neoforged.bus.api.SubscribeEvent;\nimport net.neoforged.fml.common.Mod;\nimport net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;\nimport net.neoforged.neoforge.event.entity.player.PlayerInteractEvent;\n\n// Forge's ...
{ "must_compile": true, "required_annotations": [ "@SubscribeEvent", "@Mod.EventBusSubscriber" ], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text", "LazyOptional", "getOrCreateTag", "NetworkRegistry", "SimpleChannel", "FMLJav...
null
MIG_003
migration
neoforge
1.21.1
single_file
Migrate this Forge 1.20.1 mod entry point (FMLJavaModLoadingContext) to the NeoForge 1.21.1 constructor-injection style.
"// Forge 1.20.1\nimport net.minecraftforge.eventbus.api.IEventBus;\nimport net.minecraftforge.fml.common.Mod;\nimport net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;\n\n@Mod(\"examplemod\")\npublic class ExampleMod {\n public ExampleMod() {\n IEventBus modBus = FMLJavaModLoadingContext.get().getM...
"// NeoForge 1.21.1\npackage com.example.examplemod;\n\nimport net.minecraft.core.registries.Registries;\nimport net.minecraft.world.item.Item;\nimport net.neoforged.bus.api.IEventBus;\nimport net.neoforged.fml.common.Mod;\nimport net.neoforged.neoforge.registries.DeferredHolder;\nimport net.neoforged.neoforge.registri...
{ "must_compile": true, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text", "LazyOptional", "getOrCreateTag", "NetworkRegistry", "SimpleChannel", "FMLJavaModLoadingContext", "ForgeConfigSpec", "DistExe...
null
MIG_004
migration
neoforge
1.21.1
single_file
Migrate this Forge 1.20.1 item that stores an `energy` value in item NBT to NeoForge 1.21.1 using a registered DataComponentType instead of CompoundTag.
"// Forge 1.20.1\npublic class BatteryItem extends Item {\n public BatteryItem(Properties props) { super(props); }\n\n public int getEnergy(ItemStack stack) {\n return stack.getOrCreateTag().getInt(\"energy\");\n }\n\n public void setEnergy(ItemStack stack, int value) {\n stack.getOrCreateTag(...
"// NeoForge 1.21.1\npackage com.example.examplemod;\n\nimport com.mojang.serialization.Codec;\nimport net.minecraft.core.component.DataComponentType;\nimport net.minecraft.core.registries.Registries;\nimport net.minecraft.network.codec.ByteBufCodecs;\nimport net.minecraft.world.item.Item;\nimport net.minecraft.world.i...
{ "must_compile": true, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text", "LazyOptional", "getOrCreateTag", "NetworkRegistry", "SimpleChannel", "FMLJavaModLoadingContext", "ForgeConfigSpec", "DistExe...
null
MIG_005
migration
neoforge
1.21.1
single_file
Migrate this Forge 1.20.1 config class to NeoForge 1.21.1 (new spec class + new registration path via ModContainer).
"// Forge 1.20.1\nimport net.minecraftforge.common.ForgeConfigSpec;\nimport net.minecraftforge.fml.ModLoadingContext;\nimport net.minecraftforge.fml.config.ModConfig;\n\npublic class Config {\n public static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder();\n public static final ForgeConfigSp...
"// NeoForge 1.21.1\npackage com.example.examplemod;\n\nimport net.neoforged.fml.ModContainer;\nimport net.neoforged.fml.config.ModConfig;\nimport net.neoforged.neoforge.common.ModConfigSpec;\n\npublic class Config {\n public static final ModConfigSpec.Builder BUILDER = new ModConfigSpec.Builder();\n public stati...
{ "must_compile": true, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text", "LazyOptional", "getOrCreateTag", "NetworkRegistry", "SimpleChannel", "FMLJavaModLoadingContext", "ForgeConfigSpec", "DistExe...
null
MIG_006
migration
neoforge
1.21.1
single_file
Migrate this Forge 1.20.1 block entity capability exposure (LazyOptional) to the NeoForge 1.21.1 capability system (RegisterCapabilitiesEvent + BlockCapability, no LazyOptional).
"// Forge 1.20.1\npublic class StorageBlockEntity extends BlockEntity {\n private final LazyOptional<net.minecraftforge.items.IItemHandler> handler =\n LazyOptional.of(() -> new net.minecraftforge.items.ItemStackHandler(9));\n\n public StorageBlockEntity(BlockPos pos, BlockState state) {\n super...
"// NeoForge 1.21.1\npackage com.example.examplemod;\n\nimport net.minecraft.core.BlockPos;\nimport net.minecraft.core.Direction;\nimport net.minecraft.world.level.block.entity.BlockEntity;\nimport net.minecraft.world.level.block.state.BlockState;\nimport net.neoforged.bus.api.SubscribeEvent;\nimport net.neoforged.fml....
{ "must_compile": true, "required_annotations": [ "@SubscribeEvent" ], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text", "LazyOptional", "getOrCreateTag", "NetworkRegistry", "SimpleChannel", "FMLJavaModLoadingContext", "Forge...
null
MIG_007
migration
neoforge
1.21.1
single_file
Migrate this Forge 1.20.1 SimpleChannel packet to NeoForge 1.21.1: CustomPacketPayload record + PayloadRegistrar registration.
"// Forge 1.20.1\nimport net.minecraft.resources.ResourceLocation;\nimport net.minecraftforge.network.NetworkRegistry;\nimport net.minecraftforge.network.simple.SimpleChannel;\n\npublic final class Net {\n private static final String VERSION = \"1\";\n public static SimpleChannel CHANNEL = NetworkRegistry.newSimp...
"// NeoForge 1.21.1\npackage com.example.examplemod.net;\n\nimport com.example.examplemod.ExampleMod;\nimport io.netty.buffer.ByteBuf;\nimport net.minecraft.network.codec.ByteBufCodecs;\nimport net.minecraft.network.codec.StreamCodec;\nimport net.minecraft.network.protocol.common.custom.CustomPacketPayload;\nimport net...
{ "must_compile": true, "required_annotations": [ "@SubscribeEvent" ], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text", "LazyOptional", "getOrCreateTag", "NetworkRegistry", "SimpleChannel", "FMLJavaModLoadingContext", "Forge...
null
MIG_008
migration
neoforge
1.21.1
single_file
Migrate this Forge 1.20.1 spawn egg registration to NeoForge 1.21.1 (DeferredSpawnEggItem).
"// Forge 1.20.1\nimport net.minecraftforge.registries.DeferredRegister;\nimport net.minecraftforge.registries.ForgeRegistries;\nimport net.minecraftforge.registries.RegistryObject;\nimport net.minecraftforge.common.ForgeSpawnEggItem;\n\npublic static final DeferredRegister<Item> ITEMS =\n DeferredRegister.creat...
"// NeoForge 1.21.1\npackage com.example.examplemod;\n\nimport net.minecraft.world.item.Item;\nimport net.neoforged.neoforge.registries.DeferredItem;\nimport net.neoforged.neoforge.registries.DeferredSpawnEggItem;\nimport net.neoforged.neoforge.registries.DeferredRegister;\n\npublic class ModItems {\n public static ...
{ "must_compile": true, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text", "LazyOptional", "getOrCreateTag", "NetworkRegistry", "SimpleChannel", "FMLJavaModLoadingContext", "ForgeConfigSpec", "DistExe...
null
MIG_009
migration
neoforge
1.21.1
single_file
Migrate this Forge 1.20.1 player tick handler to NeoForge 1.21.1 (TickEvent was split into Pre/Post events).
"// Forge 1.20.1\nimport net.minecraftforge.event.TickEvent;\nimport net.minecraftforge.eventbus.api.SubscribeEvent;\nimport net.minecraftforge.fml.common.Mod;\n\n@Mod.EventBusSubscriber(modid = \"examplemod\")\npublic class TickHandlers {\n @SubscribeEvent\n public static void onPlayerTick(TickEvent.PlayerTickEv...
"// NeoForge 1.21.1\npackage com.example.examplemod;\n\nimport net.minecraft.world.entity.player.Player;\nimport net.neoforged.bus.api.SubscribeEvent;\nimport net.neoforged.fml.common.Mod;\nimport net.neoforged.neoforge.event.tick.PlayerTickEvent;\n\n@Mod.EventBusSubscriber(modid = ExampleMod.MODID)\npublic class TickH...
{ "must_compile": true, "required_annotations": [ "@SubscribeEvent" ], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text", "LazyOptional", "getOrCreateTag", "NetworkRegistry", "SimpleChannel", "FMLJavaModLoadingContext", "Forge...
null
MIG_010
migration
neoforge
1.21.1
single_file
Migrate this legacy (1.16-era, still compiling on 1.20.1 via old imports) text code to NeoForge 1.21.1 Component/ChatFormatting APIs.
"// Legacy Forge (1.16 style retained on 1.20.1)\nimport net.minecraft.util.text.ITextComponent;\nimport net.minecraft.util.text.StringTextComponent;\nimport net.minecraft.util.text.TextFormatting;\n\npublic final class Messages {\n public static ITextComponent status(String name, boolean ok) {\n return new S...
"// NeoForge 1.21.1\npackage com.example.examplemod;\n\nimport net.minecraft.ChatFormatting;\nimport net.minecraft.network.chat.Component;\nimport net.minecraft.network.chat.MutableComponent;\n\npublic final class Messages {\n\n // net.minecraft.util.text.* was removed long ago; 1.21.1 uses\n // Component.literal...
{ "must_compile": true, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text", "LazyOptional", "getOrCreateTag", "NetworkRegistry", "SimpleChannel", "FMLJavaModLoadingContext", "ForgeConfigSpec", "DistExe...
null
MIG_011
migration
neoforge
1.21.1
single_file
Migrate this Forge 1.20.1 mods.toml to a complete NeoForge 1.21.1 neoforge.mods.toml (file name, loaderVersion range, dependency tables).
"# Forge 1.20.1 META-INF/mods.toml\nmodLoader = \"javafml\"\nloaderVersion = \"[47,)\"\nlicense = \"MIT\"\n\n[[mods]]\nmodId = \"examplemod\"\nversion = \"1.0.0\"\ndisplayName = \"Example Mod\"\n\n[[dependencies.examplemod]]\n modId = \"forge\"\n mandatory = true\n versionRange = \"[47,)\"\n ordering = \"NO...
"# NeoForge 1.21.1 META-INF/neoforge.mods.toml\n# (renamed from mods.toml; `mandatory` was replaced by `type`; `forge` dependency -> `neoforge`)\nmodLoader = \"javafml\"\nloaderVersion = \"[4,)\"\nlicense = \"MIT\"\n\n[[mods]]\nmodId = \"examplemod\"\nversion = \"1.0.0\"\ndisplayName = \"Example Mod\"\n\n[[dependencies...
{ "must_compile": false, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text", "LazyOptional", "getOrCreateTag", "NetworkRegistry", "SimpleChannel", "FMLJavaModLoadingContext", "ForgeConfigSpec", "DistEx...
null
MIG_012
migration
neoforge
1.21.1
single_file
Migrate this Forge 1.20.1 extended menu opening (NetworkHooks.openScreen) to NeoForge 1.21.1.
"// Forge 1.20.1\nimport net.minecraftforge.network.NetworkHooks;\n\npublic static void open(BlockPos pos, ServerPlayer player, MachineBlockEntity be) {\n NetworkHooks.openScreen(player, new SimpleMenuProvider(\n (id, inv, p) -> new MachineMenu(id, inv, be),\n Component.literal(\"Machine\")), p...
"// NeoForge 1.21.1\npackage com.example.examplemod;\n\nimport net.minecraft.network.chat.Component;\nimport net.minecraft.server.level.ServerPlayer;\nimport net.minecraft.world.SimpleMenuProvider;\n\npublic final class MachineOpening {\n\n // NetworkHooks.openScreen was removed. NeoForge routes extra open-data thro...
{ "must_compile": true, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text", "LazyOptional", "getOrCreateTag", "NetworkRegistry", "SimpleChannel", "FMLJavaModLoadingContext", "ForgeConfigSpec", "DistExe...
null
MIG_013
migration
neoforge
1.21.1
single_file
Migrate this Forge 1.20.1 IForgeItem#getShareTag implementation to NeoForge 1.21.1 (data components replace share tags; show the component-based equivalent).
"// Forge 1.20.1\npublic class CoolerItem extends Item {\n public CoolerItem(Properties props) { super(props); }\n\n @Override\n public CompoundTag getShareTag(ItemStack stack) {\n CompoundTag tag = super.getShareTag(stack);\n if (tag == null) tag = new CompoundTag();\n tag.putInt(\"temper...
"// NeoForge 1.21.1\npackage com.example.examplemod;\n\nimport com.mojang.serialization.Codec;\nimport net.minecraft.core.component.DataComponentType;\nimport net.minecraft.core.registries.Registries;\nimport net.minecraft.network.codec.ByteBufCodecs;\nimport net.minecraft.world.item.Item;\nimport net.minecraft.world.i...
{ "must_compile": true, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text", "LazyOptional", "getOrCreateTag", "NetworkRegistry", "SimpleChannel", "FMLJavaModLoadingContext", "ForgeConfigSpec", "DistExe...
null
MIG_014
migration
neoforge
1.21.1
single_file
Migrate this Forge 1.20.1 ResourceLocation construction code to NeoForge 1.21.1 (the public constructor was removed in 1.20.6).
"// Forge 1.20.1\nimport net.minecraft.resources.ResourceLocation;\n\npublic final class Ids {\n public static final ResourceLocation TEXTURE =\n new ResourceLocation(\"examplemod\", \"textures/gui/machine.png\");\n\n public static ResourceLocation of(String namespace, String path) {\n return ne...
"// NeoForge 1.21.1\npackage com.example.examplemod;\n\nimport net.minecraft.resources.ResourceLocation;\n\npublic final class Ids {\n\n // `new ResourceLocation(...)` was removed in 1.20.6; the static factories are mandatory.\n public static final ResourceLocation TEXTURE =\n ResourceLocation.fromName...
{ "must_compile": true, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text", "LazyOptional", "getOrCreateTag", "NetworkRegistry", "SimpleChannel", "FMLJavaModLoadingContext", "ForgeConfigSpec", "DistExe...
null
MIG_015
migration
neoforge
1.21.1
single_file
Migrate this Forge 1.20.1 MobEffect registration to NeoForge 1.21.1 (the no-arg MobEffect constructor was removed in 1.20.5).
"// Forge 1.20.1\nimport net.minecraft.world.effect.MobEffect;\nimport net.minecraft.world.effect.MobEffectCategory;\nimport net.minecraftforge.registries.DeferredRegister;\nimport net.minecraftforge.registries.ForgeRegistries;\nimport net.minecraftforge.registries.RegistryObject;\n\npublic static final DeferredRegiste...
"// NeoForge 1.21.1\npackage com.example.examplemod;\n\nimport net.minecraft.core.registries.Registries;\nimport net.minecraft.world.effect.MobEffect;\nimport net.minecraft.world.effect.MobEffectCategory;\nimport net.neoforged.neoforge.registries.DeferredHolder;\nimport net.neoforged.neoforge.registries.DeferredRegiste...
{ "must_compile": true, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text", "LazyOptional", "getOrCreateTag", "NetworkRegistry", "SimpleChannel", "FMLJavaModLoadingContext", "ForgeConfigSpec", "DistExe...
null
MIG_016
migration
neoforge
1.21.1
single_file
Migrate this Forge 1.20.1 registry lookup code (ForgeRegistries) to NeoForge 1.21.1 using BuiltInRegistries.
"// Forge 1.20.1\nimport net.minecraftforge.registries.ForgeRegistries;\n\npublic final class Lookups {\n public static Item itemById(String id) {\n return ForgeRegistries.ITEMS.getValue(new ResourceLocation(id));\n }\n\n public static boolean isRegisteredItem(Item item) {\n return ForgeRegistrie...
"// NeoForge 1.21.1\npackage com.example.examplemod;\n\nimport net.minecraft.core.registries.BuiltInRegistries;\nimport net.minecraft.resources.ResourceLocation;\nimport net.minecraft.world.item.Item;\n\npublic final class Lookups {\n\n // ForgeRegistries is gone; vanilla's BuiltInRegistries is the single source of ...
{ "must_compile": true, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text", "LazyOptional", "getOrCreateTag", "NetworkRegistry", "SimpleChannel", "FMLJavaModLoadingContext", "ForgeConfigSpec", "DistExe...
null
MIG_017
migration
neoforge
1.21.1
single_file
Migrate this Forge 1.20.1 EntityJoinWorldEvent handler to NeoForge 1.21.1.
"// Forge 1.20.1\nimport net.minecraftforge.event.entity.EntityJoinWorldEvent;\nimport net.minecraftforge.eventbus.api.SubscribeEvent;\nimport net.minecraftforge.fml.common.Mod;\n\n@Mod.EventBusSubscriber(modid = \"examplemod\")\npublic class JoinHandlers {\n @SubscribeEvent\n public static void onJoin(EntityJoin...
"// NeoForge 1.21.1\npackage com.example.examplemod;\n\nimport net.minecraft.world.entity.monster.Creeper;\nimport net.neoforged.bus.api.SubscribeEvent;\nimport net.neoforged.fml.common.Mod;\nimport net.neoforged.neoforge.event.entity.EntityJoinLevelEvent;\n\n@Mod.EventBusSubscriber(modid = ExampleMod.MODID)\npublic cl...
{ "must_compile": true, "required_annotations": [ "@SubscribeEvent" ], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text", "LazyOptional", "getOrCreateTag", "NetworkRegistry", "SimpleChannel", "FMLJavaModLoadingContext", "Forge...
null
MIG_018
migration
neoforge
1.21.1
single_file
Migrate this Forge 1.20.1 event priority subscription to NeoForge 1.21.1 (EventPriority moved packages).
"// Forge 1.20.1\nimport net.minecraftforge.eventbus.api.EventPriority;\nimport net.minecraftforge.eventbus.api.SubscribeEvent;\nimport net.minecraftforge.fml.common.Mod;\nimport net.minecraftforge.event.entity.living.LivingDeathEvent;\n\n@Mod.EventBusSubscriber(modid = \"examplemod\")\npublic class PriorityHandlers {\...
"// NeoForge 1.21.1\npackage com.example.examplemod;\n\nimport net.neoforged.bus.api.EventPriority;\nimport net.neoforged.bus.api.SubscribeEvent;\nimport net.neoforged.fml.common.Mod;\nimport net.neoforged.neoforge.event.entity.living.LivingDeathEvent;\n\n@Mod.EventBusSubscriber(modid = ExampleMod.MODID)\npublic class ...
{ "must_compile": true, "required_annotations": [ "@SubscribeEvent" ], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text", "LazyOptional", "getOrCreateTag", "NetworkRegistry", "SimpleChannel", "FMLJavaModLoadingContext", "Forge...
null
MIG_019
migration
neoforge
1.21.1
single_file
Migrate this Forge 1.20.1 DistExecutor client-only init to NeoForge 1.21.1 (DistExecutor was removed).
"// Forge 1.20.1\nimport net.minecraftforge.api.distmarker.Dist;\nimport net.minecraftforge.fml.DistExecutor;\nimport net.minecraftforge.fml.common.Mod;\n\n@Mod(\"examplemod\")\npublic class ExampleMod {\n public ExampleMod() {\n DistExecutor.unsafeRunWhenOn(Dist.CLIENT,\n () -> () -> ClientIni...
"// NeoForge 1.21.1\npackage com.example.examplemod;\n\nimport net.neoforged.api.Dist;\nimport net.neoforged.fml.ModContainer;\nimport net.neoforged.fml.common.Mod;\nimport net.neoforged.fml.loading.FMLEnvironment;\n\n@Mod(ExampleMod.MODID)\npublic class ExampleMod {\n public static final String MODID = \"examplemod...
{ "must_compile": true, "required_annotations": [ "@Mod" ], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text", "LazyOptional", "getOrCreateTag", "NetworkRegistry", "SimpleChannel", "FMLJavaModLoadingContext", "ForgeConfigSpec"...
null
MIG_020
migration
neoforge
1.21.1
single_file
Migrate this Forge 1.20.1 ItemStack <-> NBT serialization to NeoForge 1.21.1 (registry access is now mandatory; use ItemStack.CODEC).
"// Forge 1.20.1\nimport net.minecraft.nbt.CompoundTag;\nimport net.minecraft.world.item.ItemStack;\n\npublic final class StackIo {\n public static CompoundTag save(ItemStack stack) {\n CompoundTag tag = new CompoundTag();\n stack.save(tag);\n return tag;\n }\n\n public static ItemStack lo...
"// NeoForge 1.21.1\npackage com.example.examplemod;\n\nimport net.minecraft.core.HolderLookup;\nimport net.minecraft.nbt.CompoundTag;\nimport net.minecraft.nbt.NbtOps;\nimport net.minecraft.nbt.Tag;\nimport net.minecraft.world.item.ItemStack;\nimport com.mojang.serialization.Dynamic;\nimport com.mojang.serialization.D...
{ "must_compile": true, "required_annotations": [], "forbidden_apis": [ "net.minecraftforge", "MinecraftForge.EVENT_BUS", "net.minecraft.util.text", "LazyOptional", "getOrCreateTag", "NetworkRegistry", "SimpleChannel", "FMLJavaModLoadingContext", "ForgeConfigSpec", "DistExe...
null
DEBUG_001
debug
neoforge
1.21.1
single_file
Analyze the FML crash/log snippet below for a NeoForge 1.21.1 dedicated server. Return ONLY a JSON object with keys root_cause, fix_explanation, code_patch. Reference concrete FML/NeoForge terminology; do not give generic advice such as 'update your Java' unless the log shows a class-version error.
"---- Minecraft Crash Report ----\n// Time: 2026-01-14 19:03:22 CET\nDescription: Initializing game\n\njava.lang.NoSuchMethodError: 'void net.minecraft.world.item.Item.<init>(net.minecraft.world.item.Item$Properties)'\n\tat TRANSFORMER/fancybattery@1.4.2/net.fancybattery.BatteryItem.<init>(BatteryItem.java:12)\n\tat TR...
{ "root_cause": "fancybattery was compiled against Minecraft 1.20.4. In 1.20.4 Item has no-arg-free constructor chain matching Item$Properties - the Item(Properties) constructor signature changed in 1.20.5/1.21 (Item became constructible only through deferred/Item.Properties with DataComponent support and the constru...
{ "must_compile": false, "required_annotations": [], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
DEBUG_002
debug
neoforge
1.21.1
single_file
Analyze the FML crash/log snippet below for a NeoForge 1.21.1 dedicated server. Return ONLY a JSON object with keys root_cause, fix_explanation, code_patch. Reference concrete FML/NeoForge terminology; do not give generic advice such as 'update your Java' unless the log shows a class-version error.
"[Worker-Main-2/ERROR] [ne.neof.ev.Reg/]: Registry Object not present: examplemod:wand_core\njava.lang.IllegalStateException: Registry Object not present: examplemod:wand_core\n\tat TRANSFORMER/examplemod@1.0.0/net.neoforged.neoforge.registries.DeferredHolder.get(DeferredHolder.java:41)\n\tat TRANSFORMER/examplemod@1.0...
{ "root_cause": "The mod constructor reads DeferredHolder.get() during the CONSTRUCT phase, but registry entries only become available after registry events finish (new registry event system - no 'RegistryEvent.Register' phase gating). Accessing the holder before entries are bound throws 'Registry Object not present'...
{ "must_compile": false, "required_annotations": [], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
DEBUG_003
debug
neoforge
1.21.1
single_file
Analyze the FML crash/log snippet below for a NeoForge 1.21.1 dedicated server. Return ONLY a JSON object with keys root_cause, fix_explanation, code_patch. Reference concrete FML/NeoForge terminology; do not give generic advice such as 'update your Java' unless the log shows a class-version error.
"[main/ERROR] [mixin/]: Mixin apply failed: mixin.examplemod.json:PlayerMixin\norg.spongepowered.asm.mixin.transformer.MixinApplyError: Mixin [mixin.examplemod.json:PlayerMixin] from phase [DEFAULT] in config [mixin.examplemod.json] FAILED during APPLY\nCaused by: InjectionError: Critical injection failure: @Inject ann...
{ "root_cause": "The mixin's declared method descriptor declares void ('V') as the return type, but the real LivingEntity#hurt(DamageSource, float) returns boolean ('Z'). With NeoForge 1.21.1 running Mojmap at runtime, `method` strings must match the mapped descriptor exactly; the target set is empty and Mixin's defa...
{ "must_compile": false, "required_annotations": [], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
DEBUG_004
debug
neoforge
1.21.1
single_file
Analyze the FML crash/log snippet below for a NeoForge 1.21.1 dedicated server. Return ONLY a JSON object with keys root_cause, fix_explanation, code_patch. Reference concrete FML/NeoForge terminology; do not give generic advice such as 'update your Java' unless the log shows a class-version error.
"[main/ERROR] [ne.fml.lo.mo/]: Mod 'examplemod' caused an exception during modloading\nCaused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/Minecraft for invalid dist DEDICATED_SERVER\n\tat TRANSFORMER/examplemod@1.0.0/com.example.ClientProxy.<init>(ClientProxy.java:18)\n\tat TRANSFORMER/...
{ "root_cause": "The common code path unconditionally constructs ClientProxy, whose constructor references net.minecraft.client.Minecraft - a client-only class. On a dedicated server (dist DEDICATED_SERVER) the class fails to load with 'invalid dist DEDICATED_SERVER'.", "fix_explanation": "Never touch client classe...
{ "must_compile": false, "required_annotations": [], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
DEBUG_005
debug
neoforge
1.21.1
single_file
Analyze the FML crash/log snippet below for a NeoForge 1.21.1 dedicated server. Return ONLY a JSON object with keys root_cause, fix_explanation, code_patch. Reference concrete FML/NeoForge terminology; do not give generic advice such as 'update your Java' unless the log shows a class-version error.
"[main/ERROR] [ne.fml.mo/]: Mod 'examplemod' failed to load\njava.lang.RuntimeException: Cannot listen to event net.neoforged.neoforge.event.entity.EntityJoinLevelEvent on the MOD event bus: the event does not implement IModBusEvent\n\tat TRANSFORMER/examplemod@1.0.0/net.neoforged.fml.ModLoader.validate(ModLoader.java:...
{ "root_cause": "The handler class subscribes a GAME-bus event (EntityJoinLevelEvent, a gameplay event) on the MOD event bus. NeoForge validates bus/event pairing at load: events that do not implement IModBusEvent are rejected on the mod bus.", "fix_explanation": "Either drop the `bus = Bus.MOD` so the class lands ...
{ "must_compile": false, "required_annotations": [], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
DEBUG_006
debug
neoforge
1.21.1
single_file
Analyze the FML crash/log snippet below for a NeoForge 1.21.1 dedicated server. Return ONLY a JSON object with keys root_cause, fix_explanation, code_patch. Reference concrete FML/NeoForge terminology; do not give generic advice such as 'update your Java' unless the log shows a class-version error.
"[main/ERROR] [ne.fml.lo.mo/]: Mod file examplemod-1.0.0.jar is missing mods.toml file\nnet.neoforged.fml.loading.FMLLoader$ModLoadingException: Missing or invalid mod metadata\nFile: examplemod-1.0.0.jar\nExpected: META-INF/mods.toml or META-INF/neoforge.mods.toml (found neither)\nBuild tool: ForgeGradle 6 (legacy 1.2...
{ "root_cause": "NeoForge 1.21.1 requires META-INF/neoforge.mods.toml. The jar was built from a 1.20.1 project whose processResources still copies META-INF/mods.toml (and the loader does not accept that legacy file for 21.x).", "fix_explanation": "Rename resources/META-INF/mods.toml to neoforge.mods.toml, migrate i...
{ "must_compile": false, "required_annotations": [], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
DEBUG_007
debug
neoforge
1.21.1
single_file
Analyze the FML crash/log snippet below for a NeoForge 1.21.1 dedicated server. Return ONLY a JSON object with keys root_cause, fix_explanation, code_patch. Reference concrete FML/NeoForge terminology; do not give generic advice such as 'update your Java' unless the log shows a class-version error.
"[main/ERROR] [ne.fml.lo.mo/]: Missing or unsupported mandatory dependencies:\nMod File: jei-1.20.1-forge-15.2.0.27.jar\n\tMod: examplemod\n\tRequired by: examplemod-1.0.0.jar\n\tDependency: jei@[15.20.0.27,) Minecraft:[1.20.1]\n\tReason: dependency 'jei' targets minecraft [1.20.1] but 1.21.1 is present"
{ "root_cause": "examplemod declares a mandatory dependency pinned to a JEI build compiled for 1.20.1. The loader's dependency resolution correctly refuses to run: the JEI artifact for 1.21.1 uses a different version line (JEI 19.x.x for 1.21.1 on NeoForge).", "fix_explanation": "Update the dependency entry to the ...
{ "must_compile": false, "required_annotations": [], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
DEBUG_008
debug
neoforge
1.21.1
single_file
Analyze the FML crash/log snippet below for a NeoForge 1.21.1 dedicated server. Return ONLY a JSON object with keys root_cause, fix_explanation, code_patch. Reference concrete FML/NeoForge terminology; do not give generic advice such as 'update your Java' unless the log shows a class-version error.
"[main/ERROR] [ne.fml.lo.mo/]: Exception during mod construction of examplemod\njava.lang.UnsupportedClassVersionError: com/example/ExampleMod has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime recognizes class versions up to 61.0\n\tat java.base/j...
{ "root_cause": "The mod jar was compiled with Java 21 (class file 65) but the server JVM is Java 17 (class file 61). NeoForge 21.1.x itself targets Java 21, so the environment JVM is wrong for both the loader and the mod.", "fix_explanation": "Run the server (and the client launcher profile) with Java 21+. This is...
{ "must_compile": false, "required_annotations": [], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
DEBUG_009
debug
neoforge
1.21.1
single_file
Analyze the FML crash/log snippet below for a NeoForge 1.21.1 dedicated server. Return ONLY a JSON object with keys root_cause, fix_explanation, code_patch. Reference concrete FML/NeoForge terminology; do not give generic advice such as 'update your Java' unless the log shows a class-version error.
"[main/ERROR] [mixin/]: Mixin apply failed: mixin.examplemod.json:FoodDataMixin\norg.spongepowered.asm.mixin.injection.modify.InvalidModificationException: @ModifyVariable annotation on examplemod$doubleFood could not find any matching variables in the target method\n\tat org.spongepowered.asm.mixin.injection.modify.Lo...
{ "root_cause": "@ModifyVariable without argsOnly=true scans LOCAL VARIABLES of the target method; at @At(\"RETURN\") the int locals available do not uniquely/deterministically match the selector (no ordinal, no explicit name given), so the discriminator finds no candidate. The intent is to modify the int PARAMETER, ...
{ "must_compile": false, "required_annotations": [], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
DEBUG_010
debug
neoforge
1.21.1
single_file
Analyze the FML crash/log snippet below for a NeoForge 1.21.1 dedicated server. Return ONLY a JSON object with keys root_cause, fix_explanation, code_patch. Reference concrete FML/NeoForge terminology; do not give generic advice such as 'update your Java' unless the log shows a class-version error.
"[Server thread/ERROR]: Encountered an unexpected exception\nnet.minecraft.ReportedException: Ticking player\nCaused by: java.lang.NullPointerException: Cannot invoke \"net.minecraft.world.item.ItemStack.getItem()\" because \"stack\" is null\n\tat TRANSFORMER/examplemod@1.0.0/com.example.WandHandler.onRightClick(WandHa...
{ "root_cause": "The RightClickItem handler dereferences event.getItemStack() without a null check. In NeoForge 1.21.1 PlayerInteractEvent.RightClickItem#getItemStack() can be null when the interaction is triggered with an empty hand.", "fix_explanation": "Guard the handler: fetch the stack once, check for null/EMP...
{ "must_compile": false, "required_annotations": [], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
DEBUG_011
debug
neoforge
1.21.1
single_file
Analyze the FML crash/log snippet below for a NeoForge 1.21.1 dedicated server. Return ONLY a JSON object with keys root_cause, fix_explanation, code_patch. Reference concrete FML/NeoForge terminology; do not give generic advice such as 'update your Java' unless the log shows a class-version error.
"[Server thread/ERROR]: Failed to save chunk 12,-4 in level \"ServerLevel[world]\"\ncom.mojang.serialization.ReportedException: Loading NBT data\nCaused by: net.minecraft.ReportedException: Caught exception encoding ItemStack:\njava.lang.IllegalStateException: Can't serialize unregistered component examplemod:charge\n\...
{ "root_cause": "A DataComponentType was used on ItemStacks but its DeferredRegister was never bound to the mod event bus (or the registration supplier returned null), so the component exists in memory during play but is not present in the built-in registry when ItemStack.save encodes the stack. Unregistered componen...
{ "must_compile": false, "required_annotations": [], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
DEBUG_012
debug
neoforge
1.21.1
single_file
Analyze the FML crash/log snippet below for a NeoForge 1.21.1 dedicated server. Return ONLY a JSON object with keys root_cause, fix_explanation, code_patch. Reference concrete FML/NeoForge terminology; do not give generic advice such as 'update your Java' unless the log shows a class-version error.
"[main/ERROR] [ne.fml.lo.mo/]: Mod 'examplemod' failed during construction\njava.lang.NoClassDefFoundError: net/minecraftforge/event/TickEvent$PlayerTickEvent\n\tat TRANSFORMER/examplemod@1.9.9/com.example.TickHandlers.<clinit>(TickHandlers.java:6)\nCaused by: java.lang.ClassNotFoundException: net.minecraftforge.event....
{ "root_cause": "The mod is a straight jar copy from Forge 1.20.1: its TickHandlers class still imports net.minecraftforge.event.TickEvent$PlayerTickEvent. On NeoForge 21.1.x the entire net.minecraftforge namespace is absent (packages are net.neoforged.*), so the class cannot be linked.", "fix_explanation": "Recomp...
{ "must_compile": false, "required_annotations": [], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
DEBUG_013
debug
neoforge
1.21.1
single_file
Analyze the FML crash/log snippet below for a NeoForge 1.21.1 dedicated server. Return ONLY a JSON object with keys root_cause, fix_explanation, code_patch. Reference concrete FML/NeoForge terminology; do not give generic advice such as 'update your Java' unless the log shows a class-version error.
"[main/ERROR] [ne.re.Reg/]: Exception registering examplemod:example_item\njava.lang.IllegalStateException: Duplicate registry entry: examplemod:example_item (attempted re-registration)\n\tat net.neoforged.neoforge.registries.RegisterHelper.register(RegisterHelper.java:88)\n\tat TRANSFORMER/examplemod@1.0.0/com.example...
{ "root_cause": "The same registry name is registered twice. Typical causes: (1) the mod calls its registration method manually in addition to DeferredRegister binding, (2) two DeferredRegister instances with the same modid register colliding names, or (3) a StaticInit-time call duplicated the register() invocation."...
{ "must_compile": false, "required_annotations": [], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
DEBUG_014
debug
neoforge
1.21.1
single_file
Analyze the FML crash/log snippet below for a NeoForge 1.21.1 dedicated server. Return ONLY a JSON object with keys root_cause, fix_explanation, code_patch. Reference concrete FML/NeoForge terminology; do not give generic advice such as 'update your Java' unless the log shows a class-version error.
"[Netty Server IO #1/ERROR] [ne.neof.ne.NetworkHandler]: Exception in network handler\njava.lang.IllegalStateException: Attempted to modify Level 'ServerLevel[world]' from thread 'Netty Server IO #1' - world access must happen on the server thread\n\tat net.minecraft.server.level.ServerLevel.checkThread(ServerLevel.jav...
{ "root_cause": "The payload handler executed game logic directly on the network thread. NeoForge payload handlers run on the network thread unless you move work onto the main thread; world/level mutations are main-thread-only.", "fix_explanation": "Wrap the game logic in context.enqueueWork(...) (IPayloadContext) ...
{ "must_compile": false, "required_annotations": [], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
DEBUG_015
debug
neoforge
1.21.1
single_file
Analyze the FML crash/log snippet below for a NeoForge 1.21.1 dedicated server. Return ONLY a JSON object with keys root_cause, fix_explanation, code_patch. Reference concrete FML/NeoForge terminology; do not give generic advice such as 'update your Java' unless the log shows a class-version error.
"[Server thread/ERROR]: Block entity examplemod:storage threw exception during tick\njava.lang.NullPointerException: Cannot invoke \"net.neoforged.neoforge.items.IItemHandler.getSlots()\" because the return value of \"net.minecraft.world.level.block.entity.BlockEntity.getBlockState()\" ... handler is null\n\tat TRANSFO...
{ "root_cause": "The block entity was half-migrated: tick code still resolves the item handler through the old LazyOptional/ForgeCapabilities path that NeoForge removed, so the lookup returns null and the NPE follows. On NeoForge 1.21.1 capability providers are registered centrally with RegisterCapabilitiesEvent and ...
{ "must_compile": false, "required_annotations": [], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
DEBUG_016
debug
neoforge
1.21.1
single_file
Analyze the FML crash/log snippet below for a NeoForge 1.21.1 dedicated server. Return ONLY a JSON object with keys root_cause, fix_explanation, code_patch. Reference concrete FML/NeoForge terminology; do not give generic advice such as 'update your Java' unless the log shows a class-version error.
"[Server thread/ERROR] [mixin/]: Mixin apply failed: mixin.examplemod.json:GuiMixin\norg.spongepowered.asm.mixin.transformer.ClassNotFoundException: The specified target class net.minecraft.client.gui.Gui for mixin [GuiMixin] was not found\nDist: DEDICATED_SERVER\nConfig file: mixin.examplemod.json (\"mixins\" section)...
{ "root_cause": "A client-only vanilla target (net.minecraft.client.gui.Gui) is listed in the COMMON `mixins` section of the config. On a dedicated server those classes never load, so Mixin cannot find the target class and the apply fails fatally.", "fix_explanation": "Move the mixin class into the `client` section...
{ "must_compile": false, "required_annotations": [], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
DEBUG_017
debug
neoforge
1.21.1
single_file
Analyze the FML crash/log snippet below for a NeoForge 1.21.1 dedicated server. Return ONLY a JSON object with keys root_cause, fix_explanation, code_patch. Reference concrete FML/NeoForge terminology; do not give generic advice such as 'update your Java' unless the log shows a class-version error.
"[main/ERROR] [ne.fml.lo.mo/]: Failed to create mod instance of examplemod\njava.lang.RuntimeException: InvokeTargetException while invoking mod constructor\nCaused by: java.lang.NoSuchMethodException: com.example.ExampleMod.<init>(net.neoforged.neoforge.common.ModConfigSpec)\n\tat net.neoforged.fml.ModContainer.constr...
{ "root_cause": "FML injects only a fixed set of constructor parameter types: (), (IEventBus), (ModContainer), or (IEventBus, ModContainer). A ModConfigSpec parameter is not an injectable type, so constructor lookup fails with NoSuchMethodException.", "fix_explanation": "Change the constructor to the supported (IEv...
{ "must_compile": false, "required_annotations": [], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
DEBUG_018
debug
neoforge
1.21.1
single_file
Analyze the FML crash/log snippet below for a NeoForge 1.21.1 dedicated server. Return ONLY a JSON object with keys root_cause, fix_explanation, code_patch. Reference concrete FML/NeoForge terminology; do not give generic advice such as 'update your Java' unless the log shows a class-version error.
"[Worker-Main-3/ERROR] [ne.fml.mo.Mod/]: Exception during parallel mod construction of jei\njava.lang.IllegalStateException: Registry Object not present: jei:jei\n\tat TRANSFORMER/examplemod@1.0.0/com.example.JeiBridge.<clinit>(JeiBridge.java:9)\nNote: JeiBridge does `public static final Object PLUGIN = new JeiPlugin()...
{ "root_cause": "During construction mods load in parallel. examplemod's static initializer touches JEI's classes (expecting JEI's registry entries to be present), but JEI's own construction may not have completed - a cross-mod construction-order dependency. Registry holders are only guaranteed after registration eve...
{ "must_compile": false, "required_annotations": [], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
DEBUG_019
debug
neoforge
1.21.1
single_file
Analyze the FML crash/log snippet below for a NeoForge 1.21.1 dedicated server. Return ONLY a JSON object with keys root_cause, fix_explanation, code_patch. Reference concrete FML/NeoForge terminology; do not give generic advice such as 'update your Java' unless the log shows a class-version error.
"[main/ERROR] [ne.fml.mo.Mod/]: Failed to load JEI plugin service\njava.util.ServiceConfigurationError: mezz.jei.api.IGuiHelper? mezz.jei.api.helpers.IGuiHelper not a provider? \nActual line in jar: META-INF/services/mezz.jei.api.IModPlugin\nCaused by: java.lang.ClassNotFoundException: com.example.MyJeiPlugin\n\tServic...
{ "root_cause": "The JEI plugin is registered through Java's ServiceLoader: META-INF/services/mezz.jei.api.IModPlugin must list the FQCN of the provider class. The service file contains a misspelled class name (MyJeiPlguin), so ClassNotFound aborts service construction.", "fix_explanation": "Correct the FQCN inside...
{ "must_compile": false, "required_annotations": [], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
DEBUG_020
debug
neoforge
1.21.1
single_file
Analyze the FML crash/log snippet below for a NeoForge 1.21.1 dedicated server. Return ONLY a JSON object with keys root_cause, fix_explanation, code_patch. Reference concrete FML/NeoForge terminology; do not give generic advice such as 'update your Java' unless the log shows a class-version error.
"[main/ERROR] [ne.fml.lo.mo/]: Incompatible mod set!\nMod 'ancientsword' requires 'minecraft' version [1.20.1], but 1.21.1 is present.\n\tMod file: ancientsword-2.3.jar\n\tMod metadata: META-INF/mods.toml (declared minecraft versionRange \"[1.20.1]\")\n\tLoader: NeoForge 21.1.77\nLoaded mods: 47 (examplemod, jei, ancie...
{ "root_cause": "ancientsword is a 1.20.1 build whose neoforge.mods.toml pins minecraft to [1.20.1]. The loader refuses the mod set before any class loading - this is metadata-level incompatibility, not a runtime bug.", "fix_explanation": "Get ancientsword 2.4+ built for 1.21.1, or (if you maintain it) bump its met...
{ "must_compile": false, "required_annotations": [], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
BUILD_001
build
neoforge
1.21.1
single_file
Write a complete `build.gradle.kts` for a NeoForge 1.21.1 mod using NeoGradle 7 (userdev), Gradle 8.x, Java 21 toolchain, dependency net.neoforged:neoforge:21.1.77, mod id `examplemod`, with client/server/data run configs.
""
"plugins {\n id(\"java-library\")\n id(\"net.neoforged.gradle.userdev\") version \"7.0.145\"\n}\n\ngroup = \"com.example\"\nversion = \"1.0.0\"\n\njava {\n toolchain {\n languageVersion = JavaLanguageVersion.of(21)\n }\n}\n\nbase {\n archivesName = \"examplemod\"\n}\n\nrepositories {\n mavenCen...
{ "must_compile": false, "required_annotations": [ "plugins {", "net.neoforged.gradle.userdev", "JavaLanguageVersion.of(21)", "neoforge:21.1.77", "runs {", "client()", "server()", "data()" ], "forbidden_apis": [ "net.minecraftforge", "forgegradle", "ForgeGradle" ], ...
null
BUILD_002
build
neoforge
1.21.1
single_file
Write a complete `neoforge.mods.toml` for NeoForge 1.21.1: mod `examplemod` v1.0.0, MIT license, required NeoForge [21.1.0,) and Minecraft [1.21.1], optional client-side JEI dependency, and a mixin config registration.
""
"# META-INF/neoforge.mods.toml\nmodLoader = \"javafml\"\nloaderVersion = \"[4,)\"\nlicense = \"MIT\"\nissueTrackerURL = \"https://github.com/example/examplemod/issues\"\n\n[[mods]]\nmodId = \"examplemod\"\nversion = \"1.0.0\"\ndisplayName = \"Example Mod\"\ndescription = \"An example mod for NeoForge 1.21.1.\"\nauthors...
{ "must_compile": false, "required_annotations": [ "modLoader = \"javafml\"", "loaderVersion = \"[4,)\"", "[[mods]]", "[[dependencies.neoforge]]", "[[dependencies.minecraft]]", "[[mixins]]", "neoforge.mods.toml" ], "forbidden_apis": [], "gametest_required": false, "allowed_legacy...
null
BUILD_003
build
neoforge
1.21.1
single_file
Add CurseMaven to a NeoForge 1.21.1 `build.gradle.kts` so that CurseForge-ported mods can be declared as `implementation` dependencies, and declare JEI via a curse.maven coordinate. Use content filtering so CurseMaven only serves `curse.maven`.
""
"repositories {\n exclusiveContent {\n forRepository {\n maven {\n name = \"CurseMaven\"\n url = uri(\"https://cursemaven.com\")\n }\n }\n filter {\n includeGroup(\"curse.maven\")\n }\n }\n mavenCentral()\n maven(\"ht...
{ "must_compile": false, "required_annotations": [ "cursemaven.com", "curse.maven", "exclusiveContent", "includeGroup" ], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
BUILD_004
build
neoforge
1.21.1
single_file
Configure Modrinth publishing with the Minotaur plugin in `build.gradle.kts` for a NeoForge 1.21.1 mod: project id `examplemod`, game version 1.21.1, loader `neoforge`, release type `release`, uploading the main jar.
""
"plugins {\n id(\"com.modrinth.minotaur\") version \"2.+\"\n}\n\nmodrinth {\n token.set(providers.gradleProperty(\"modrinthToken\").orElse(providers.environmentVariable(\"MODRINTH_TOKEN\")))\n projectId.set(\"examplemod\")\n versionNumber.set(project.version.toString())\n versionType.set(\"release\")\n ...
{ "must_compile": false, "required_annotations": [ "com.modrinth.minotaur", "modrinth {", "projectId", "gameVersions", "loaders", "\"1.21.1\"", "\"neoforge\"" ], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
BUILD_005
build
neoforge
1.21.1
single_file
Configure Jar-in-Jar (JiJ) in NeoGradle 7 for a NeoForge 1.21.1 mod: bundle `org.example:somelib` with a Maven version range [1.2,2.0) pinned to 1.6.1. Show both the dependency block and the task wiring that makes `assemble` produce the JiJ jar.
""
"dependencies {\n implementation(\"net.neoforged:neoforge:21.1.77\")\n\n jarJar(implementation(\"org.example:somelib:[1.2,2.0)\")) {\n jarJar.pin(it, \"1.6.1\")\n }\n}\n\ntasks {\n // NG7: the jarJar task bundles the pinned dependency inside the mod jar.\n named(\"assemble\") {\n dependsOn(...
{ "must_compile": false, "required_annotations": [ "jarJar(", "jarJar.pin", "dependsOn", "[1.2,2.0)" ], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
BUILD_006
build
neoforge
1.21.1
single_file
Harden a NeoForge 1.21.1 `build.gradle.kts`: force Java 21 for compile/runtime, UTF-8 resources, `-Xlint:deprecation` warnings, and make the build fail on warnings from javac.
""
"java {\n toolchain {\n languageVersion = JavaLanguageVersion.of(21)\n }\n}\n\ntasks.withType<JavaCompile>().configureEach {\n options.encoding = \"UTF-8\"\n options.compilerArgs.addAll(listOf(\"-Xlint:deprecation\", \"-Werror\"))\n options.release.set(21)\n}\n\ntasks.withType<ProcessResources>()....
{ "must_compile": false, "required_annotations": [ "JavaLanguageVersion.of(21)", "options.encoding = \"UTF-8\"", "-Xlint:deprecation", "options.release.set(21)" ], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
BUILD_007
build
neoforge
1.21.1
single_file
A 1.20.1 ForgeGradle project migrates to NeoForge 1.21.1 with ModDevGradle (MDG). Write the complete `build.gradle.kts` using the `net.neoforged.moddev` plugin, including run configs and the neoforge version 21.1.77.
""
"plugins {\n id(\"java-library\")\n id(\"net.neoforged.moddev\") version \"1.0.24\"\n}\n\ngroup = \"com.example\"\nversion = \"1.0.0\"\n\njava {\n toolchain {\n languageVersion = JavaLanguageVersion.of(21)\n }\n}\n\nneoForge {\n version = \"21.1.77\"\n parchment {\n // optional: mappings...
{ "must_compile": false, "required_annotations": [ "net.neoforged.moddev", "neoForge {", "version = \"21.1.77\"", "client()", "server()", "data()", "mods {" ], "forbidden_apis": [ "net.minecraftforge", "forgegradle", "ForgeGradle" ], "gametest_required": false, "all...
null
BUILD_008
build
neoforge
1.21.1
single_file
Wire an access transformer for NeoForge 1.21.1 with NeoGradle 7: register `META-INF/accesstransformer.cfg` in the build and show the AT file using the NEW NeoForge syntax (no leading `#`) to make the private field `net.minecraft.client.Minecraft.soundHandler` public and to make `net.minecraft.world.entity.LivingEntity....
""
"// build.gradle.kts (NeoGradle 7)\naccessTransformers {\n file(project.file(\"src/main/resources/META-INF/accesstransformer.cfg\"))\n}\n\n# src/main/resources/META-INF/accesstransformer.cfg\n# NeoForge 1.20.2+ syntax: <access>[-final-f] <fully.qualified.Class>[ field:|method()|()]\npublic net.minecraft.client.Minec...
{ "must_compile": false, "required_annotations": [ "accessTransformers {", "accesstransformer.cfg", "public net.minecraft.client.Minecraft soundHandler", "public-f net.minecraft.world.entity.LivingEntity hurtTime" ], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": []...
null
BUILD_009
build
neoforge
1.21.1
single_file
Set up repositories for a NeoForge 1.21.1 project that needs: (1) NeoForged maven for the loader, (2) Modrinth maven for runtime mods, (3) CurseMaven, each with content filtering. Write the repositories block.
""
"repositories {\n mavenCentral()\n\n maven(\"https://maven.neoforged.net/releases\") {\n content { includeGroupByRegex(\"net\\\\.neoforged.*\") }\n }\n\n exclusiveContent {\n forRepository {\n maven(\"https://api.modrinth.com/maven\") {\n name = \"Modrinth\"\n ...
{ "must_compile": false, "required_annotations": [ "maven.neoforged.net", "api.modrinth.com/maven", "cursemaven.com", "includeGroup(\"maven.modrinth\")", "includeGroup(\"curse.maven\")" ], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
BUILD_010
build
neoforge
1.21.1
single_file
Expand `${mod_version}` / `${mc_version}` placeholders into `neoforge.mods.toml` during processResources in a Gradle 8 Kotlin DSL build, handling CRLF safely and enabling template expansion only for that file.
""
"val modVersion = project.version.toString()\nval mcVersion = \"1.21.1\"\n\ntasks.processResources {\n inputs.property(\"mod_version\", modVersion)\n inputs.property(\"mc_version\", mcVersion)\n\n filesMatching(\"META-INF/neoforge.mods.toml\") {\n expand(\n \"mod_version\" to modVersion,\n ...
{ "must_compile": false, "required_annotations": [ "filesMatching", "META-INF/neoforge.mods.toml", "expand(", "filteringCharset" ], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
BUILD_011
build
neoforge
1.21.1
single_file
Make Mixin's annotation processor generate the refmap for a NeoForge 1.21.1 NeoGradle 7 build, and register the mixin config in the mod metadata. Show the dependency line and compiler config.
""
"dependencies {\n implementation(\"net.neoforged:neoforge:21.1.77\")\n\n // Mixin annotation processor -> generates examplemod.refmap.json at compile time\n annotationProcessor(\"org.spongepowered:mixin:0.8.7:processor\")\n}\n\n// neoforge.mods.toml additionally needs:\n// [[mixins]]\n// config = \"examplemod....
{ "must_compile": false, "required_annotations": [ "annotationProcessor", "org.spongepowered:mixin:0.8.7", "refmap", "[[mixins]]" ], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
BUILD_012
build
neoforge
1.21.1
single_file
Structure a multi-loader NeoForge 1.21.1 workspace: a `common` source set holding shared code and a `main` (neoforge) source set depending on it. Write the source set configuration and cross-source-set dependency in `build.gradle.kts`.
""
"sourceSets {\n val common = create(\"common\") {\n java {\n srcDir(\"src/common/java\")\n }\n resources {\n srcDir(\"src/common/resources\")\n }\n }\n val main = main {\n java {\n srcDir(\"src/main/java\")\n }\n resources {\n ...
{ "must_compile": false, "required_annotations": [ "sourceSets {", "create(\"common\")", "compileClasspath", "runtimeClasspath", "modSource" ], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
BUILD_013
build
neoforge
1.21.1
single_file
Pin the Gradle distribution and configure `settings.gradle.kts` plugin resolution (Gradle Plugin Portal + NeoForged maven) for a NeoForge 1.21.1 project. Show both files.
""
"# gradle/wrapper/gradle-wrapper.properties\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.9-bin.zip\nnetworkTimeout=10000\nvalidateDistributionUrl=true\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n\n// settings.gra...
{ "must_compile": false, "required_annotations": [ "gradle-8.9-bin.zip", "pluginManagement {", "gradlePluginPortal()", "maven.neoforged.net/releases", "rootProject.name" ], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
BUILD_014
build
neoforge
1.21.1
single_file
Configure a data-generation run for NeoGradle 7 / NeoForge 1.21.1 that writes generated resources into `src/generated/resources` while keeping `src/main/resources` readable for `--existing`, then wire the generated folder into the source sets.
""
"sourceSets.main {\n resources {\n srcDir(\"src/generated/resources\")\n }\n}\n\nruns {\n data {\n data()\n programArguments.addAll(\n \"--mod\", \"examplemod\",\n \"--all\",\n \"--output\", file(\"src/generated/resources/\").absolutePath,\n \"--...
{ "must_compile": false, "required_annotations": [ "src/generated/resources", "--output", "--existing", "data()" ], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
BUILD_015
build
neoforge
1.21.1
single_file
Explain and configure jar packaging for NeoForge 1.21.1: why `reobfJar` no longer exists, and make `assemble` depend on the jarJar task so the published jar contains JiJ'd dependencies.
""
"/*\n * Since NeoForge 1.20.2+ (and 1.21.x), the runtime uses Mojmap classes directly.\n * There is NO SRG reobfuscation step anymore: `reobfJar` does not exist in NeoGradle 7 /\n * ModDevGradle, and the plain `jar` task output is the final distributable artifact.\n */\ntasks {\n named(\"assemble\") {\n depen...
{ "must_compile": false, "required_annotations": [ "reobfJar", "jarJar", "dependsOn", "Mojmap" ], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
BUILD_016
build
neoforge
1.21.1
single_file
Add CurseForge publishing with `curseforgegradle` for a NeoForge 1.21.1 mod: api key from gradle property/env, project id 111222, game version 1.21.1, java version 21, release type release, uploading the jar.
""
"plugins {\n id(\"net.darkhax.curseforgegradle\") version \"1.1.24\"\n}\n\ntasks.create<net.darkhax.curseforgegradle.TaskPublishCurseForge>(\"publishCurseForge\") {\n apiToken = providers.gradleProperty(\"curseforgeToken\")\n .orElse(providers.environmentVariable(\"CURSEFORGE_TOKEN\"))\n .orElse(\"\...
{ "must_compile": false, "required_annotations": [ "net.darkhax.curseforgegradle", "TaskPublishCurseForge", "apiToken", "addGameVersion(\"1.21.1\")", "addModLoader(\"NeoForge\")" ], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
BUILD_017
build
neoforge
1.21.1
single_file
Write a GitHub Actions workflow that builds a NeoForge 1.21.1 mod on pushes to main: Java 21 (Temurin), Gradle 8 wrapper caching, `./gradlew build`.
""
"name: Build\n\non:\n push:\n branches: [ main ]\n pull_request:\n\njobs:\n build:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n\n - name: Set up JDK 21\n uses: actions/setup-java@v4\n with:\n distribution: temurin\n java-version: 21\n\n - n...
{ "must_compile": false, "required_annotations": [ "setup-java@v4", "java-version: 21", "./gradlew build", "upload-artifact@v4", "setup-gradle@v4" ], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
BUILD_018
build
neoforge
1.21.1
single_file
Write `gradle.properties` tuning for a NeoForge 1.21.1 project: 4 GB daemon heap (NeoForm needs memory), parallel execution, configuration cache, and moddev/userdev-friendly JVM args. Also declare the mod version properties.
""
"# Memory: NeoForm/NeoForge tooling decompiles a lot; 4G heap is the practical floor.\norg.gradle.jvmargs=-Xmx4G -XX:+UseParallelGC\norg.gradle.parallel=true\norg.gradle.caching=true\norg.gradle.configuration-cache=true\n\n# Mod metadata used by processResources expansion\nmod_version=1.0.0\nminecraft_version=1.21.1\nn...
{ "must_compile": false, "required_annotations": [ "-Xmx4G", "org.gradle.parallel=true", "org.gradle.caching=true", "mod_version=", "neoforge_version=" ], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
BUILD_019
build
neoforge
1.21.1
single_file
Write the `neoforge.mods.toml` dependency tables for a mod that (a) REQUIRES neoforge [21.1.0,) and minecraft [1.21.1], (b) hard-requires a companion mod AFTER it loads on both sides, and (c) breaks on a known-broken companion version range. Use the correct `type`, `ordering`, `versionRange` and `side` fields.
""
"[[dependencies.neoforge]]\nmodId = \"neoforge\"\ntype = \"required\"\nversionRange = \"[21.1.0,)\"\nordering = \"NONE\"\nside = \"BOTH\"\n\n[[dependencies.minecraft]]\nmodId = \"minecraft\"\ntype = \"required\"\nversionRange = \"[1.21.1]\"\nordering = \"NONE\"\nside = \"BOTH\"\n\n[[dependencies.companionlib]]\nmodId =...
{ "must_compile": false, "required_annotations": [ "type = \"required\"", "type = \"incompatible\"", "ordering = \"AFTER\"", "side = \"BOTH\"", "[21.1.0,)", "[1.21.1]" ], "forbidden_apis": [], "gametest_required": false, "allowed_legacy_apis": [] }
null
BUILD_020
build
neoforge
1.21.1
single_file
Capstone migration: convert this Forge 1.20.1 Groovy build.gradle (ForgeGradle 6) to a NeoForge 1.21.1 ModDevGradle Kotlin DSL build. Preserve group/version and the client/server runs.
"// Forge 1.20.1 build.gradle (Groovy, ForgeGradle 6)\nplugins {\n id 'net.minecraftforge.gradle' version '[6.0,6.2)'\n}\n\nversion = '1.0.0'\ngroup = 'com.example'\n\njava {\n archivesBaseName = 'examplemod'\n toolchain { languageVersion = JavaLanguageVersion.of(17) }\n}\n\nminecraft {\n mappings channel: ...
"// NeoForge 1.21.1 build.gradle.kts (ModDevGradle)\nplugins {\n id(\"java-library\")\n id(\"net.neoforged.moddev\") version \"1.0.24\"\n}\n\nversion = \"1.0.0\"\ngroup = \"com.example\"\n\nbase {\n archivesName = \"examplemod\"\n}\n\njava {\n toolchain {\n languageVersion = JavaLanguageVersion.of(21...
{ "must_compile": false, "required_annotations": [ "net.neoforged.moddev", "neoForge {", "version = \"21.1.77\"", "JavaLanguageVersion.of(21)", "client()", "server()" ], "forbidden_apis": [ "net.minecraftforge", "forgegradle", "ForgeGradle" ], "gametest_required": false, ...
null
End of preview. Expand in Data Studio

ForgeBench v2 — dual-target Forge 1.20.1 / NeoForge 1.21.1 evaluation benchmark

Dataset: ComerX/forgebench-v2 · Predecessor: ComerX/forgebench-v1 Task: code generation benchmark for Minecraft loader migration, 130 tasks.

What changed vs v1 (and why)

v1 defect v2 fix
net.minecraftforge.* hard-coded as hallucination for ALL targets (Forge 1.20.1 code scored 0) target-aware profiles in ast_eval.py: forge-1.20.1 allows net.minecraftforge.* natively; neoforge-1.21.1 penalizes it
Single MDK template (NeoForge 21.1.77) dual templates: template-forge-1.20.1 (ForgeGradle 6, JDK 17, Gradle 8.1.1) + template-neoforge-1.21.1 (NeoForge 21.1.77, JDK 21, Gradle 8.9); --target switch
api module punished Forge 1.20.1 via forbidden_apis new native forge tasks FORGE_API_001..020 (registry, events, capabilities, config, menus, networking, datagen, ...)
Porting limited to single-file micro-refactors new porting module: PORT_001..010 multi-file slices (context = Forge 1.20.1 slice, golden = NeoForge 1.21.1 file set); architecture chain example PORT_006 (block → BlockEntity → Menu → Screen → registries → client event)
ast_eval was globally static per-target profiles, --self-test mode, tokenizer fallback for modern grammar (records/switch), comment-aware resource gate

Contents

data/forgebench_v2_full.jsonl   130 tasks (merged)
data/schema_example_v2.jsonl    schema examples
parts/forge_api_{a..d}.jsonl    FORGE_API_001..020  (forge 1.20.1, single_file)
parts/porting_{a..c}.jsonl      PORT_001..010        (neoforge 1.21.1, multi_file)
harness/Dockerfile              dual-target sandbox image
harness/sandbox_runner.py       --target forge-1.20.1 | neoforge-1.21.1; single-file & multi-file staging
harness/ast_eval.py             target-aware static gate (+ --self-test)
harness/run_benchmark.py        batch driver
harness/gametest_runner.py      GameTest stage (optional, gametest_required tasks)
harness/judge_prompt.txt        LLM-as-a-Judge prompt
template-forge-1.20.1/          ForgeGradle 6 MDK template (Java 17)
template-neoforge-1.21.1/       NeoForge 21.1.77 MDK template (Java 21)
VERIFICATION.md                 self-verification results

Task schema (v2)

{
  "task_id": "FORGE_API_014 | PORT_003 | ...",
  "module": "api | mixin | migration | debug | build | porting",
  "target_loader": "forge | neoforge",
  "target_version": "1.20.1 | 1.21.1",
  "task_scope": "single_file | multi_file",
  "instruction": "...",
  "context": "string | {relative_path: code}",
  "golden_reference": "string | {relative_path: code}",
  "eval_criteria": {
    "must_compile": true,
    "required_annotations": ["@Mod", "@SubscribeEvent"],
    "forbidden_apis": ["net.neoforged (forge tasks) | net.minecraftforge (neoforge tasks)"],
    "allowed_legacy_apis": [],
    "gametest_required": false
  }
}

Composition: api 40 (20 v1-neoforge + 20 forge-native) · mixin 20 · migration 20 · debug 20 · build 20 · porting 10. Targets: neoforge-1.21.1 × 110 · forge-1.20.1 × 20. Scopes: single_file × 120 · multi_file × 10.

Runner usage

docker build -t forgebench-sandbox:v2 harness/
# single file, forge target:
python3 harness/sandbox_runner.py --task task.json --code-file answer.java --target forge-1.20.1
# multi-file porting:
python3 harness/sandbox_runner.py --task task.json --candidate-dir answer/ --target neoforge-1.21.1
# static gate + golden self-test:
python3 harness/ast_eval.py --task task.json --code answer.java
python3 harness/ast_eval.py --task task.json --self-test

Honest limitations

  1. Gradle compile gates are NOT executed at publication time. Publication host has a ~4 GB memory ceiling and no guaranteed Docker; NeoForm decompilation needs ≥8 GB. The harness, templates and both targets are shipped untested-by-execution; the golden self-verification performed is static only (ast_eval --self-test, 130/130 pass) plus schema and contamination checks. Do not cite compile-validated numbers for v2 until a ≥8 GB runner executes the sandbox end-to-end.
  2. Gradle wrapper JARs are binaries: copy them from the official MDK archives into both template trees before docker build (see harness/Dockerfile header).
  3. ast_eval.py uses javalang (Java 8 grammar): modern-syntax answers (records, switch expressions) fall back to regex checks with a PARSE_LIMITATION info finding — no score penalty; the authoritative gate is the sandbox Gradle build.
  4. Porting slices are focused (1–6 files, avg 2.4); PORT_006 is the full 6-file architecture chain. Broader slices (5–10 files) are reserved for v2.1.
  5. The sandbox resource gate forbids raw javac and Mockito; gradle build is the only compile authority.

License

Tasks are original synthetic artifacts (CC0-1.0 for the benchmark data). Harness: Apache-2.0. ForgeBench tasks are contamination-checked against the ComerX SFT corpus (see VERIFICATION.md).

Downloads last month
59