User Tools

Site Tools


tutorial:mixin_registration

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
tutorial:mixin_registration [2025/09/23 15:35] – Rephrased naming convention section for mixin interfaces to no longer imply the I prefix for interfaces is standardized. Minor rephrasings. Fix internal link to accessor page containing "&" rather than "&" gauntreclusetutorial:mixin_registration [2026/08/11 13:55] (current) – Clarify the injectors.defaultRequire description gauntrecluse
Line 66: Line 66:
 The other fields' rough function should also be kept in mind to understand when to change them from their defaults, and to understand what happens when another mod you're inspecting changes them: The other fields' rough function should also be kept in mind to understand when to change them from their defaults, and to understand what happens when another mod you're inspecting changes them:
  
-  * The ''required'' field holds a boolean value that corresponds to whether or not Mixin should crash if this config and its Mixins fail to apply or fail to find their targets. Injector Mixins have their own requirement value that precedes this.+  * The ''required'' field holds a boolean value that corresponds to whether or not Mixin should crash if this config or its Mixins raise errors during application.
   * ''minVersion'' defines the minimum Mixin version that must be present and used to apply the config's Mixins.   * ''minVersion'' defines the minimum Mixin version that must be present and used to apply the config's Mixins.
   * ''compatibilityLevel'' defines the minimum compatibility level that the Mixin sub system must be set to in order to apply the config's Mixins. It should generally be set to the Java level used by your MC version unless you specifically have a reason not to (e.g. ''JAVA_17'' for 1.20.1, ''JAVA_21'' for 1.21.x) Mixin will try to set itself to the highest version found in that field across the different configs it interacts with during launch.   * ''compatibilityLevel'' defines the minimum compatibility level that the Mixin sub system must be set to in order to apply the config's Mixins. It should generally be set to the Java level used by your MC version unless you specifically have a reason not to (e.g. ''JAVA_17'' for 1.20.1, ''JAVA_21'' for 1.21.x) Mixin will try to set itself to the highest version found in that field across the different configs it interacts with during launch.
   * ''injectors'' holds a group of fields that define the settings for injector Mixins.    * ''injectors'' holds a group of fields that define the settings for injector Mixins. 
-    * The main one to keep in mind is ''defaultRequire'', which is by default 1. This setting controls the amount of targets injectors must match by default to not crash. By setting this to 0, you effectively make injectors not required by default. Injector annotations such as ''@Inject'' have an optional ''require'' parameter that overrides the config setting. Both the injector-specific setting and the config setting precede the ''required'' field in the config.+    * The main one to keep in mind is ''defaultRequire'', which is typically in templates' configs, but is effectively 0 if unspecified. This setting controls the minimum amount of targets injectors under this config must match by default to raise an error. By setting this to 0, you effectively make injectors fail soft by default. Injector annotations such as ''@Inject'' have an optional ''require'' parameter that overrides the config setting.
   * ''overwrites'' holds a group of fields that define the settings for overwrite Mixins.   * ''overwrites'' holds a group of fields that define the settings for overwrite Mixins.
     * The main one to keep in mind is ''requireAnnotations'' which holds a boolean value that, when set to true, makes Overwrite methods always require a corresponding annotation to overwrite the target class method. There is hardly ever a reason to set it to false.     * The main one to keep in mind is ''requireAnnotations'' which holds a boolean value that, when set to true, makes Overwrite methods always require a corresponding annotation to overwrite the target class method. There is hardly ever a reason to set it to false.
tutorial/mixin_registration.txt · Last modified: 2026/08/11 13:55 by gauntrecluse