<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[I need some help with Mixin]]></title><description><![CDATA[<p dir="auto">As title<br />
i wanna find a way to do it but failed :&lt;<br />
So if some one can give an helping hand for make  boolean flag2 = d0 * d0 + d1 * d1 + d2 * d2 &gt; 9.0E-4D || this.positionUpdateTicks &gt;= 20;<br />
to true<br />
btw. flag2 is in EntityPlayerSP.onUpdateWalkingPlayer() and in EntityPlayerSP's 221<br />
Please added it with valid</p>
]]></description><link>https://forum.liquidbounce.net/topic/3650/i-need-some-help-with-mixin</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Jul 2026 17:06:45 GMT</lastBuildDate><atom:link href="https://forum.liquidbounce.net/topic/3650.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 16 Feb 2022 18:47:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to I need some help with Mixin on Thu, 17 Feb 2022 10:52:16 GMT]]></title><description><![CDATA[<p dir="auto">@mems wow, a very long post with no grammar errors, <img src="https://forum.liquidbounce.net/assets/plugins/nodebb-plugin-emoji/emoji/android/1f633.png?v=866ab33d74c" class="not-responsive emoji emoji-android emoji--flushed" style="height:23px;width:auto;vertical-align:middle" title=":flushed:" alt="😳" /></p>
]]></description><link>https://forum.liquidbounce.net/post/28728</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/28728</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Thu, 17 Feb 2022 10:52:16 GMT</pubDate></item><item><title><![CDATA[Reply to I need some help with Mixin on Thu, 17 Feb 2022 11:00:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vanillamirror" aria-label="Profile: vanillamirror">@<bdi>vanillamirror</bdi></a> said in <a href="/post/28723">I need some help with Mixin</a>:</p>
<blockquote>
<p dir="auto">@mems yes</p>
</blockquote>
<p dir="auto">Alright, this is my method to solve this, even though there are probably a few more:</p>
<p dir="auto">First, you use the <code>ModifyVariable</code> injection, with <code>STORE</code> as the annotation type, then we make use of the <code>name</code> parameter, or whatever it's called. In your case, you are looking to target the  <code>flag2</code> variable's value that exists in the <code>onUpdateWalkingPlayer</code> function.</p>
<p dir="auto">This is how it's done in code:</p>
<pre><code class="language-t">@ModifyVariable(method = "onUpdateWalkingPlayer", at = @At("STORE"), name = "flag2")
</code></pre>
<p dir="auto">Then you add the required function (boolean type as the variable is a boolean type):</p>
<pre><code class="language-t">private boolean nameThatYouWouldLike(boolean value) {

}
</code></pre>
<p dir="auto"><code>boolean value</code> contains the default value result that is from the <code>flag2</code> variable.</p>
<p dir="auto">This: <code>d0 * d0 + d1 * d1 + d2 * d2 &gt; 9.0E-4D || this.positionUpdateTicks &gt;= 20;</code> in case you ask.</p>
<p dir="auto">Replace the <code>nameThatYouWouldLike</code> with whatever you want, or keep it like that, as long as it has a name.</p>
<p dir="auto">Finally, you add your custom code inside and in your case again it's to set the value to true. Remember, you must also use <code>return</code> to the new value you set, whether it's false or true, or something else. An example:</p>
<pre><code class="language-t">    private boolean nameThatYouWouldLike(boolean value) {
        if (LiquidBounce.moduleManager.getModule(XRay.class).getState()) {
            return true;
        }
        
        return value;
    }
</code></pre>
<p dir="auto"><code>return value</code> this will return the value result from the original code, which is this: <code>d0 * d0 + d1 * d1 + d2 * d2 &gt; 9.0E-4D || this.positionUpdateTicks &gt;= 20;</code></p>
<p dir="auto"><code>return true</code> is your modified code. (it just returns true, it won't change, as long as the statement is also true)</p>
<p dir="auto">This is how the full version of the example looks like:</p>
<pre><code class="language-t">    @ModifyVariable(method = "onUpdateWalkingPlayer", at = @At("STORE"), name = "flag2")
    private boolean nameThatYouWouldLike(boolean value) {
        if (LiquidBounce.moduleManager.getModule(XRay.class).getState()) {
            return true;
        }

        return value;
    }
</code></pre>
<p dir="auto">And now, I assume you know how to code, so replace this:</p>
<pre><code class="language-t">        if (LiquidBounce.moduleManager.getModule(XRay.class).getState()) {
            return true;
        }
</code></pre>
<p dir="auto">with something of your own.</p>
<p dir="auto">Long ass post, but I want to make sure you understand. If you have any questions regarding that, don't hesitate to ask.</p>
]]></description><link>https://forum.liquidbounce.net/post/28727</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/28727</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Thu, 17 Feb 2022 11:00:15 GMT</pubDate></item><item><title><![CDATA[Reply to I need some help with Mixin on Thu, 17 Feb 2022 04:31:14 GMT]]></title><description><![CDATA[<p dir="auto">@mems yes</p>
]]></description><link>https://forum.liquidbounce.net/post/28723</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/28723</guid><dc:creator><![CDATA[VanillaMirror]]></dc:creator><pubDate>Thu, 17 Feb 2022 04:31:14 GMT</pubDate></item><item><title><![CDATA[Reply to I need some help with Mixin on Wed, 16 Feb 2022 23:11:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vanillamirror" aria-label="Profile: vanillamirror">@<bdi>vanillamirror</bdi></a> said in <a href="/post/28718">I need some help with Mixin</a>:</p>
<blockquote>
<p dir="auto">So if some one can give an helping hand for make  boolean flag2 = d0 * d0 + d1 * d1 + d2 * d2 &gt; 9.0E-4D || this.positionUpdateTicks &gt;= 20;<br />
to true</p>
</blockquote>
<p dir="auto">ALWAYS set to true though?</p>
]]></description><link>https://forum.liquidbounce.net/post/28722</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/28722</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 16 Feb 2022 23:11:56 GMT</pubDate></item></channel></rss>