https://github.com/llamalad7/mixinextras
Companion library to SpongePowered Mixin with many custom injectors for a more expressive experience.
https://github.com/llamalad7/mixinextras
bytecode-manipulation java mixin
Last synced: 6 months ago
JSON representation
Companion library to SpongePowered Mixin with many custom injectors for a more expressive experience.
- Host: GitHub
- URL: https://github.com/llamalad7/mixinextras
- Owner: LlamaLad7
- License: mit
- Created: 2022-01-05T18:19:55.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2026-01-16T21:55:54.000Z (6 months ago)
- Last Synced: 2026-01-17T10:25:09.389Z (6 months ago)
- Topics: bytecode-manipulation, java, mixin
- Language: Java
- Homepage:
- Size: 966 KB
- Stars: 410
- Watchers: 13
- Forks: 25
- Open Issues: 10
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# MixinExtras
[](https://llama.is-a.dev/discord)
A small companion library to [Mixin](https://github.com/SpongePowered/Mixin/), designed to help you write your Mixins in
a more expressive and compatible way.
More information about each feature offered can be found at the [Wiki](https://github.com/LlamaLad7/MixinExtras/wiki).
## Setup
MixinExtras is available on Maven Central.
The setup steps vary based on your platform:
Fabric / Quilt
**FabricLoader 0.15.0+ includes MixinExtras already.** If you want to maintain compatibility with older versions, or
want to use a different version than is provided, see below:
```gradle
dependencies {
include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:0.5.3")))
}
```
NeoForge with ModDevGradle
**NeoForge 20.2.84+ includes MixinExtras already.** If you want to maintain compatibility with older versions, or
want to use a different version than is provided, see below:
```gradle
dependencies {
implementation(jarJar("io.github.llamalad7:mixinextras-neoforge:0.5.3"))
}
```
NeoForge with NeoGradle
**NeoForge 20.2.84+ includes MixinExtras already.** If you want to maintain compatibility with older versions, or
want to use a different version than is provided, see below:
```gradle
dependencies {
implementation(jarJar("io.github.llamalad7:mixinextras-neoforge:0.5.3")) {
jarJar.ranged(it, "[0.5.3,)")
}
}
```
Make sure to use the `-all` jar when bundling MixinExtras yourself.
Forge 1.18.2+ with ForgeGradle
```gradle
dependencies {
compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:0.5.3"))
implementation(jarJar("io.github.llamalad7:mixinextras-forge:0.5.3")) {
jarJar.ranged(it, "[0.5.3,)")
}
}
```
Forge 1.18.2+ with Architectury Loom
```gradle
dependencies {
compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:0.5.3"))
implementation(include("io.github.llamalad7:mixinextras-forge:0.5.3"))
}
```
Any other platform
This is only a rough guide. You will need to look into the specifics of setting up ShadowJar for your platform.
```gradle
plugins {
id "com.github.johnrengelman.shadow" version "8.1.0"
}
configurations {
implementation.extendsFrom shadow
}
dependencies {
shadow(annotationProcessor("io.github.llamalad7:mixinextras-common:0.5.3"))
}
shadowJar {
configurations = [project.configurations.shadow]
relocate("com.llamalad7.mixinextras", "your.package.goes.here.mixinextras")
mergeServiceFiles() // Very important!
}
```
To initialize MixinExtras, simply call
```java
MixinExtrasBootstrap.init();
```
somewhere suitably early. In almost all cases I would recommend making
an [IMixinConfigPlugin](https://github.com/SpongePowered/Mixin/blob/master/src/main/java/org/spongepowered/asm/mixin/extensibility/IMixinConfigPlugin.java)
and initializing MixinExtras in its `onLoad` method.
### You're good to go!
Enjoy using the library, and don't hesitate to open an [issue](https://github.com/LlamaLad7/MixinExtras/issues) if you
have any feedback, questions or suggestions.
## Acknowledgements

I use [YourKit's Java profiler](https://www.yourkit.com/java/profiler/) when working on MixinExtras. Many thanks to them
for providing a free license for the project.