tutorial:mixin_introduction
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| tutorial:mixin_introduction [2020/02/07 02:00] – created draylar | tutorial:mixin_introduction [2025/12/17 17:09] (current) – Add links to Java Bytecode Docs page gauntrecluse | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Introduction to Mixins ====== | + | FIXME //The Mixin related pages of the Fabric Wiki are undergoing |
| - | Mixins | + | |
| - | For a complete walkthrough | + | ====== Introduction to Mixins (WIP) ====== |
| - | | + | Mixins are a powerful and important tool used in the Fabric ecosystem and other modding frameworks for Minecraft. Their primary use case is modifying existing code in the base game, |
| - | | + | whether it be through injecting custom logic, removing mechanics, or modifying values. Note that **only Mixins written in Java are directly supported**.((This applies even if you use Kotlin or another language running on the Java Virtual Machine for the rest of your mod. Whilst it may be technically possible to use other JVM languages, there are currently no plans to support it or document such a process. Note that Kotlin in particular is directly incompatible with Mixin without providing additional compatibility layers.)) |
| + | |||
| + | Mixin is a complex subsystem which uses a mod's Mixin classes | ||
| + | ((Mixin classes are not classes in the same way as " | ||
| + | to transform the targeted classes' | ||
| + | |||
| + | It is not recommended to try and learn how Mixin works or how to use it without prior knowledge of what Java bytecode is, as Mixin applies to bytecode rather than " | ||
| + | Similarly, Mixin and this documentation expects the user to already be familiar with [[tutorial: | ||
| + | It is recommended to leverage the [[https:// | ||
| + | |||
| + | Mixin can do its work throughout the game's lifecycle, however, a Mixin' | ||
| + | |||
| + | There are different tools Mixin and MixinExtras | ||
| + | ((Since Fabric Loader 0.15, MixinExtras is bundled with Fabric. Since Loader version 0.17.0, MixinExtras major version 0.5.0 is included, and allows access to [[https:// | ||
| + | provide for modifying source code. Most of these tools are provided to the users in the form of Java annotations, | ||
| + | |||
| + | As to make reading more precise documentation easier, here is a basic overview of some of Mixin' | ||
| + | FIXME //There ought to be dedicated pages going more in depth about the different tools annotations later on. This segment as it is edited should be kept to a cursory overview of Mixin(Extras) features.// | ||
| + | |||
| + | ^ Feature ^ Overview ^ Notes ^ | ||
| + | | '' | ||
| + | | Merging | Mixin merges a Mixin class' | ||
| + | | Injectors | An injector typically refers to an annotation and an associated " | ||
| + | | Redirectors(rarely called Redirect Injectors) | Similar to injectors as described above, with the important difference that redirectors replace the target instructions with the callback, rather than only injecting new instructions. This makes it impossible for more than on Redirector to apply to the same target, making them impractical unless a hard incompatibility is intended. | Redirectors include mainly '' | ||
| + | | Overwriting | Done explicitly via '' | ||
| + | |||
| + | //For more complete information on Mixin functionality and usage view the [[https:// | ||
| + | |||
| + | The Fabric Wiki offers several articles that provide practical examples and explanations | ||
| + | | ||
| + | * [[tutorial: | ||
| + | * [[tutorial: | ||
| + | * [[tutorial: | ||
| + | * [[tutorial: | ||
| + | * [[tutorial: | ||
| + | | ||
| + | * [[tutorial: | ||
| + | * [[tutorial: | ||
| + | * [[tutorial: | ||
| + | * [[tutorial: | ||
| + | * [[tutorial: | ||
| + | * [[tutorial: | ||
| + | * [[tutorial: | ||
| + | * [[tutorial: | ||
| + | * [[tutorial: | ||
tutorial/mixin_introduction.1581040833.txt.gz · Last modified: 2020/02/07 02:00 by draylar