<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wildermyth.com/w/index.php?action=history&amp;feed=atom&amp;title=Mods%2FSpongePowered_Mixin%2F%40Inject</id>
	<title>Mods/SpongePowered Mixin/@Inject - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wildermyth.com/w/index.php?action=history&amp;feed=atom&amp;title=Mods%2FSpongePowered_Mixin%2F%40Inject"/>
	<link rel="alternate" type="text/html" href="https://wildermyth.com/w/index.php?title=Mods/SpongePowered_Mixin/@Inject&amp;action=history"/>
	<updated>2026-04-12T19:34:54Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>https://wildermyth.com/w/index.php?title=Mods/SpongePowered_Mixin/@Inject&amp;diff=28280&amp;oldid=prev</id>
		<title>Gamebuster: Created page with &quot;{{Mod|Mixin|Mods/SpongePowered Mixin|coremod=true}}  = Annotation @Mixin = {| class=&quot;wikitable&quot; |- |Fully Qualified Name || &lt;syntaxhighlight lang=&quot;java&quot; inline&gt;org.spongepower...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wildermyth.com/w/index.php?title=Mods/SpongePowered_Mixin/@Inject&amp;diff=28280&amp;oldid=prev"/>
		<updated>2025-10-02T01:43:20Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Mod|Mixin|Mods/SpongePowered Mixin|coremod=true}}  = Annotation @Mixin = {| class=&amp;quot;wikitable&amp;quot; |- |Fully Qualified Name || &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;org.spongepower...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Mod|Mixin|Mods/SpongePowered Mixin|coremod=true}}&lt;br /&gt;
