Jump to content

Morlitch

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Morlitch

  1. 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?
  2. Exactly as my title says. I am trying to import net.minecraft.entity.EntityLivingBase and it's not showing up as an available repository... What is the new way to call this functionality?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.