Topic category: Help with Minecraft modding (Java Edition)
I am trying to impliment a custom knockback system into my mod, and I want to be able to control how far an entity gets knocked back by certain items. (Some items have more knockback, some have less) I'm using this procedure that I found on another post whenever an entity is hit by the item to override knockback and make an entity move forward in the direction it is facing:
Now, I want the entity to move backwards in the direction the entity that hit it (In most cases the player) is facing, basically I want them to be knocked back by the player, however, when I try changing the Event/target entity in the set local: yaw block to source entity, it disables the entire procedure. (I can tell because I also set the vy to 0 instead of what the image shows, and the entity is still being knocked up)
I could use the raytracing block to make the entity face the player and then move backwards, but I want the entity to retain it's facing direction and move away from the player regardless of the direction they are facing.
What am I doing wrong? How can I make this work?
well why don't you just add vanilla knockback to all of your items?
Because I want some items to have less knockback than normal, can I apply negative knockback or like 0.5 knockback?
Also, I don't want the enchantment glint on the items, but I want it to get an enchantment glint if the item is enchanted with something else, is that possible?
Also, wouldn't that increase the enchantment weight of the item, I mean, you wouldn't be able to put as many enchantments on it?
Change speed to a negative value.