π¨π³ δΈζη | π¬π§ English
A compatibility bridge that enables NeoForge mods to run seamlessly on Minecraft Forge 1.21 without any modifications.
ReForged is an innovative runtime adapter that bridges the gap between NeoForge and Forge modloaders. It dynamically loads NeoForge mods and translates their API calls to Forge equivalents using advanced bytecode transformation techniques.
Author: Mai_xiyu
Version: 1.0.0
License: All Rights Reserved
- π Zero JAR Modification β NeoForge mods work without repackaging or rebuilding
- π Dynamic Loading β Runtime discovery and loading of NeoForge mods
- π§ Bytecode Transformation β ASM-powered translation of NeoForge API calls to Forge
- π― Event Bus Bridging β Transparent event system compatibility
- π¦ Resource Integration β NeoForge mod assets (textures, models, recipes) automatically available
- βοΈ Automatic Configuration β Seamless conversion of
neoforge.mods.tomlto Forge format - π¨ Comprehensive Patching β 91 Mixin patches for edge case compatibility
- π οΈ API Shims β Drop-in replacements for DeferredRegister, CreativeTabs, Attachments, and more
ReForged implements a sophisticated multi-layer compatibility system:
ReForged Initialization
β
Scan mods/ folder for NeoForge JARs (neoforge.mods.toml)
β
For each NeoForge mod:
β’ Convert metadata to Forge format
β’ Create isolated ClassLoader
β’ Transform bytecode with ASM
β’ Remap NeoForge API references to shim classes
β’ Instantiate mod with bridged event bus
β
Register mod resources as Minecraft resource packs
| Component | Purpose |
|---|---|
| NeoForgeModLoader | Discovers and instantiates NeoForge mods at runtime |
| BytecodeRewriter | ASM-based class transformation engine |
| ReForgedRemapper | Rewrites NeoForge class references to Forge equivalents |
| NeoForgeEventBusAdapter | Dynamic proxy bridging event bus systems |
| Shim Layer | Drop-in API replacements for NeoForge classes |
| Mixin System | 91 patches for Minecraft/Forge compatibility |
- Install Minecraft 1.21 with Forge 51.0.33 or higher
- Download ReForged mod JAR
- Place both ReForged and your NeoForge mods into the
.minecraft/mods/folder - Launch the game β ReForged will automatically detect and load NeoForge mods
That's it! No configuration required.
- Java 21 or higher
- Git
# Clone the repository
git clone https://github.com/Mai-xiyu/ReForged.git
cd ReForged
# Build the mod
./gradlew build
# The compiled JAR will be in build/libs/./gradlew runClient # Launch game client
./gradlew runServer # Launch dedicated server
./gradlew runData # Generate data/assets
./gradlew runGameTestServer # Run game testsReForged uses ASM (Java bytecode manipulation framework) to rewrite class references:
net.neoforged.neoforge.common.NeoForgeβorg.xiyu.reforged.shim.NeoForgeShimnet.neoforged.bus.api.IEventBusβ Custom proxy wrapper- Event registrations β Forwarded to Forge's event bus
When a NeoForge mod registers an event listener:
NeoForge.EVENT_BUS.register(listener);ReForged intercepts this and:
- Analyzes the listener for
@SubscribeEventannotations - Registers the handler on Forge's
MinecraftForge.EVENT_BUS - Wraps/unwraps event objects as needed for compatibility
NeoForge mod JARs are automatically registered as Minecraft resource packs, making their:
- Textures (
assets/) - Models
- Recipes (
data/) - Tags
- Other data files
...immediately available to the game.
- Minecraft: 1.21
- Forge: 51.0.33 or higher
- Java: 21 or higher
ReForged aims to provide broad compatibility with NeoForge mods, but some limitations may apply:
- β Most NeoForge API features supported
- β Event systems fully bridged
- β Registry systems (DeferredRegister) compatible
- β Creative tabs and item groups work
- β Network packets handled
β οΈ Some advanced NeoForge-exclusive features may not be availableβ οΈ Mods with deep NeoForge integration may require additional patches
The table below outlines the expected compatibility for different types and scales of NeoForge mods on ReForged.
| Mod Type | Typical Examples | Expected Compat | Notes |
|---|---|---|---|
| Item / Block mods | New ores, decorations, tools & weapons | β Excellent | DeferredRegister, CreativeTabs, item properties, food components are fully bridged |
| Worldgen mods | Custom ore veins, structures, biome modifiers | β Good | BiomeModifier/StructureModifier framework implemented; datapack-driven generation works |
| Recipe / Crafting extensions | Custom recipe types, conditional recipes | β Good | ICondition system and custom RecipeSerializer available |
| Capability / Attachment mods | Energy, fluid, item storage | β Good | IEnergyStorage/IFluidHandler/IItemHandler fully implemented; AttachmentType bridges to Forge Capability |
| Network / Payload mods | Custom payload communication | β Good | PayloadRegistrar registration and bidirectional reply() implemented |
| Client rendering mods | Custom models, particles, HUD overlays | Basic model loading (OBJ/JSON), RenderType registration, GUI events available; deep BakedModel transforms and custom shaders may need adaptation |
|
| Info / Tooltip mods | Jade, WTHIT, JEI plugins | Depends on how deeply the mod relies on NeoForge extension interfaces; Jade has a dedicated Mixin patch | |
| Large content mods | Mekanism, Create, etc. | DataMap, BiomeModifier codecs, attribute modifier events, RenderBuffers injection, DimensionSpecialEffects injection, GUI layer ordering, Flywheel GPU rendering pipeline all implemented; most core features run, some edge paths may need extra patches | |
| Core / Low-level mods | Custom ModLoader extensions, ServiceLoader overrides | β Unsupported | Mods that manipulate FML internals or NeoForge bootstrap stages cannot be shimmed |
Scale Reference:
- Small mods (< 50 classes): Only use
DeferredRegister, event listeners, simple Capabilities β most will run out of the box. - Medium mods (50β300 classes): Include custom networking, client rendering, datagen, conditional recipes β core features mostly work, some advanced features may need adaptation.
- Large mods (300+ classes): Deep use of DataMaps, custom HolderSets, multiblock entity sync, complex render pipelines β case-by-case evaluation needed, some functionality may be missing.
Rule of thumb: If a NeoForge mod's core functionality only relies on the registry system + event bus + basic Capabilities (item/energy/fluid), it will most likely work on ReForged. The heavier a mod's reliance on NeoForge-exclusive deep vanilla patches, the higher the compatibility risk.
Latest implementation snapshot, approximate as of 2026-04-27.
| Subsystem | Weight | Completion | Weighted Score |
|---|---|---|---|
| Mod loading pipeline | 20% | 88% | 17.6 |
| Event system | 20% | 98% | 19.6 |
| Registry system | 15% | 95% | 14.25 |
| Capability system | 10% | 95% | 9.5 |
| Network / Payload | 8% | 84% | 6.72 |
| Extension / Common API | 12% | 97% | 11.64 |
| Client side | 10% | 98% | 9.8 |
| Mixin coverage | 5% | 96% | 4.8 |
| Total | 100% | ~94% |
- Event system (major): Added 60 Forge wrapper constructors enabling automatic event bridging via
NeoForgeEventBusAdapter. Covers server lifecycle, entity, living, player, level, village, brewing, enchanting, and grindstone events. - ClientHooks: Expanded from 18 β 108 methods with full
ForgeHooksClientdelegation. - EventHooks / CommonHooks: Added ~27 missing methods.
- Client + Common event wrappers (~60): Full coverage for rendering, input, lifecycle, entity, chunk events.
- Registry system: Implemented DataMap system, HolderSetType codecs, DeferredHolder tag resolution.
- EntityEvent.Size: Added
pose/oldSize/newSize/newEyeHeightfields with getters/setters. - GuiGraphics 9-slice rendering: New
GuiGraphicsExtensionMixinimplementingblitWithBorder()(9-slice) andblitInscribed()(aspect-ratio preserving). - CommonHooks.extractLookupProvider: Multi-field-name retry (3 mapping names) + server fallback.
- CommonHooks.tryDispenseShearsHarvestBlock: Full harvest logic via Forge's
IForgeShearable. - BiomeModifier codecs: All 4 types (AddFeatures/RemoveFeatures/AddSpawns/RemoveSpawns) fully implemented with
RecordCodecBuilder+RegistryCodecs.homogeneousList(). - StructureModifier:
NoneStructureModifierwith realMapCodec.unit()codec. - ClientHooks event delegation:
getDetachedCameraDistance()firesCalculateDetachedCameraDistanceEvent;onScreenshot()posts to NeoForge event bus. - DimensionSpecialEffects: Reflective injection of mod-registered effects into vanilla's static
EFFECTSmap β fixes Twilight Forest sky rendering. - RenderBuffers: Reflective injection of custom
RenderTypebuffers intoBufferSource.fixedBuffersβ fixes Create's custom rendering. - IEntityWithComplexSpawn: Bridged to Forge's
IEntityAdditionalSpawnDatawithRegistryFriendlyByteBuf β FriendlyByteBufdefault method adapters.
- ItemStack attribute modifier hook: New Mixin injects into both
ItemStack.forEachModifier()overloads, routing throughIItemStackExtension.getAttributeModifiers()to fireItemAttributeModifierEventβ fixes Create's dynamic attribute modifications. - DataMap infrastructure:
RegisterDataMapTypesEventfired duringcommonSetup; newDataMapInitializerpopulates built-in DataMaps from vanillaComposterBlock.COMPOSTABLESandForgeHooks.getBurnTime()(compostable values, fuel burn times). - EventHooks event activation:
canEntityContinueSleeping()β firesCanContinueSleepingEventreturning event resultgetEnchantmentLevelSpecific()/getAllEnchantmentLevels()β firesGetEnchantmentLevelEventwith modifiable enchantment mapgetCustomSpawners()β firesModifyCustomSpawnersEventwith mutable spawner list
- GetEnchantmentLevelEvent: Upgraded to carry a modifiable
Map<Holder<Enchantment>, Integer>enchantment map. - ModifyCustomSpawnersEvent: Upgraded to carry a mutable
List<CustomSpawner>spawner list. - RegisterGuiLayersEvent ordering fix:
registerAbove()/registerBelow()now useForgeLayeredDraw.addAbove()/addBelow()for correct Z-ordering β fixes Create goggle/schematic overlay display.
- Create Accessor Interface Bridge (33 interfaces): Complete BytecodeRewriter-based solution for all 33 Create accessor/extension interfaces.
CHECKCASTredirects from NeoForge accessor types to vanilla MC target classes;INVOKEINTERFACEβINVOKEVIRTUALrewrites. 24 new Mixin files inject accessor method bodies into vanilla classes (e.g.,LevelRendererAccessorMixin,ParticleEngineAccessorMixin,GameRendererAccessorMixin). - Flywheel Accessor Interface Bridge (10 interfaces): Same pattern applied to all 7 Flywheel accessor interfaces + 3 extension interfaces. Covers
LevelRendererAccessor,AbstractClientPlayerAccessor,LightEngineAccessor,LayerLightSectionStorageAccessor,SkyDataLayerStorageMapAccessor,ModelPartAccessor,PoseStackAccessor, plusLevelExtension,PoseStackExtension,SkyLightSectionStorageExtension. - Flywheel Render Pipeline Hooks:
FlywheelLevelRendererMixininjects intoLevelRenderer.renderLevel()at 4 injection points (beginRender, beforeBlockEntities, beforeCrumbling, endRender).FlywheelRenderBridgeuses reflection to invoke Flywheel'sFlwBackend/VisualizationManagerImplthrough the NeoModClassLoader boundary. - EventBusHelper Boolean ClassCast Fix: Rewrote
postAndReturn()to bypass the IEventBus proxy entirely β callsNeoForgeEventBusAdapter.dispatchFallback()+MinecraftForge.EVENT_BUS.post()directly, eliminatingReloadLevelRendererEvent cannot be cast to Boolean. - SkyLightSectionStorage Extension: Complex mixin implementing Flywheel's
flywheel$skyDataLayer(long)β traverses upward through light sections usingFlywheelSkyStorageMapHelper(transformer-classloader interface) to bridgeSkyDataLayerStorageMap's package-private fields. - AABB.INFINITE CoreMod: JavaScript coremod patches
AABBclass to add theINFINITEstatic field (NeoForge addition not present in Forge). - Standalone ModelResourceLocation: CoreMod fixes
ModelResourceLocation.standalone()factory method for models without block state variants. - Verifier Stack Frame Fix: BytecodeRewriter now patches stack frame types to replace NeoForge accessor interface descriptors with vanilla MC class descriptors β fixes
VerifyErrorfrom JVM bytecode verification.
- Flywheel render stabilization:
FlywheelRenderBridgenow owns the client render coordination path for camera mode changes, render origin changes, GL state sync, fog/light uniform sync, deferred visual refresh, block entity visual lifecycle, and vanilla-render skip decisions. - Third-person stability: Removed the diagnostic third-person
afterEntitiesshort circuit and kept first/third person on the same state synchronization path, fixing the large black Flywheel geometry failure without relying on high-frequency logs. - Reload/re-entry recovery: Added bounded visual refresh behavior for renderer reloads, camera mode transitions, render-origin moves, and light/section invalidation so Create/Flywheel block entity visuals recover after
F3+A, world re-entry, block updates, and lighting changes. - NeoForge fluid and decorator APIs:
FluidType.wrap()is the single Forge-to-NeoForge fluid wrapper entry point;FluidInteractionRegistrynow follows the NeoForgeFluidType + Function<FluidState, BlockState>shape; item decorators are normalized to ForgeIItemDecorator. - Recipe/data pack compatibility: NeoForge recipe conditions, fluid ingredients, conditional recipe codecs, and optional entity-type tag entries are normalized for Forge's loader, reducing safe-world creation warnings from Create data.
- RegisterEvent classloader hardening: Neo mod loading now anchors to the game classloader and event callbacks temporarily use the NeoMod context classloader, reducing AppClassLoader/TransformingClassLoader splits during entity and registry initialization.
- Model and overlay polish: Additional geometry now receives real section context, AO/model data bridging is retained, and Create factory panel vanilla overlay rendering is preserved so center item/count overlays can render on top of Flywheel visuals.
- The percentages above are engineering estimates, not formal test pass rates.
- 865 Java source files total, including 688
net.neoforgedshim files and 100 mixin files, plus 10 JavaScript CoreMods. - Only 4
UnsupportedOperationExceptionremain β all intentional by design (e.g.PartEntity.getAddEntityPacket(),ClientCommandSourceStack.getServer()). - The biggest remaining gaps are advanced entity sync protocols, NeoForge-exclusive deep vanilla patch behavior (e.g. PistonPushReaction extension), custom low-level loader integration, and uncovered edge paths in large mods beyond the Create/Flywheel validation matrix.
ReForged/
βββ src/main/java/org/xiyu/reforged/
β βββ Reforged.java # Main mod entry point
β βββ core/ # Mod loading and ASM transformation
β βββ shim/ # API replacement layer
β βββ bridge/ # Event and system bridges
β βββ asm/ # Advanced bytecode manipulation
β βββ mixin/ # Mixin patches for compatibility
β βββ util/ # Utility classes
βββ src/main/resources/
β βββ META-INF/
β β βββ mods.toml # Forge mod metadata
β β βββ accesstransformer.cfg # Access widening config
β βββ reforged.mixins.json # Mixin configuration
β βββ coremods/ # JavaScript CoreMod patches
βββ build.gradle # Build configuration
All Rights Reserved Β© 2025-2026 Mai_xiyu
If you encounter issues or have questions:
- Check if the NeoForge mod is compatible with Forge 1.21
- Verify Java 21 is installed
- Check the game logs for error messages
- Open an issue on the GitHub repository
Developed by Mai_xiyu
Special thanks to:
- The Forge team for the Forge modding API
- The NeoForge team for the NeoForge modding API
- The ASM and Mixin communities for bytecode manipulation tools
Note: This is a community project and is not officially affiliated with or endorsed by the Forge or NeoForge teams.
