The bug
Giving yourself weakness now negates only your weapon's base attack damage and not Sharpness/Smite/Bane of Arthropods damage.
How to reproduce
Run:
/give @s splash_potion[minecraft:potion_contents={potion:"minecraft:long_weakness"}] /give @s diamond_hoe[minecraft:enchantments={"minecraft:sharpness":1}] /summon villager ~ ~ ~ {Health:1}
→ Observe how the diamond hoe's tooltip says
2 Attack Damage
(or rather, imagine that it says that until MC-271840 is fixed) and the weakness potion's tooltip says-4 Attack Damage
.Throw the potion at your feet and hit the villager with the diamond hoe.
→ ❌ Villager died even though the potion was supposed to take away 4 (of your 2) attack damage
Notes
When attacking while falling, neither critical strike damage nor bonus damage from the mace are considered part of the base attack value (from which the weakness value is subtracted). However, if the attack manages to overcome the weakness value due to this bug, mace bonus damage will be applied while critical strike damage will not.
Linked issues
is duplicated by 2
relates to 2
Attachments
Comments 15
Turns out the problem is that damaging enchantments now apply after the Weakness effect. Probably added in by accident during the Sharpness nerf. You might wanna reopen this.
It'd be a shame if this bug were present in the full 1.9 release. A vote for this issue is a vote for functional pvp/pve!
This is mostly for myself, but I made a single-command-block thing which makes it easy to test and update all the potion-effect-related bugs I've reported. Feel free to try it yourself if I ever slack off on keeping these issues up to date.
summon falling_block ~ ~1 ~ {BlockState:{Name:activator_rail},Time:1,Passengers:[{id:command_block_minecart,Command:"gamerule commandBlockOutput false"},{id:command_block_minecart,Command:"clear @p"},{id:command_block_minecart,Command:"give @p wooden_sword"},{id:command_block_minecart,Command:"give @p minecraft:diamond_hoe{Enchantments:[{id:sharpness,lvl:1}]}"},{id:command_block_minecart,Command:"summon minecraft:fireball ~ ~1 ~ {Motion:[0d,0d,0d]}"},{id:command_block_minecart,Command:"effect give @p minecraft:weakness 1000 0 true"},{id:command_block_minecart,Command:"give @p minecraft:splash_potion{Potion:\"minecraft:water\",CustomPotionEffects:[{Id:3,Duration:2000,Ambient:1b}],display:{Name:\"\\\"Ambient Haste Potion\\\"\"}}"},{id:command_block_minecart,Command:"give @p minecraft:milk_bucket"},{id:command_block_minecart,Command:"tellraw @p [\"\",{\"text\":\"Directions for testing clamlol's potion-effect-related bugs:\",\"bold\":true},{\"text\":\"\\n\"},{\"text\":\"1) Try hitting the fireball with the wooden sword, then with the diamond hoe. If only the hoe is able to hit it, update \"},{\"text\":\"MC-207353\",\"color\":\"dark_aqua\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://bugs.mojang.com/browse/MC-207353\"}},{\"text\":\" and \"},{\"text\":\"MC-92734\",\"color\":\"dark_aqua\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://bugs.mojang.com/browse/MC-92734\"}},{\"text\":\".\"},{\"text\":\"\\n\"},{\"text\":\"2) Throw the splash potion at your feet. If the particles emanating from you are opaque, update \"},{\"text\":\"MC-96535\",\"color\":\"dark_aqua\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://bugs.mojang.com/browse/MC-96535\"}},{\"text\":\".\"},{\"text\":\"\\n\"},{\"text\":\"3) (Optional) Drink the milk to remove your Weakness and Haste.\"}]"},{id:command_block_minecart,Command:"setblock ~ ~ ~1 command_block{Command:\"fill ~ ~-1 ~-1 ~ ~ ~ air\"} replace"},{id:command_block_minecart,Command:"setblock ~ ~-1 ~1 redstone_block"},{id:command_block_minecart,Command:"kill @e[type=command_block_minecart,distance=0..2]"}]}
As of 24w18a this seems to have been either fixed or blocked by another bug (mobs not taking damage if the base attack, ignoring the crit multiplier, would deal 0 damage). I will investigate this further when I have time.
Works just fine for me: Level 1 weakness gave me -4 attack damage, level 2 gave me -7.