Mojira Archive
MCPE-155588

No warning/error when using invalid damage sensor "cause" in behavior files

The bug

The cause field in damage sensors is silently ignored if it's set to an invalid value.

Expected behavior
A content log error should appear to inform you of the schema error

How to reproduce
1. Download and open the attached world. It has a sheep.json behavior file that contains "cause":"asdfasdf" in a damage sensor.
2. Try to punch a sheep
3. Notice it takes no damage, and there was no content log popup about the invalid component

Notes
The vanilla behavior pack contains this schema error in a few files

{
   "format_version": "1.16.0",
   "minecraft:entity": {
      "description": {
         "identifier": "minecraft:sheep",
         "is_spawnable": true,
         "is_summonable": true,
         "is_experimental": false
      },
      "components": {
         "minecraft:is_dyeable": {
            "interact_text": "action.interact.dye"
         },
         "minecraft:collision_box": {
            "width": 0.9,
            "height": 1.3
         },
         "minecraft:nameable": {},
         "minecraft:health": {
            "value": 8,
            "max": 8
         },
         "minecraft:physics": {},
         "minecraft:pushable": {
            "is_pushable": true,
            "is_pushable_by_piston": true
         },
         "minecraft:damage_sensor": {
            "triggers": {
               "cause": "asdfasdf",
               "deals_damage": false
            }
         }
      }
   }
}

Fixed

[Mod] tryashtar

2022-05-08, 12:41 AM

2023-09-26, 01:38 AM

2023-09-26, 01:38 AM

1

1

Confirmed

779628

1.18.32, 1.19.0.31 Preview

-