For context, I don't think the riptide enchantment gives a player enough speed or distance underwater. I mostly wanted to use it for fast water travel without a boat. I've found that giving a player dolphin's grace gives me the experience I'm looking for. Unfortunately, I've found that only giving the effect to players using the item is impossible, so I want to give the effect to any player holding a riptide 3 trident. I've written the following command to execute this:
execute as @a[nbt={SelectedItem:{id:"minecraft:trident",tag:{Enchantments:[{id:riptide,lvl:3}]}}}] run effect give @s minecraft:dolphins_grace 1
And I've put it in a repeating, unconditional, always active command block, yet I don't get the effect when I hold the trident. Additionally, I also want this to work when other enchantments are used alongside riptide 3, but I'm not sure the command above would work if e.g. mending and riptide 3 are added to a trident.
Could anyone tell me why my command doesn't work, if this would work for additional enchantments, and if not, how to fix that?