<!-- 
RSS generated by JIRA (9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13) at Sun Jan 12 11:58:20 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-2573] Potions and Food are consumed on death</title>
                <link>https://bugs.mojang.com/browse/MC-2573</link>
                <project id="10400" key="MC">Minecraft: Java Edition</project>
                    <description>&lt;p&gt;When using keepinventory = &lt;b&gt;true&lt;/b&gt;. If the player is killed in the process of drinking a potion or eating food then the potion or food item will be consumed while on the death screen. This allows potions and food to be wasted when trying to keep from dying in combat.&lt;/p&gt;

&lt;p&gt;The drinking process should stop on death and the potion or food should not be consumed until the end of the drinking animation.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;The following is based on a decompiled version of Minecraft 1.10 using MCP 9.30.&lt;/p&gt;

&lt;p&gt;To fix this, add an if statement to check if the player is alive in &lt;tt&gt;onItemUseFinish&lt;/tt&gt; before depleting the item.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;ItemFood.java&lt;/b&gt;&lt;/div&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; ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityLivingBase entityLiving) 
	{
		&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (entityLiving.isEntityAlive()) 
		{

		}
		
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; stack;
		
	}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;ItemPotion.java&lt;/b&gt;&lt;/div&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; ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityLivingBase entityLiving) 
	{
		EntityPlayer entityplayer = entityLiving &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; EntityPlayer ? (EntityPlayer) entityLiving : &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

		&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (entityplayer.isEntityAlive()) 
		{

		}
		
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; stack;
		
	}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="14334">MC-2573</key>
            <summary>Potions and Food are consumed on death</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="harrypotter1a2b">reuben searson</reporter>
                        <labels>
                            <label>food</label>
                            <label>keepinventory</label>
                            <label>potion</label>
                    </labels>
                <created>Fri, 9 Nov 2012 02:53:31 +0100</created>
                <updated>Wed, 11 Jul 2018 05:01:49 +0200</updated>
                            <resolved>Mon, 14 Nov 2016 22:03:24 +0100</resolved>
                                    <version>Minecraft 1.4.4</version>
                    <version>Minecraft 1.4.6</version>
                    <version>Minecraft 1.4.7</version>
                    <version>Minecraft 1.5</version>
                    <version>Minecraft 1.6.4</version>
                    <version>Minecraft 13w39b</version>
                    <version>Minecraft 14w30c</version>
                    <version>Minecraft 1.8.1-pre3</version>
                    <version>Minecraft 15w43b</version>
                    <version>Minecraft 1.9</version>
                    <version>Minecraft 1.10.2</version>
                    <version>Minecraft 16w32a</version>
                    <version>Minecraft 16w32b</version>
                    <version>Minecraft 16w33a</version>
                    <version>Minecraft 16w39c</version>
                                    <fixVersion>Minecraft 16w33a</fixVersion>
                    <fixVersion>Minecraft 1.11</fixVersion>
                                                        <votes>6</votes>
                                    <watches>8</watches>
                                                                            <comments>
                            <comment id="328091" author="farogaming" created="Thu, 1 Sep 2016 19:40:17 +0200"  >&lt;p&gt;This is fixed in 16w35a and I&apos;m pretty sure it also was in the previous version. I think it was also on mojang.com.&lt;/p&gt;</comment>
                            <comment id="318192" author="farogaming" created="Wed, 29 Jun 2016 03:34:10 +0200"  >&lt;p&gt;This also happens with food.&lt;/p&gt;</comment>
                            <comment id="316882" author="__null" created="Thu, 23 Jun 2016 18:38:11 +0200"  >&lt;p&gt;Confirmed for &lt;font color=&quot;#060&quot;&gt;&lt;b&gt;1.10.2&lt;/b&gt;&lt;/font&gt;.&lt;/p&gt;</comment>
                            <comment id="295449" author="JIRAUSER71590" created="Fri, 18 Mar 2016 17:56:28 +0100"  >&lt;p&gt;Reopened and changed reporter to &lt;a href=&quot;https://bugs.mojang.com/secure/ViewProfile.jspa?name=harrypotter1a2b&quot; class=&quot;user-hover&quot; rel=&quot;harrypotter1a2b&quot;&gt;harrypotter1a2b&lt;/a&gt; as &lt;a href=&quot;https://bugs.mojang.com/secure/ViewProfile.jspa?name=spyman510&quot; class=&quot;user-hover&quot; rel=&quot;spyman510&quot;&gt;spyman510&lt;/a&gt; is no longer active.&lt;/p&gt;</comment>
                            <comment id="295448" author="harrypotter1a2b" created="Fri, 18 Mar 2016 17:54:45 +0100"  >&lt;p&gt;Still occurs in 1.9. &lt;/p&gt;</comment>
                            <comment id="295155" author="JIRAUSER71590" created="Thu, 17 Mar 2016 16:18:40 +0100"  >&lt;p&gt;Is this still an issue in 1.9 or 1.9.1-pre3?&lt;/p&gt;</comment>
                            <comment id="257508" author="wessh" created="Thu, 22 Oct 2015 20:32:19 +0200"  >&lt;p&gt;Still in 15w43b&lt;/p&gt;</comment>
                            <comment id="180402" author="spyman510" created="Sat, 26 Jul 2014 22:43:04 +0200"  >&lt;p&gt;I tested on version 14w30c and the problem has not changed.&lt;/p&gt;</comment>
                            <comment id="107386" author="spyman510" created="Sun, 29 Sep 2013 00:40:16 +0200"  >&lt;p&gt;It is still a problem in 1.6.4 and 13w39b. I tested it by hugging a creeper and drinking an instant health potion.&lt;/p&gt;</comment>
                            <comment id="106414" author="cubethethird" created="Thu, 26 Sep 2013 05:05:24 +0200"  >&lt;p&gt;Is this still a concern in the &lt;em&gt;current Minecraft version&lt;/em&gt; &lt;b&gt;1.6.4&lt;/b&gt; / Launcher version &lt;b&gt;1.2.5&lt;/b&gt; ? If so, please &lt;em&gt;update the affected versions&lt;/em&gt; in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.&lt;/p&gt;</comment>
                            <comment id="30815" author="bljat" created="Wed, 26 Dec 2012 03:14:33 +0100"  >&lt;p&gt;Confirmed in 1.4.6.&lt;/p&gt;</comment>
                            <comment id="30458" author="theminexd" created="Mon, 24 Dec 2012 10:56:43 +0100"  >&lt;p&gt;Confirmed in both gamemodes.&lt;/p&gt;</comment>
                            <comment id="27785" author="spyman510" created="Tue, 11 Dec 2012 15:38:12 +0100"  >&lt;p&gt;It was SSP.&lt;/p&gt;</comment>
                            <comment id="27747" author="the end" created="Tue, 11 Dec 2012 10:59:57 +0100"  >&lt;p&gt;Is this in SMP or SSP?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10101">
                    <name>Cloners</name>
                                                                <inwardlinks description="is cloned by">
                                        <issuelink>
            <issuekey id="206957">MC-133218</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10102">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="134546">MC-97230</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                <customfield id="customfield_10701" key="com.atlassian.jira.plugin.system.customfieldtypes:datetime">
                        <customfieldname>CHK</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 26 Dec 2012 02:53: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_10501" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Game Mode</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10304"><![CDATA[Survival]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_11600" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i0naaf:</customfieldvalue>

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