Topic category: Help with modding (Java Edition)
Hey all, I am making an ability that makes it so when a key bind is pressed, all mobs nearby (in like a 3 block radius) get blown back away from the player depending on where they are relative to the player's position (for example, if mobs are fully surrounding the player they will all get blown back away in a circle formation). I have the key bind made, I just can't figure out how to make the procedure to push mobs away correctly.
I've tried the 'explode at' block but when setting it to a higher explosion power to do more knockback, it ends up doing way more damage than I would like and most of the time just kills the mobs instead. I would like the use the 'override motion vector' block if possible as I feel like it has the best control when fine-tuning exactly how strong the push is.
Figured this out with a slightly janky method, here is the code for anyone who may be interested in doing the same thing.
This is done by forcing all the nearby mobs to look at you, and then launches them in the opposite direction they are looking, and while this does work, I wouldn't mind still accepting a solution that doesn't involve snapping a mobs neck to look at you to if someone knows how.