<!-- 
RSS generated by JIRA (9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13) at Sun Jan 12 12:30:24 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-12278] Comparing names to check that its not a player using a command block and @a or @p returns incorrect results</title>
                <link>https://bugs.mojang.com/browse/MC-12278</link>
                <project id="10400" key="MC">Minecraft: Java Edition</project>
                    <description>&lt;p&gt;I just setup my server using vanilla because I have had endless issues making bukkit work for me. Since the advent of command blocks vanilla has become almost all I need - multiworld/world teleport command. Aside from that I decided to use the scoreboard system to be a almost permissions system with command blocks. I wanted to protect my house with a command block setup where you enter adventure mode. Except that would effect me too and I need to mine for resources. So I decided to make it exempt me. Upon trying to do that though, I ended up with a strange result of my player name (the name that was being filtered) and all the other players - a seemingly random player although it was the same person every time. Such as &quot;myname, player3&quot; without player2. I am positive that I am using the right format as I have tried every single format and multiple commands as well. As an aside, where am I supposed to request a feature (there are too many places where this is an option)?&lt;/p&gt;</description>
                <environment></environment>
        <key id="27108">MC-12278</key>
            <summary>Comparing names to check that its not a player using a command block and @a or @p returns incorrect results</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="3">Duplicate</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="modwizcode">Starbuck Johnson</reporter>
                        <labels>
                            <label>block</label>
                            <label>command</label>
                            <label>command_block</label>
                    </labels>
                <created>Mon, 18 Mar 2013 05:18:27 +0100</created>
                <updated>Fri, 29 Dec 2017 23:13:33 +0100</updated>
                            <resolved>Tue, 4 Jun 2013 21:03:00 +0200</resolved>
                                    <version>Minecraft 1.5</version>
                    <version>Snapshot 13w11a</version>
                    <version>Minecraft 1.5.1</version>
                                                                        <votes>7</votes>
                                    <watches>4</watches>
                                                                            <comments>
                            <comment id="65626" author="modwizcode" created="Thu, 9 May 2013 16:13:28 +0200"  >&lt;p&gt;Is this accepted/confirmed yet?&lt;/p&gt;


&lt;p&gt;On Wed, May 8, 2013 at 5:59 PM, Nathanael Neveux (JIRA) &amp;lt;&lt;/p&gt;
</comment>
                            <comment id="65520" author="freefall722" created="Thu, 9 May 2013 00:57:40 +0200"  >&lt;p&gt;Came looking for this exact issue - hoping it gets fixed. Soon Glad to see it looks like a simple fix - thanks UncleMion.&lt;/p&gt;</comment>
                            <comment id="56802" author="unclemion" created="Sun, 24 Mar 2013 05:29:28 +0100"  >&lt;p&gt;I&apos;ve noticed the problem with the target syntax &lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;@a[name=!&amp;lt;username&amp;gt;]&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; myself. It only occurs when there&apos;s more than 1 person connected to a server, as you noted; it also happens with LAN sessions with additional people connected.&lt;/p&gt;

&lt;p&gt;Checking the source for Minecraft 1.5.1 (decompiled with MCP 7.44),&lt;br/&gt;
the problem is in the method ServerConfigurationManager.findPlayers:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (par9Str != &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
                {
                    var17 = par9Str.startsWith(&lt;span class=&quot;code-quote&quot;&gt;&quot;!&quot;&lt;/span&gt;);

                    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (var17)
                    {
                        par9Str = par9Str.substring(1);
                    }

                    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (var17 == par9Str.equalsIgnoreCase(var16.getEntityName()))
                    {
                        &lt;span class=&quot;code-keyword&quot;&gt;continue&lt;/span&gt;;
                    }
                }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This is in a loop; the first time through it&apos;s okay, but since it removes any leading ! from par9Str, it won&apos;t work any additional times - in fact, for any player after the first one, it will act as though the command target was &lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;@a[name=&amp;lt;username&amp;gt;]&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The solution?  Don&apos;t change par9Str, make a local String variable and change that instead:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (par9Str != &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
                {
                    &lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; tmp = par9Str;
                    var17 = tmp.startsWith(&lt;span class=&quot;code-quote&quot;&gt;&quot;!&quot;&lt;/span&gt;);

                    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (var17)
                    {
                        tmp = tmp.substring(1);
                    }

                    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (var17 == tmp.equalsIgnoreCase(var16.getEntityName()))
                    {
                        &lt;span class=&quot;code-keyword&quot;&gt;continue&lt;/span&gt;;
                    }
                }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The same applies to the team name check on par10Str.&lt;/p&gt;</comment>
                            <comment id="55716" author="modwizcode" created="Wed, 20 Mar 2013 03:49:34 +0100"  >&lt;p&gt;Sorry for the incorrect last post but I did some more testing. the format is @a[name=!&amp;lt;testname&amp;gt;] and it works properly without any other players on the server, but with 2 players it acts like an @a with no name check and with 3 it removes one of the names, but not the one your trying to remove.&lt;/p&gt;</comment>
                            <comment id="55667" author="modwizcode" created="Wed, 20 Mar 2013 01:31:08 +0100"  >&lt;p&gt;Very simple. Make a command block that does any command such as /say or /me or /tp then use an @a&lt;span class=&quot;error&quot;&gt;&amp;#91;!name=&amp;lt;name to test&amp;gt;&amp;#93;&lt;/span&gt; the result will be random, and will include that name if the player is logged on and lose another player from my experience.&lt;/p&gt;</comment>
                            <comment id="55657" author="cubethethird" created="Wed, 20 Mar 2013 01:15:35 +0100"  >&lt;p&gt;Could you provide a step by step list of instructions to demonstrate the issue? eg:&lt;br/&gt;
1. do this..&lt;br/&gt;
2 do that..&lt;br/&gt;
etc..&lt;/p&gt;

&lt;p&gt;This would make the report more clear.&lt;/p&gt;</comment>
                            <comment id="55571" author="modwizcode" created="Tue, 19 Mar 2013 21:31:54 +0100"  >&lt;p&gt;Thanks. So long as this is known to be an issue not a feature request. In addition to information provided, teams work properly in this situation.&lt;/p&gt;</comment>
                            <comment id="55000" author="cubethethird" created="Mon, 18 Mar 2013 12:13:07 +0100"  >&lt;p&gt;Feature requests should be posted on the MC forums &lt;a href=&quot;http://goo.gl/7qGlN&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10102">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="22943">MC-9355</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                <customfield id="customfield_10701" key="com.atlassian.jira.plugin.system.customfieldtypes:datetime">
                        <customfieldname>CHK</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 9 May 2013 00:58:00 +0200</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10500" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Confirmation Status</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10302"><![CDATA[Community Consensus]]></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_11100" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Linked</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_11600" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i0hh9j:</customfieldvalue>

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