<!-- 
RSS generated by JIRA (9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13) at Sun Jan 12 12:26:52 UTC 2025

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Mojang Studios Jira</title>
    <link>https://bugs.mojang.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en</language>    <build-info>
        <version>9.12.2</version>
        <build-number>9120002</build-number>
        <build-date>10-01-2024</build-date>
    </build-info>


<item>
            <title>[MC-11199] Eye of Ender does not always lead to the nearest Stronghold</title>
                <link>https://bugs.mojang.com/browse/MC-11199</link>
                <project id="10400" key="MC">Minecraft: Java Edition</project>
                    <description>&lt;p&gt;When throwing an Eye of Ender it does not always lead you to the nearest structure due to a typo in the method for that.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;What I expected to happen:&lt;/b&gt;&lt;br/&gt;
I expected the Eye of Ender to always lead to the nearest stronghold&lt;/p&gt;

&lt;p&gt;&lt;b&gt;What actually happend:&lt;/b&gt;&lt;br/&gt;
It sometimes shows a stronghold farther away&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Steps to reproduce:&lt;/b&gt;&lt;br/&gt;
Easy way:&lt;br/&gt;
1. Create a superflat world with the preset &lt;br/&gt;
   &lt;tt&gt;2;7,2x3,2;1;stronghold(distance=10 count=10 spread=10)&lt;/tt&gt;&lt;br/&gt;
2. Teleport to 0 10 0&lt;br/&gt;
3. Fly close to a Stronghold&lt;br/&gt;
4. Throw Eyes of Ender&lt;br/&gt;
5. From some points they will not lead to the Stronghold you are closest to.&lt;/p&gt;

&lt;p&gt;Harder way to prove it&apos;s not due to the preset or flatworlds:&lt;br/&gt;
1. Create a world with the seed 3351546583236556057 (Creative, so you can teleport and fly)&lt;br/&gt;
2. Teleport to -515 80 601 so it generates the stronghold at that position&lt;br/&gt;
3. Teleport to 693 80 269 and dig down until you find the stronghold (At y=44)&lt;br/&gt;
4. Throw Eyes of Ender&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Why it happens:&lt;/b&gt;&lt;br/&gt;
In the structure class, where it tries to find the nearest instance it calculates the distance as        &lt;br/&gt;
&lt;tt&gt;d2 = i + i * j * j + k * k;&lt;/tt&gt;&lt;br/&gt;
where it should be&lt;br/&gt;
&lt;tt&gt;d2 = i * i + j * j + k * k;&lt;/tt&gt;&lt;br/&gt;
In 1.5 it is in the agm class in lines 145 and 164.&lt;/p&gt;</description>
                <environment></environment>
        <key id="25309">MC-11199</key>
            <summary>Eye of Ender does not always lead to the nearest Stronghold</summary>
                <type id="1" iconUrl="https://bugs.mojang.com/secure/viewavatar?size=xsmall&amp;avatarId=18903&amp;avatarType=issuetype">Bug</type>
                                    <status id="5" iconUrl="https://bugs.mojang.com/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="1">Fixed</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="ferd">Ferd Erik</reporter>
                        <labels>
                            <label>nearest</label>
                            <label>stronghold</label>
                            <label>structure</label>
                            <label>world</label>
                    </labels>
                <created>Thu, 7 Mar 2013 03:53:06 +0100</created>
                <updated>Sun, 3 May 2015 06:17:02 +0200</updated>
                            <resolved>Thu, 13 Jun 2013 18:11:47 +0200</resolved>
                                    <version>Minecraft 1.4.6</version>
                    <version>Minecraft 1.4.7</version>
                    <version>Snapshot 13w10a</version>
                    <version>Snapshot 13w10b</version>
                    <version>Minecraft 1.5</version>
                    <version>Minecraft 1.5.2</version>
                                    <fixVersion>Snapshot 13w24a</fixVersion>
                                                        <votes>10</votes>
                                    <watches>6</watches>
                                                                            <comments>
                            <comment id="73324" author="boxfigs" created="Thu, 13 Jun 2013 20:48:49 +0200"  >&lt;p&gt;(I know this is resolved, but I just want to add this.)&lt;/p&gt;

