Back to mods

Modrinth · Minecraft mod

MixinRuntime

A minecraft mod to make mixins more powerful. It can make mixins can inject the classes that cannot be injected before and make mixinClasses can be directly use.

Choose a version Pick your version below, then grab the matching file.

Quick answer

Which MixinRuntime release should I use?

Updated 5 months ago
Latest stable file 1.0
Game version 1.20.1
Loader Forge

MixinRuntime 1.0 targets 1.20.1 with Forge. Installation on the client is optional. Installation on the dedicated server is optional. No extra mods listed for this file.

Where it goes

Is MixinRuntime required on the client, server, or both?

Installation on the client is optional. Installation on the dedicated server is optional.

Client Optional
Dedicated server Optional
Loader for this release Forge
Required install it here Optional supported, not mandatory Not supported do not install here Source doesn’t say do not assume

The source marks this as usable on both the client and server.

What else does MixinRuntime 1.0 need?

1.0. Change the file and its required mods may change too.

No extra mods listed for this file

This file does not list any required mods. Do not add a library just because a different file uses it.

This file does not list any required or optional mods.

Before you install it

Add MixinRuntime without breaking your instance.

Built for MixinRuntime 1.0. Pick another file and the loader, install side or required mods may change.

  1. 01

    Stick to this file

    Use 1.0. It targets 1.20.1 with Forge; another release may have different loader, side or dependency requirements.

  2. 02

    Bring the mods it needs

    This file does not list any required mods. Do not add a library just because a different file uses it.

  3. 03

    Put it on the correct side

    Installation on the client is optional. Installation on the dedicated server is optional.

  4. 04

    Pick the file you checked

    Use the “Get this file” button beside 1.0. It opens that exact file at the source.

About this project

What does MixinRuntime add?

English

MixinRuntime

MixinRuntime is a NeoForge mod that enables dynamic injection of Mixin configurations at runtime, bypassing the standard Mixin library's requirement that configurations be defined during early game launch.

Features

  • Runtime Mixin Injection: Dynamically register new Mixin configurations without requiring a game restart by leveraging the Java Instrumentation API to retransform classes already resident in memory.
  • Internal Class Modification: Patches core platform classes including MixinProcessor, ModuleClassLoader, ModLauncher, and ClassTracker to enable runtime injection capabilities.
  • Utility Classes: Provides comprehensive utilities for interacting with Mixin internals, including MixinAgentUtils, MixinTransformerUtils, MixinProcessorUtils, and MixinConfigUtils for reflective access to internal Mixin structures.
  • Module System Bypass: Utilizes ModuleUtils to bypass Java Platform Module System (JPMS) restrictions by opening all modules for deep reflection access.

How It Works

The mod operates through a multi-stage bootstrap process:

  1. Agent Loading: The MixinRuntimePlugin extracts an embedded MixinRuntimeAgent.jar and self-attaches it to the JVM using the Attach API, granting access to java.lang.instrument.Instrumentation.
  2. Environment Patching: Applies class transformers to modify ModuleClassLoader, class trackers, and the MixinProcessor itself to suppress errors during runtime injection.
  3. Mixin Configuration Injection: Uses MixinProcessorUtils to dynamically inject new IMixinConfig instances into the active Mixin processor's configuration lists.

Compatibility

  • Minecraft Version: 1.20.1, 1.21 and 1.21.10
  • License: MIT

This mod is a core prerequisite for VulkanModNeoForge and has currently only been tested for compatibility with that specific mod. Since MixinRuntime modifies internal classes within ModLauncher and ModLoader, compatibility with other mods is currently unknown and may cause conflicts.

简体中文

MixinRuntime

MixinRuntime 是一款 NeoForge 模组,为 Mixin 提供了在运行时动态直接引用和注入配置的能力,无需重启游戏。该模组附带大量工具类,已在 GitHub 开源。

它绕过了标准 Mixin 库要求在游戏启动早期定义配置的限制,通过 Java Instrumentation API 实现运行时动态注册新的 Mixin 配置,甚至能重转换已加载到内存中的类。

特性

  • 运行时 Mixin 注入:利用 Java Instrumentation API,无需重启游戏即可动态注册新的 Mixin 配置,重转换已驻留内存的类。
  • 内部类修改:对核心平台类进行补丁,包括 MixinProcessor、ModuleClassLoader、ModLauncher 和 ClassTracker,以支持运行时注入能力。
  • 实用工具类:提供丰富的工具类用于与 Mixin 内部交互,包括 MixinAgentUtils、MixinTransformerUtils、MixinProcessorUtils 和 MixinConfigUtils,通过反射访问 Mixin 内部结构。
  • 模块系统绕过:利用 ModuleUtils 打开所有模块进行深度反射访问,从而绕过 Java 平台模块系统 (JPMS) 的限制。

工作原理

模组通过多阶段引导流程运行:

  1. Agent 加载:MixinRuntimePlugin 提取内嵌的 MixinRuntimeAgent.jar,并使用 Attach API 将其自附加到 JVM,从而获得 java.lang.instrument.Instrumentation 的访问权限。
  2. 环境修补:应用类转换器修改 ModuleClassLoader、类追踪器以及 MixinProcessor 自身,抑制运行时注入期间的错误。
  3. Mixin 配置注入:利用 MixinProcessorUtils 将新的 IMixinConfig 实例动态注入到活跃的 Mixin 处理器的配置列表中。同时支持使用 MixinUtils.reapply(mixinClass) 来注入原本无法直接注入的类,例如 GL11。

兼容性

  • Minecraft 版本:1.20.1,1.21 和 1.21.10
  • 许可证:MIT

该模组是正在制作的 VulkanModNeoForge 的核心前置模组之一,目前仅测试了与 VulkanModNeoForge 的兼容性。由于 MixinRuntime 修改了 ModLauncher 和 ModLoader 的内部类,与其他模组的兼容性目前未知,可能会引起冲突。

Project description from Modrinth.

Pick your setup

MixinRuntime by Minecraft version and loader

Choose the version and loader you play, then open the matching release.

6 available setups

Check the dependencies, then try the file in a copied instance before changing a world you care about.

Recent files

MixinRuntime versions and loaders

6 of 6 releases match

Looking for an older file? The official Modrinth project page is in Resources.