Like the title says, how do I get the player from the LivingEntity so I can make this knockback effect on the amethyst sword? i want the amethyst sword to give knockback 10 to any entity i hit and in the direction im looking at
@SubscribeEvent
public static void onPlayerAttack(LivingAttackEvent event){
Entity entity = event.getEntity();
LivingEntity living = event.getEntityLiving();
Item item = ItemInit.AMETHYST_SWORD.get();
if (event.getEntity() instanceof LivingEntity){
living.applyKnockback(10, 20, 20);
System.out.println("i print");
}
}