[MC-3304] Enchantments from items held in the main hand are applied to other items when entities are killed Created: 17/Nov/12  Updated: 07/Dec/24

Status: Reopened
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.4.4, Minecraft 1.4.7, Minecraft 1.5, Minecraft 1.6.1, Minecraft 1.6.2, Minecraft 1.7.4, Minecraft 14w02c, Minecraft 14w03b, Minecraft 14w04a, Minecraft 14w04b, Minecraft 14w05a, Minecraft 14w05b, Minecraft 1.7.5, Minecraft 14w11b, Minecraft 1.7.10, Minecraft 14w32a, Minecraft 14w32b, Minecraft 14w32c, Minecraft 14w32d, Minecraft 14w33a, Minecraft 1.8, Minecraft 1.8.1-pre3, Minecraft 16w03a, Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w32b, Minecraft 16w33a, Minecraft 16w35a, Minecraft 17w06a, Minecraft 17w17b, Minecraft 1.12.2, Minecraft 1.13-pre1, Minecraft 1.14.4 Pre-Release 5, 1.14.4, 1.15.2, 20w16a, 20w21a, 1.16, 1.16.2, 1.16.3, 1.16.4, 20w51a, 21w03a, 1.16.5, 21w05b, 21w06a, 21w07a, 21w11a, 21w15a, 21w17a, 1.17, 1.17.1 Pre-release 1, 1.17.1 Pre-release 2, 1.17.1 Pre-release 3, 1.17.1 Release Candidate 1, 1.17.1, 21w37a, 21w38a, 21w39a, 21w40a, 21w42a, 21w43a, 1.18 Release Candidate 3, 1.18, 1.18.1, 22w05a, 22w06a, 1.18.2 Release Candidate 1, 1.18.2, 22w14a, 1.19, 1.19.1 Pre-release 4, 1.19.1, 1.19.2, 22w43a, 1.19.3, 1.19.4, 1.20, 1.20.1, 23w33a, 1.20.4, 24w10a, 24w18a, 24w20a, 1.21, 1.21.1, 1.21.2 Pre-Release 3, 1.21.3, 1.21.4
Fix Version/s: Snapshot 13w26a

Type: Bug
Reporter: [Mod] Avoma Assignee: Unassigned
Resolution: Unresolved Votes: 54
Labels: None

Attachments: File MC-3304.mp4     PNG File MC-3304.png    
Issue Links:
Duplicate
is duplicated by MC-67473 Thorns and looting Resolved
is duplicated by MC-96143 Bows can have Looting effect Resolved
is duplicated by MC-133153 High looting values apply even if the... Resolved
is duplicated by MC-200572 Looting increases loot even when not ... Resolved
is duplicated by MC-206659 Swapping from an Unenchanted Item to ... Resolved
is duplicated by MC-211590 how to make your sword durability no ... Resolved
is duplicated by MC-245444 Looting on bow Resolved
is duplicated by MC-252127 Looting still works even if you doesn... Resolved
is duplicated by MC-254120 Shooting a mob with a persistent proj... Resolved
Relates
relates to MC-187015 Using an item and quickly switching h... Open
relates to MC-13518 You can switch fishing rods while the... Reopened
relates to MC-28289 Switching items at the same time as a... Reopened
relates to MC-73032 When killing a player and quickly swi... Resolved
relates to MC-73710 Holding items enchanted with thorns i... Resolved
relates to MC-131637 The slowness effect is applied to ent... Resolved
relates to MC-136147 Riptide tridents use mainhand item to... Resolved
relates to MCPE-141935 Looting is not applied when a mob is ... Resolved
CHK:
Confirmation Status: Confirmed
Category:
Combat, Enchantments, Loot tables
Mojang Priority: Low
Area: Platform

 Description   

The Bug:

Enchantments from items held in the main hand are applied to other items when entities are killed.

Steps to Reproduce:

  1. Summon a husk, hold a bow in your offhand, and a sword enchanted with a high level of looting in your main hand, by using the commands provided below.
    /summon minecraft:husk ~ ~ ~ {NoAI:1b}
    /item replace entity @s weapon.offhand with minecraft:bow
    /item replace entity @s weapon.mainhand with minecraft:diamond_sword[enchantments={levels:{"minecraft:looting":100}}]
  2. Shoot and kill the husk using the bow.
  3. Look if the looting enchantment on the sword affected the number of items that the husk dropped.
  4. Take note as to whether or not enchantments from items held in the main hand are applied to other items when entities are killed.

