<!-- 
RSS generated by JIRA (9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13) at Sun Jan 12 11:59:37 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-2958] Custom mobs and normal Vexes drop equipped items with looting despite DropChances set to 0</title>
                <link>https://bugs.mojang.com/browse/MC-2958</link>
                <project id="10400" key="MC">Minecraft: Java Edition</project>
                    <description>&lt;p&gt;I&apos;m playing around with custom spawners for a combat arena in an adventure map. I noticed that my mobs drop items they have equipped, even if their respective drop chance is set to 0.&lt;/p&gt;

&lt;p&gt;I&apos;ve added the schematics file for a mob spawner, of which the mobs are affected by this issue.&lt;br/&gt;
The mob spawned is a PigZombie wearing a pumpkin on its head and a torch with fire aspect 2 in its hand. &lt;br/&gt;
They also have a healing potion in their chest slot with dropchance 0.6, which can&apos;t be seen. All the other dropchances are 0.&lt;br/&gt;
Two potion effects have been applied: weakness and invisibility.&lt;br/&gt;
I&apos;ve seen them drop the healing potions, as intended, but the enchanted torch as well. &lt;br/&gt;
I&apos;ve seen them drop their pumpkin when I started messing around with the spawner, but not (yet?) in the version I&apos;ve attached.&lt;/p&gt;

&lt;p&gt;Other info:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;I did not notice this in the 1.4.3 PRE.&lt;/li&gt;
&lt;/ul&gt;


&lt;hr /&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Mob command&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/summon bat ~ ~1 ~ {NoAI:1b,ArmorItems:[{id:&lt;span class=&quot;code-quote&quot;&gt;&quot;stone&quot;&lt;/span&gt;,Count:1b},{id:&lt;span class=&quot;code-quote&quot;&gt;&quot;dirt&quot;&lt;/span&gt;,Count:1b},{id:&lt;span class=&quot;code-quote&quot;&gt;&quot;grass_block&quot;&lt;/span&gt;,Count:1b},{id:&lt;span class=&quot;code-quote&quot;&gt;&quot;glass&quot;&lt;/span&gt;,Count:1b}],HandItems:[{id:&lt;span class=&quot;code-quote&quot;&gt;&quot;white_wool&quot;&lt;/span&gt;,Count:1b},{}],ArmorDropChances:[0f,0f,0f,0f],HandDropChances:[0f,0f]}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Looting command&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/give @p minecraft:stick{Enchantments:[{id:sharpness,lvl:32767},{id:looting,lvl:32767}]}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;p&gt;Code analysis by &lt;a href=&quot;https://bugs.mojang.com/secure/ViewProfile.jspa?name=marcono1234&quot; class=&quot;user-hover&quot; rel=&quot;marcono1234&quot;&gt;marcono1234&lt;/a&gt; can be found in &lt;a href=&quot;https://bugs.mojang.com/browse/MC-2958?focusedCommentId=294797&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-294797&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;this comment&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;As of 1.11, this affects Vex swords, since they have a HandDropChance of 0 on the mainhand.&lt;/p&gt;</description>
                <environment></environment>
        <key id="14836">MC-2958</key>
            <summary>Custom mobs and normal Vexes drop equipped items with looting despite DropChances set to 0</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="boq">[Mojang] Bartosz Bok</assignee>
                                    <reporter username="marcono1234">Marcono1234</reporter>
                        <labels>
                            <label>DropChances</label>
                            <label>equipment</label>
                            <label>mob</label>
                    </labels>
                <created>Wed, 14 Nov 2012 15:01:41 +0100</created>
                <updated>Fri, 6 Sep 2019 14:24:39 +0200</updated>
                            <resolved>Fri, 6 Sep 2019 14:24:39 +0200</resolved>
                                    <version>Minecraft 1.4.4</version>
                    <version>Minecraft 1.8.4</version>
                    <version>Minecraft 1.8.7</version>
                    <version>Minecraft 1.8.9</version>
                    <version>Minecraft 16w05b</version>
                    <version>Minecraft 1.9</version>
                    <version>Minecraft 1.9.1 Pre-Release 1</version>
                    <version>Minecraft 1.9.1 Pre-Release 3</version>
                    <version>Minecraft 1.9.1</version>
                    <version>Minecraft 1.9.2</version>
                    <version>Minecraft 1.10</version>
                    <version>Minecraft 1.10.2</version>
                    <version>Minecraft 16w32a</version>
                    <version>Minecraft 16w32b</version>
                    <version>Minecraft 16w33a</version>
                    <version>Minecraft 16w35a</version>
                    <version>Minecraft 1.11</version>
                    <version>Minecraft 1.12.2</version>
                    <version>Minecraft 17w45b</version>
                    <version>Minecraft 18w03b</version>
                    <version>Minecraft 1.13-pre1</version>
                    <version>Minecraft 1.13.1</version>
                    <version>1.14.4</version>
                                    <fixVersion>19w37a</fixVersion>
                                                        <votes>13</votes>
                                    <watches>12</watches>
                                                                            <comments>
                            <comment id="571756" author="jeuvke" created="Fri, 2 Aug 2019 19:23:46 +0200"  >&lt;p&gt;Still in 1.14.4, just had 2 swords drop from vexes.&lt;/p&gt;</comment>
                            <comment id="311641" author="suncat" created="Wed, 8 Jun 2016 17:49:46 +0200"  >&lt;p&gt;Still in 1.10&lt;/p&gt;</comment>
                            <comment id="298335" author="JIRAUSER71590" created="Sun, 3 Apr 2016 14:34:38 +0200"  >&lt;p&gt;changed reported to &lt;a href=&quot;https://bugs.mojang.com/secure/ViewProfile.jspa?name=marcono1234&quot; class=&quot;user-hover&quot; rel=&quot;marcono1234&quot;&gt;marcono1234&lt;/a&gt; since the original reporter, &lt;a href=&quot;https://bugs.mojang.com/secure/ViewProfile.jspa?name=thoronwen&quot; class=&quot;user-hover&quot; rel=&quot;thoronwen&quot;&gt;thoronwen&lt;/a&gt; was no longer active&lt;/p&gt;</comment>
                            <comment id="294797" author="marcono1234" created="Sun, 13 Mar 2016 21:57:09 +0100"  >&lt;p&gt;Please link to this comment in the description&lt;/p&gt;

