What is the correct way of using /data merge on entity tags such as Passengers and Tags and Team?

Solution 1:

Okay, I've tested it out and found something interesting. I tried this command from your question:

execute as @e[type=wolf] run data merge entity @s {ActiveEffects:[{Id:14,Amplifier:0,Duration:99999}]}

Now... be patient! Wait about 30 seconds. Does the wolf receive the effect now?

For me, it takes about 30 seconds for the effect to show up. However, during that 30 second period, try running this command a few times:

data get entity @e[type=wolf] ActiveEffects

Notice something? The NBT data is there, but for some reason isn't showing up on the mob itself.

This is because the server has received those changes but hasn't told the client side to update. To update it, you must air toggle it:

execute as @e[type=wolf] store result entity @s Air short 1 run time query gametime