The Bug:
Attribute effects in the location-based effects of sulfur cube archetypes don't update when sulfur cubes move.
Location-based attribute effects on enchantments are added when their condition starts matching and removed when it stops. However, in sulfur cube archetypes, these effects are only added when the block is swallowed and are never removed when the condition stops matching, therefore introducing an inconsistency.
Steps to Reproduce:
Create a new world with the attached data pack.
Standing below Y=100, summon a sulfur cube holding blue ice by using the command provided below.
/summon minecraft:sulfur_cube ~ ~ ~3 {Size:1,NoGravity:1b,equipment:{body:{id:"minecraft:blue_ice",count:1}}}Check the maximum health of the sulfur cube by using the command provided below.
/attribute @n[type=minecraft:sulfur_cube] minecraft:max_health getTeleport the sulfur cube above Y=100 by using the command provided below.
/tp @n[type=minecraft:sulfur_cube] ~ 120 ~Check the maximum health of the sulfur cube again with the same command, and observe how it’s still 8.0.
Observed Behavior:
The attribute effect isn't applied when the sulfur cube moves to where its condition matches.
Expected Behavior:
The attribute effect would be applied when its condition matches, just like with enchantments.