&lt;p&gt;The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.&lt;/p&gt;

&lt;p&gt;The reason why this happens is because the method &lt;tt&gt;net.minecraft.entity.EntityLiving.dropEquipment(boolean, int)&lt;/tt&gt; is only testing if &lt;tt&gt;this.rand.nextFloat() - (float)lootingModifier * 0.01F) &amp;lt; d0&lt;/tt&gt; (&lt;tt&gt;d0&lt;/tt&gt; being the drop chance). This means if the looting enchantment is 100 or higher, items will be dropped.&lt;/p&gt;

&lt;p&gt;Edit: As said in &lt;a href=&quot;https://bugs.mojang.com/browse/MC-114715&quot; title=&quot;Mobs picking up items can drop their current item even with drop chance of 0&quot; class=&quot;issue-link&quot; data-issue-key=&quot;MC-114715&quot;&gt;&lt;del&gt;MC-114715&lt;/del&gt;&lt;/a&gt; this calculation defeats the purpose of really rare drops, for example 0.000001% suddenly becomes 1.000001%. It might be better to solve this by multiplying the randomly generated value.&lt;/p&gt;</comment>
                            <comment id="294480" author="suncat" created="Sat, 12 Mar 2016 18:23:04 +0100"  >&lt;p&gt;Still in 1.9.1-pre3&lt;/p&gt;</comment>
                            <comment id="293818" author="suncat" created="Wed, 9 Mar 2016 21:22:27 +0100"  >&lt;p&gt;Still in 1.9.1-pre1&lt;/p&gt;</comment>
                            <comment id="292795" author="suncat" created="Sat, 5 Mar 2016 22:17:57 +0100"  >&lt;p&gt;Confirmed for 1.9&lt;/p&gt;</comment>
                            <comment id="283193" author="marcono1234" created="Fri, 5 Feb 2016 14:37:35 +0100"  >&lt;p&gt;Confirmed for&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&lt;b&gt;16w05b&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Please add these commands&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Mob command&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/summon Bat ~ ~1 ~ {NoAI:1b,ArmorItems:[{id:&lt;span class=&quot;code-quote&quot;&gt;&quot;stone&quot;&lt;/span&gt;,Count:1b},{id:&lt;span class=&quot;code-quote&quot;&gt;&quot;dirt&quot;&lt;/span&gt;,Count:1b},{id:&lt;span class=&quot;code-quote&quot;&gt;&quot;grass&quot;&lt;/span&gt;,Count:1b},{id:&lt;span class=&quot;code-quote&quot;&gt;&quot;glass&quot;&lt;/span&gt;,Count:1b}],HandItems:[{id:&lt;span class=&quot;code-quote&quot;&gt;&quot;wool&quot;&lt;/span&gt;,Count:1b},{}],ArmorDropChances:[0f,0f,0f,0f],HandDropChances:[0f,0f]}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Looting command&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/give @p stick 1 0 {ench:[{id:16,lvl:32767},{id:21,lvl:32767}]}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="226704" author="marcono1234" created="Thu, 7 May 2015 16:55:32 +0200"  >&lt;p&gt;Confirmed for&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&lt;b&gt;1.8.4&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Used commands&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/summon Bat ~ ~1 ~ {NoAI:1,Equipment:[{id:stone,Count:1},{id:dirt,Count:1},{id:grass,Count:1},{id:glass,Count:1},{id:wool,Count:1}],DropChances:[0f,0f,0f,0f,0f]}
/give @p stick 1 0 {ench:[{id:16,lvl:32767},{id:21,lvl:32767}]}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="90863" author="kumasasa" created="Sun, 14 Jul 2013 15:50:59 +0200"  >&lt;p&gt;No answer, assuming no longer an issue.&lt;/p&gt;</comment>
                            <comment id="46643" author="bljat" created="Tue, 19 Feb 2013 23:35:20 +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="29181" author="mrpingouin1" created="Mon, 17 Dec 2012 23:52:30 +0100"  >&lt;p&gt;It may happen with a looting enchantment :&lt;br/&gt;
this.rand.nextFloat() - (float)par2 * 0.01F &amp;lt; this.equipmentDropChances&lt;span class=&quot;error&quot;&gt;&amp;#91;var3&amp;#93;&lt;/span&gt;&lt;br/&gt;
par2 is the looting bonus coefficient, so the item can be drop.&lt;br/&gt;
If you want to be sure that the item wont spawn : set the drop chance to -2.&lt;br/&gt;
(The issue work as intended)&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10102">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="20337">MC-7539</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10103">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="165750">MC-114715</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="13121" name="pigmen.schematic" size="783" author="thoronwen" created="Wed, 14 Nov 2012 15:01:41 +0100"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                <customfield id="customfield_10701" key="com.atlassian.jira.plugin.system.customfieldtypes:datetime">
                        <customfieldname>CHK</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Sat, 25 Jul 2015 10:12:00 +0200</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11901" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Category</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="11624"><![CDATA[Entities]]></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_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|i0na9j:</customfieldvalue>

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