Observed Behavior:

Enchantments are applied to other items when entities are killed.

Expected Behavior:

Enchantments would not be applied to other items when entities are killed.

Potential Fix:

A potential fix by Chumbanotz can be found in this comment.



 Comments   
Comment by Jon1337 [ 19/Aug/23 ]

In 23w33a

Comment by user-f2760 (Inactive) [ 24/Jun/22 ]

It's only a feature when Mojang says it's a feature, and that it has beentriaged actually speaks against that.
Old issue != by design.

Comment by Chris [ 24/Jun/22 ]

Is there an actual reason to fix this? After this many years, it's a feature just like quasi connectivity is with redstone.

Comment by Chumbanotz [ 31/May/22 ]

 A possible solution is to cache the ItemStack that causes the action in the DamageSource instance that will be used to cause the damage and check for enchantments against this item instead of the player's currently held item. The DamageSource will also need to be cached for projectiles and written to NBT in case the world is closed before the damage is applied.

On second thought, the DamageSource likely doesn't need to be written to NBT for projectiles, saving the ItemStack to the projectile should suffice. The ItemStack can be passed to the DamageSource when needed.

Comment by user-f2760 (Inactive) [ 25/May/22 ]

Mojang has never stated this is intended, and a priority has been assigned. The only reason the bedrock issue got fixed was because it was an unintentional change that broke parity, thus the change was reverted until they decide whether to actually INTENTIONALLY fix this, or keep this.
Just because people abuse a bug does not make it a feature.

Comment by 冯锦元 [ 18/Dec/21 ]

Age and other editions don't count towards whether a bug report is valid.

Comment by Mr. K [ 28/Oct/21 ]

This "bug" was reported 9 years ago! The supposed bug was made part of Bedrock edition when it first came out, and recently this behavior was broken in an update and then immediately restored in a hot fix (see MCPE-141935). 

Surely by now we can all agree that this report should be closed as "works as intended". 

Comment by windwend [ 17/Aug/21 ]

I actually hope this gets marked as WAI, since it is quite a smart mechanic to allow looting to work on equipments other than the looting sword - players can get more drops if they use their weapons smart enough.

Comment by [Mod] Avoma [ 23/May/21 ]

I'd like to request ownership of this ticket since the current reporter has been inactive since October 2019. I'm willing to provide all of the necessary information and will keep this report updated.

Comment by [Mod] Avoma [ 30/Apr/21 ]

Can confirm in 21w17a.

Comment by [Mod] Avoma [ 19/Apr/21 ]

Can confirm in 21w15a.

Comment by [Mod] Avoma [ 27/Mar/21 ]

Can confirm in 21w11a.

Comment by [Mod] Avoma [ 18/Feb/21 ]

Can confirm in 21w07a. Video attached.

Comment by [Mod] Avoma [ 12/Feb/21 ]

Can confirm in 21w06a.

Comment by [Mod] Avoma [ 04/Feb/21 ]

Can confirm in 21w05b.

Comment by [Mod] Avoma [ 22/Jan/21 ]

Can confirm in 21w03a.

Comment by [Mod] Avoma [ 21/Dec/20 ]

Can confirm in 20w51a.

Comment by GamerZone [ 03/Sep/20 ]

this is a useful bug in survival, I think they should keep it or add looting to bows

Comment by Fahlur [ 30/Aug/20 ]

wasnt the old bug where the looting sword was in the offhand? now it works in reverse in 1.16.2 (confirmed in 1.16.2 btw)..

I almost want to say mojang fix this bug, but add something like looting for bows.

Comment by Iosiv Visokogorskiy [ 23/Jun/20 ]

Confirmed for 1.16

Comment by Loek van Vucht [ 21/May/20 ]

Confirmed for 20w21a

Comment by Alugia [ 16/Apr/20 ]

Confirmed in 20w16a

Comment by Krev [ 13/Nov/19 ]