&lt;br /&gt;
= Annotation @Mixin =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|Fully Qualified Name || &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;org.spongepowered.asm.mixin.injection.Inject&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Meta Annotations&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;@Target&amp;lt;/syntaxhighlight&amp;gt; || METHOD&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;@Retention&amp;lt;/syntaxhighlight&amp;gt; || RUNTIME&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;@Inject&amp;lt;/syntaxhighlight&amp;gt; declares that a method is an injection callback method. This means that the code defined in this method should be injected into the some target method. This allows coremods to change the game&amp;#039;s logic without editing the source code directly.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Required Element Summary&lt;br /&gt;
|-&lt;br /&gt;
! Modifier and Type !! Element Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;@At[]&amp;lt;/syntaxhighlight&amp;gt;[https://javadoc.io/doc/net.fabricmc/sponge-mixin/latest/org/spongepowered/asm/mixin/injection/Inject.html] || at || Array of &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;@At&amp;lt;/syntaxhighlight&amp;gt; annotations which describe the [[InjectionPoint|Injection Points]] in the target method.&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Optional Element Summary&lt;br /&gt;
|-&lt;br /&gt;
! Modifier and Type !! Element Name !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;int&amp;lt;/syntaxhighlight&amp;gt; || allow || &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;-1&amp;lt;/syntaxhighlight&amp;gt; || Injection points by default are expected to match every candidate instruction in the target method or slice, except in cases where such options such as &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;@At.ordinal()&amp;lt;/syntaxhighlight&amp;gt; are specified which by definition limit the number of results. This option limits the maximum number of matches for this injector. Setting any value 1 or greater is allowed. Values less than 1 or less than &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;require()&amp;lt;/syntaxhighlight&amp;gt; are ignored.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;boolean&amp;lt;/syntaxhighlight&amp;gt; || cancellable || &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;false&amp;lt;/syntaxhighlight&amp;gt; || Allows this injection callback to be cancellable, meaning it can inject RETURN opcodes into the target method. Return behavior can then be controlled from within the callback by interacting with the [[CallbackInfo]] object.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;String&amp;lt;/syntaxhighlight&amp;gt;[https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html] || constraints || &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;&amp;quot;&amp;quot;&amp;lt;/syntaxhighlight&amp;gt; || The constraints[https://javadoc.io/static/net.fabricmc/sponge-mixin/0.16.4+mixin.0.8.7/org/spongepowered/asm/util/ConstraintParser.Constraint.html] which must be validated for this injector to succeed.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;int&amp;lt;/syntaxhighlight&amp;gt;|| expect || &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;1&amp;lt;/syntaxhighlight&amp;gt; || Like &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;require&amp;lt;/syntaxhighlight&amp;gt;, but only enabled if &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;mixin.debug.countInjections&amp;lt;/syntaxhighlight&amp;gt; is set to &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;true&amp;lt;/syntaxhighlight&amp;gt;. Unlike &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;require()&amp;lt;/syntaxhighlight&amp;gt;, defaults to &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;1&amp;lt;/syntaxhighlight&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;String&amp;lt;/syntaxhighlight&amp;gt;[https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html] || id || &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;&amp;quot;&amp;quot;&amp;lt;/syntaxhighlight&amp;gt; || The identifier for this injector. Can be retrieved by calling &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;CallbackInfo.getId()&amp;lt;/syntaxhighlight&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;LocalCapture&amp;lt;/syntaxhighlight&amp;gt;[https://javadoc.io/static/net.fabricmc/sponge-mixin/0.16.4+mixin.0.8.7/org/spongepowered/asm/mixin/injection/callback/LocalCapture.html] || locals || &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;{}&amp;lt;/syntaxhighlight&amp;gt; || Deprecated. Specifies the local variable capture variable behavior for this injector. Use [[@Local]] instead.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;String[]&amp;lt;/syntaxhighlight&amp;gt;[https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html] || method || &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;{}&amp;lt;/syntaxhighlight&amp;gt; || String representation of one or more [[Target Selectors]] which identify the target methods.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;int&amp;lt;/syntaxhighlight&amp;gt; || order || &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;1000&amp;lt;/syntaxhighlight&amp;gt; || By default almost all injectors for a target class apply their injections at the same time. If multiple mixins target the same class, then the injectors are applied in priority order. The default order for injectors is &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;1000&amp;lt;/syntaxhighlight&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Specifying a value for &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;order&amp;lt;/syntaxhighlight&amp;gt; causes the injector to inject earlier or later than it normally would. Specifying a lower number will cause the injector to apply earlier, and a higher number will cause it to apply later. Injectors with the same order will still apply in the order of their mixin&amp;#039;s priority.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;boolean&amp;lt;/syntaxhighlight&amp;gt; || remap || &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;true&amp;lt;/syntaxhighlight&amp;gt; || Used for obfuscation. Since Wildermyth is not obfuscated, you never need to worry about this.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;int&amp;lt;/syntaxhighlight&amp;gt;|| require || &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;-1&amp;lt;/syntaxhighlight&amp;gt; || Generally, injectors are intended to fail softly. However this is not always desirable. This parameter allows you to stipulate a &amp;#039;&amp;#039;&amp;#039;minimum&amp;#039;&amp;#039;&amp;#039; amount of successful injections for this callback handler. If the number of injections specified is not achieved, then an &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;InjectionError&amp;lt;/syntaxhighlight&amp;gt; is thrown at classload time.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;Slice[]&amp;lt;/syntaxhighlight&amp;gt; [https://javadoc.io/static/net.fabricmc/sponge-mixin/0.16.4+mixin.0.8.7/org/spongepowered/asm/mixin/injection/Slice.html] || slice || &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;{}&amp;lt;/syntaxhighlight&amp;gt; || Array of [[@Slice]] annotations which describe the method bisections used in the &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;at()&amp;lt;/syntaxhighlight&amp;gt; queries for this injector.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;Desc[]&amp;lt;/syntaxhighlight&amp;gt; [https://javadoc.io/static/net.fabricmc/sponge-mixin/0.16.4+mixin.0.8.7/org/spongepowered/asm/mixin/injection/Desc.html] || target || &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; inline&amp;gt;{}&amp;lt;/syntaxhighlight&amp;gt; || Literal representation of one or more [[@Desc]] annotations which identify the target methods&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Gamebuster</name></author>
	</entry>
</feed>