mojira.dev
MC-273005

A weapon that deals no damage may sometimes deal damage if you hit fast enough

Steps to reproduce:

  1. Create a void world with the provided data pack.

  2. Use the following commands to create and display a scoreboard:

    /scoreboard objectives add Health dummy "Health"
    /scoreboard objectives setdisplay sidebar Health
  3. Place an always active repeating command block with the following command:

    execute as @p at @s as @n[type=!minecraft:player] store result score @s Health run data get entity @s Health 1000000
  4. Spawn some mob in a cage: the scoreboard will display its health with a precision of 1 millionth.

  5. Enchant a weapon with the squeaky:squeaky enchantment, which multiplies the weapon's damage by 0, resulting in a weapon dealing 0 damage.

  6. Hit the mob, multiple times to ensure the enchantment's behavior: its health will not change as expected.

  7. Hit the mob faster, at least faster than one hit every 400ms for a sword from what I noticed, if possible with an auto-clicker to get a consistant timing but simply spamming also does the trick.

Observed result:
The mob will sometimes take a very small amount of damage, less than 0.1 HP.

Expected result:
The mob does not take damage.

Attachments

Comments 3

I have faced same issue and if you crit using that weapon it does the crit damage as well. I have attached by enchantment file here as it is little different. 

I've already reported the critical hit issue too, but it's already tracked in MC-272004 and at this point we can't state that both issues are related.

Still in 1.21-RC1, with an even stronger effect I just found: if your enchantment adds a high enough negative value, you can one shot (or rather, two shots) a warden by hitting it twice quickly.
Absolute nonsense.

{
	"description": "Negative Damage",
	"supported_items": "#minecraft:enchantable/weapon",
	"weight": 1,
	"max_level": 1,
	"min_cost": {
		"base": 0,
		"per_level_above_first": 0
	},
	"max_cost": {
		"base": 0,
		"per_level_above_first": 0
	},
	"anvil_cost": 0,
	"slots": [
		"mainhand"
	],
	"effects": {
		"minecraft:damage": [
			{
				"effect": {
					"type": "minecraft:add",
					"value": -999
				}
			}
		]
	}
}

AHL

(Unassigned)

Confirmed

Platform

Low

Combat, Data Packs, Items

1.21 Pre-Release 3, 1.21 Pre-Release 4, 1.21, 1.21 Release Candidate 1

Retrieved