&lt;p&gt;I noticed this sort of thing on my server when I was finding all the strongholds in Creative mode. The Eyes of Ender pointed to one stronghold when I was closer to the ground, and then they pointed to a different one in about the opposite direction when I gained altitude.&lt;/p&gt;</comment>
                            <comment id="73227" author="ferd" created="Thu, 13 Jun 2013 18:08:12 +0200"  >&lt;p&gt;Fixed in 13w24a!&lt;br/&gt;
Thanks EvilSeph &lt;img class=&quot;emoticon&quot; src=&quot;https://bugs.mojang.com/images/icons/emoticons/wink.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                            <comment id="52258" author="azaragan" created="Wed, 13 Mar 2013 16:16:22 +0100"  >&lt;p&gt;This is actually an old issue that maybe was fixed or supposedly fixed at some intermediate point. In my old SMP world I had stumbled across one stronghold and when I used Eye of Ender to try for another it sent me to another area even if I was standing above the stronghold I had located. To add insult to injury the &quot;stronghold&quot; it was directing me to had been obliterated by other terrain generation. &lt;/p&gt;

&lt;p&gt;Eventually I employed AMIDST to confirm my coordinates and test it against the third stronghold. The Eye of Ender would not find either of the existing, unmolested strongholds even while standing above their end portals. It would only direct me to the location where the missing end portal should have been.&lt;/p&gt;

&lt;p&gt;This was back around 1.3.1 at the latest, though I do not have an accurate lower bound on the version number in which either the testing or terrain generation occurred.&lt;/p&gt;</comment>
                            <comment id="52242" author="ferd" created="Wed, 13 Mar 2013 15:17:09 +0100"  >&lt;p&gt;Okay steps for noticing with a normal world, not a superflat, so no presets and everything all normal.&lt;br/&gt;
&#8226; Create a world with the seed 3351546583236556057 (Creative, so you can teleport and fly)&lt;br/&gt;
&#8226; Teleport to -515 80 601 so it generates the stronghold at that position&lt;br/&gt;
&#8226; Teleport to 693 80 269 and dig down until you find the stronghold (At y=44)&lt;br/&gt;
&#8226; Throw Eyes of Ender&lt;/p&gt;

&lt;p&gt;They will fly toward the first stronghold located at -515 29 601.&lt;br/&gt;
I hope that disarms the doubts...&lt;br/&gt;
(I also added this guide to the description so it&apos;s easier to find.)&lt;/p&gt;</comment>
                            <comment id="52241" author="firehunterx" created="Wed, 13 Mar 2013 15:11:04 +0100"  >&lt;p&gt;Didn&apos;t work for me &lt;b&gt;UNLESS&lt;/b&gt; I generate more than 5 Strongholds in the same world.&lt;/p&gt;</comment>
                            <comment id="52230" author="bugi74" created="Wed, 13 Mar 2013 14:44:14 +0100"  >&lt;p&gt;(Edit: whoopsie, another comment got between, took enough time to test and confirm the exact case below.)&lt;br/&gt;
Except that instructions to reproduce it with just normal number of strongholds were provided, too (although no exact seed + coordinates). And also, the bug was described in the source code. The confusing of the game&apos;s code is not needed when the programmer himself was confused.&lt;/p&gt;

&lt;p&gt;Here&apos;s the instructions: use the seed mentioned above: 6946425067433012199, and the preset mentioned above: 2;7,2x3,2;1;stronghold(distance=10), teleport to 101 10 -209. Notice the stronghold in southeast. Throw ender eyes and watch them fly to west-southwest instead.&lt;/p&gt;</comment>
                            <comment id="52225" author="ferd" created="Wed, 13 Mar 2013 14:31:42 +0100"  >&lt;p&gt;As I just said, go ahead and try it with the preset I posted in my last comment, &lt;br/&gt;
