Can I put in a minecraft 1.14 data pack that when I press a key on the keyboard can I get an effect or something like that?
As far as I know, that's not possible with a datapack.
But is there any other way to stay in vanilla?
As much as I do not know. Maybe it is with a plugin (I have no idea about plugins) and otherwise safe with mods.