The Bug:
Certain damage sources such as most environmental damage sources can deal item damage every tick to a shield with a custom blocks_attacks
component, despite this damage not applying every tick to the player due to invincibility frames.
How to reproduce:
Place a magma block.
Get a shield that is able to block all damage sources with a blocking angle of 180° using the next command:
/give @s shield[minecraft:blocks_attacks={damage_reductions:[{types:[],base:1,factor:1,horizontal_blocking_angle:180}],block_sound:"minecraft:item.shield.block"}]
While blocking, step on the magma block.
Notice the shield durability.
Expected result:
The shield would be damaged at the same rate the player is damaged by the magma block.
Observed result:
The shield is damaged every tick, ignoring invincibility frames and making it break within seconds.
That’s true, the easiest way to test this is by making a scoreboard which takes the value of item damage. Even tough the block sound is played correctly, durability lowers every tick.