Boots that change minecraft:generic.movement_speed sometimes duplicate effect
We have a datapack that adds an enchantment that adds 0.2 to the minecraft:generic.movement_speed attribute of a player if they put on boots, however, seemingly randomly, itll duplicate the effect permanently until we manually change the value back in the player data. It seems like it applies the effect twice, but when taking off the boots, it only removes the first iteration of the effect (if that makes sense). Here's the effects table of the enchantment:
"effects": { "minecraft:attributes": [ { "id": "minecraft:enchantment.agility", "attribute": "minecraft:generic.movement_speed", "amount": { "type": "minecraft:linear", "base": 0.2, "per_level_above_first": 0.2 }, "operation": "add_multiplied_total" } ] }How can I make it so when the boots are taken off, instead of removing 0.2, it just sets minecraft:generic.movement_speed to the default value to mitigate this bug?