The description and summary should probably be updated to something like "Looting gets applied to other weapons on kill". Infinite looting isn't really the problem now that mending exists, it's more so that it can be applied to any player kill method so long as a looting sword is in their main hand on kill (so that includes bows, etc. in a player's off hand).

Comment by Xristos Mpesiris [ 13/Oct/19 ]

It has been nearly 7 years since I made this bug report, how is this still around?? I guess it's because it's not that important....which is kinda true. At this point, you can just call it a feature.

Comment by overcooked [ 13/Oct/19 ]

@RedCMD

My bow does not have looting.  I didn't hit the ghast with my sword, I just fired my bow and switched to my sword while the arrow was in flight, and the looting effect was applied.  

Comment by RedCMD [ 13/Oct/19 ]

Looting is based on if its a Player Kill
and killing it with a sword, bow, splash potion etc. Is a Player Kill

Comment by overcooked [ 12/Oct/19 ]

also present in 1.14.4 (fired an arrow at a ghast, then switched to looting 3 sword, 3 ghast tears dropped)

Comment by user33 [ 30/Apr/17 ]

Confirmed for 17w17b

Comment by BoxFigs [ 15/Oct/14 ]

I think this is because splash potion of harming/healing damage counts as melee damage.

When a mob is damaged or killed by a player, the code probably checks what kind of damage it is (melee or ranged). If it's melee damage, then it applies the enchantment effects of the item the player is holding. (This is just an assumption.)

If that is the case, then this would be fixed by making splash potion attacks count as ranged damage (and a check to see if the projectile is an arrow or a splash potion).

Comment by Afzal Rahman [ 18/Mar/14 ]

@Anon: I don't know if it's intended or not, but that's what you get when it's designed so that the Looting Effect comes from you holding the looting sword when the mob dies.

Comment by Miroslav Popovic [ 18/Mar/14 ]

Does it means when you fire TNT and take looting sword in your hand you will get extra loot without losing durability?

Comment by Anon Ymus [ 05/Sep/13 ]

I think it's definitely not intended to get looting when you aren't even using a looting item to get it.

Comment by karstvgl [ 05/Sep/13 ]

I think: "Works As Intended"

Comment by Anon Ymus [ 13/Aug/13 ]

I can still reproduce in 1.6.2.

Comment by GrygrFlzr [ 25/Jun/13 ]

Cannot replicate in latest snapshot, marking as Fixed. If you are able to replicate it please tell us.

Comment by user-9dcfe (Inactive) [ 01/May/13 ]

More info: http://www.youtube.com/watch?v=K6Bg2sy3s8Y

Comment by Nathan2055 [ 17/Jan/13 ]

Tested it today as I was going through my upvoted bugs and was unable to reproduce. Anybody else got it working?

Comment by Nathan2055 [ 28/Dec/12 ]

@Gerrard Lukacs: Actually, you're right. YouTubers get a lot more hits than the bug tracker, too.

Comment by WolfieMario [ 28/Dec/12 ]

This bug isn't a security issue. Also, it's already in videos - setting it to private would just lead to duplicate reports.

Comment by Nathan2055 [ 28/Dec/12 ]

This is a bug that people can take advantage of, so it should be set to private.

Comment by John [ 18/Dec/12 ]

Well, it is very useful, even though it is a bug.

Comment by Xristos Mpesiris [ 19/Nov/12 ]

Correct, Chalmes, this is where I saw the bug from!

I didn't see anyone reporting it, so I reported it!

I was pretty sure that 1.4.6 Pre-Release would come either way!

The sooner these bugs are fixed the sooner I will get to play with my mods!

It doesn't matter if we have to get to Minecraft 1.4.10+ for that, as long as we get there faster!

Comment by Chalmes (Jon) [ 18/Nov/12 ]

http://www.youtube.com/watch?v=AKt747JzyBE

Comment by WolfieMario [ 17/Nov/12 ]

It also works if a mob is killed by a normal arrow (no flame effect) and you switch to a looting sword fast enough, and even works on deflected ghast fireballs (you can even deflect the fireball directly with the sword). It happens because the game checks the item you are holding at the time the mob dies, rather thank the item you killed the mob with.

Generated at Sun Jan 12 12:00:46 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.