So if I wanted to do something like:
PlayerEntity player = (PlayerEntity) dependencies.get("player");
Entity entity = (LivingEntity) dependencies.get("entity");
World world = (World) dependencies.get("world");
if ((((player instanceof LivingEntity) ? ((LivingEntity) player).getHeldItemMainhand() : ItemStack.EMPTY)
.getItem() == new ItemStack(WoodenHammerItem.block, (int) (1)).getItem())) {
double d1 = player.posX - entity.posX;
double d0;
for (d0 = player.posZ - entity.posZ; d1 * d1 + d0 * d0 < 1.0E-4D; d0 = (Math.random() - Math.random()) * 0.01D) {
d1 = (Math.random() - Math.random()) * 0.01D;
}
entity.attackedAtYaw = (float) (Math.atan2(d0, d1) * (180D / Math.PI) - entity.rotationYaw);
entity.knockBack(player, 5.0F, d1, d0);
}
So I can implement a custom level of knockback for a tool, how could I access the attackedAtYaw and knockBack arguments for the LivingEntity object? Or, if there is a more efficient way to implement knockback on hit of a mob, what would that be?