<!-- 
RSS generated by JIRA (9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13) at Sun Jan 12 12:03:59 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-4264] EntityLiving setHealth(int i) method throws Illegal Argument Exception </title>
                <link>https://bugs.mojang.com/browse/MC-4264</link>
                <project id="10400" key="MC">Minecraft: Java Edition</project>
                    <description>&lt;p&gt;EntityLiving:630&lt;br/&gt;
public void setHealth(int i) &lt;/p&gt;
{
    this.health = i;
    if (i &amp;gt; getMaxHealth())
      i = getMaxHealth();
  }

&lt;p&gt;Fix:&lt;br/&gt;
public void setHealth(int i) &lt;/p&gt;
{
    if (i &amp;gt; getMaxHealth())
      i = getMaxHealth();
    this.health = i;
  }</description>
                <environment>Microsoft Windows [Version 6.1.7600]&lt;br/&gt;
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.&lt;br/&gt;
&lt;br/&gt;
C:\Users\deathmarine&amp;gt;java -version&lt;br/&gt;
java version &amp;quot;1.7.0_06&amp;quot;&lt;br/&gt;
Java(TM) SE Runtime Environment (build 1.7.0_06-b24)&lt;br/&gt;
Java HotSpot(TM) 64-Bit Server VM (build 23.2-b09, mixed mode)&lt;br/&gt;
&lt;br/&gt;
C:\Users\deathmarine&amp;gt;</environment>
        <key id="16700">MC-4264</key>
            <summary>EntityLiving setHealth(int i) method throws Illegal Argument Exception </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="7">Invalid</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="deathmarine">Josh</reporter>
                        <labels>
                    </labels>
                <created>Sat, 8 Dec 2012 11:05:41 +0100</created>
                <updated>Tue, 5 May 2015 09:08:38 +0200</updated>
                            <resolved>Wed, 19 Jun 2013 23:28:58 +0200</resolved>
                                    <version>Minecraft 1.4.5</version>
                    <version>Minecraft 1.4.7</version>
                    <version>Minecraft 1.5.2</version>
                                                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                            <comments>
                            <comment id="75435" author="grum" created="Wed, 19 Jun 2013 23:28:58 +0200"  >&lt;p&gt;Doesnt exist in 13w25b.&lt;/p&gt;</comment>
                            <comment id="46663" author="bugi74" created="Wed, 20 Feb 2013 00:51:41 +0100"  >&lt;p&gt;1.4.7 Seems to still have the same old code. Would be nice to get instructions on how to reproduce that exception, though. Edit: Not that the wonder of exception matters, the bug is obvious even by reading the code, but just me being curious.&lt;/p&gt;</comment>
                            <comment id="46656" author="bljat" created="Wed, 20 Feb 2013 00:19:17 +0100"  >&lt;p&gt;Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.&lt;/p&gt;</comment>
                            <comment id="27256" author="kumasasa" created="Sat, 8 Dec 2012 21:14:59 +0100"  >&lt;p&gt;Thanks &lt;img class=&quot;emoticon&quot; src=&quot;https://bugs.mojang.com/images/icons/emoticons/thumbs_up.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="27252" author="cubethethird" created="Sat, 8 Dec 2012 21:11:35 +0100"  >&lt;p&gt;Corrected your code &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="27251" author="kumasasa" created="Sat, 8 Dec 2012 21:09:28 +0100"  >&lt;p&gt;Well, if everybody throws in his favourite bit of code:&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;public&lt;/span&gt; void setHealth(&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; i)
{&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;.health = &lt;span class=&quot;code-object&quot;&gt;Math&lt;/span&gt;.min(i,getMaxHealth()} 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="27247" author="cubethethird" created="Sat, 8 Dec 2012 21:05:24 +0100"  >&lt;p&gt;How about:&lt;br/&gt;
public void setHealth(int i)&lt;/p&gt;
{this.health = i &amp;gt; getMaxHealth() ? getMaxHealth() : i; }</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                <customfield id="customfield_10701" key="com.atlassian.jira.plugin.system.customfieldtypes:datetime">
                        <customfieldname>CHK</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Sat, 8 Dec 2012 21:04:00 +0100</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10500" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Confirmation Status</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10300"><![CDATA[Unconfirmed]]></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|i019nr:</customfieldvalue>

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