I believe you can also do it through procedures alone (that doesn't involve a knockback enchantment). check https://mcreator.net/forum/58735/move-direction-youre-facing, adapt the movement procedure, and put it in your sword's "when living entity is hit with tool" trigger.
You can just use the global trigger "On entity attacked" and use a condition like if (item in main hand = stick) then do the knockback procedure. And you have it, i think
To put that on a stick or any tool you can add nbt data to it with a command or any other method, then check if the held item has that nbt flag and do the knockback
I think that only with enchantments (tool in hand update tick - if provided itemstack doesn't have knockback enchant, enchant it with knockback).
I believe you can also do it through procedures alone (that doesn't involve a knockback enchantment). check https://mcreator.net/forum/58735/move-direction-youre-facing, adapt the movement procedure, and put it in your sword's "when living entity is hit with tool" trigger.
how do i get this on a stick?
You can just use the global trigger "On entity attacked" and use a condition like if (item in main hand = stick) then do the knockback procedure. And you have it, i think
To put that on a stick or any tool you can add nbt data to it with a command or any other method, then check if the held item has that nbt flag and do the knockback