or any other preset where you can easily check which stronghold is closest to you.&lt;br/&gt;
That will generate &lt;b&gt;3&lt;/b&gt; strongholds. It does the same thing. &lt;br/&gt;
The game does not get confused that easily, it just loops through all strongholds, no matter how many there are, and tries to select the one, which is closest to the player, but the calculation of the distance is flawed.&lt;/p&gt;</comment>
                            <comment id="52219" author="firehunterx" created="Wed, 13 Mar 2013 14:24:55 +0100"  >&lt;p&gt;This would seem to be due to the fact that normal generation only includes &lt;b&gt;3&lt;/b&gt; strongholds, not &lt;b&gt;10&lt;/b&gt; . You are confusing the game&apos;s code by having a greater amount of them.&lt;/p&gt;</comment>
                            <comment id="52218" author="ferd" created="Wed, 13 Mar 2013 14:21:39 +0100"  >&lt;p&gt;You can of course try it with another preset, like &lt;tt&gt;2;7,2x3,2;1;stronghold(distance=10)&lt;/tt&gt;, &lt;br/&gt;
that will just make the strongholds appear 10 chunks from &lt;tt&gt;0 0 0&lt;/tt&gt; instead of the normal 32.&lt;br/&gt;
You can do the same thing, fly close to the strongholds, throw the eyes, and it will fail for some coordinates because the calculation of the distance is wrong. &lt;br/&gt;
It&apos;s just a small type, as posted in the description.&lt;/p&gt;</comment>
                            <comment id="52087" author="kumasasa" created="Tue, 12 Mar 2013 19:02:14 +0100"  >&lt;p&gt;Confirmed with the given flatland preset and coordinates, but not sure if the algorithm won&apos;t get confused by the many strongholds.&lt;/p&gt;</comment>
                            <comment id="52077" author="wych" created="Tue, 12 Mar 2013 18:49:47 +0100"  >&lt;p&gt;confirmed: &lt;a href=&quot;http://youtu.be/5e77gaDTqXw&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://youtu.be/5e77gaDTqXw&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="51999" author="ferd" created="Tue, 12 Mar 2013 11:49:16 +0100"  >&lt;p&gt;Okay, I did not phrase that well. What I meant was fly close to a stronghold and throw Eyes of Ender from there. Sometimes they will not fly to the Stronghold closest to you even if you are just some blocks away from it. I will update the description with a better reproduction guide.&lt;br/&gt;
E.g., with the seed &lt;tt&gt;6946425067433012199&lt;/tt&gt; and the preset &lt;br/&gt;
&lt;tt&gt;2;7,2x3,2;1;stronghold(distance=10 count=10 spread=10)&lt;/tt&gt;, &lt;br/&gt;
teleport to 160 36 -250. &lt;br/&gt;
You are standing on a portal room, but the Eyes still lead you to another direction.&lt;br/&gt;
All Eyes always fly in the same direction from one point, it&apos;s just that the calculation of that direction is wrong.&lt;/p&gt;</comment>
                            <comment id="51972" author="wych" created="Tue, 12 Mar 2013 07:23:39 +0100"  >&lt;p&gt;reproduction step 3 is quite vague! after steps 1 and 2, i tossed a hundred ender eyes while standing still, all went the same way. followed the eye direction for a bit, tossing numerous more eyes, everything appears to be functioning normally&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                <customfield id="customfield_10701" key="com.atlassian.jira.plugin.system.customfieldtypes:datetime">
                        <customfieldname>CHK</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 12 Mar 2013 19:00:00 +0100</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10500" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Confirmation Status</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10303"><![CDATA[Confirmed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_11700" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_11600" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i0n08f:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    </customfields>
    </item>
</channel>
</rss>