Mojira Archive
MCPE-177601

damage_multiplier can't reduce damage below 1.0

The bug

The damage_sensor component can modify incoming damage with the damage_multiplier field. It works well. However, if the resulting damage would be less than 1.0, it gets set to 1.0 instead. This is a problem for me, because it makes damage_multiplier ineffective against weak attacks.

damage_multiplier happily and correctly sets damage to fractional values that are greater than 1.0, but not any between 0.0 and 1.0.

How to reproduce

1. Download and open the attached world. It has a sheep with a 0.1 damage multiplier and 3 health
2. Punch the sheep repeatedly

Expected results
The sheep should survive for 30 hits, since each hit should do 0.1 damage.

Observed results
The sheep dies in 3 hits, since each hit couldn't do less than 1 damage.

Sheep behavior, for reference

{
   "format_version": "1.16.0",
   "minecraft:entity": {
      "description": {
         "identifier": "minecraft:sheep",
         "is_spawnable": true,
         "is_summonable": true,
         "is_experimental": false
      },
      "components": {
         "minecraft:collision_box": {
            "width": 0.9,
            "height": 1.3
         },
         "minecraft:nameable": {},
         "minecraft:physics": {},
         "minecraft:pushable": {
            "is_pushable": true,
            "is_pushable_by_piston": true
         },
         "minecraft:health": {
            "value": 3
         },
         "minecraft:damage_sensor": {
            "triggers": {
               "damage_multiplier": 0.1
            }
         }
      }
   }
}

Unresolved

[Mod] tryashtar

2023-12-15, 08:43 AM

2024-02-01, 12:14 AM

1

2

Confirmed

1156806

1.20.50, 1.20.60.23 Preview, 1.20.70.21 Preview, 1.20.51 Hotfix

-