1.8.8 Replicate arrows

Discussion in 'Spigot Plugin Development' started by fsnow, Apr 19, 2020.

  1. Hey, I'm wondering how Spigot calculates their arrows. I'm using this code to 'offset' arrows

    Code (Text):

    double arrowAngle = 90 - degrees;
    double totalAngle = event.getEntity().getLocation().getYaw() + arrowAngle;
    double arrowDirX = Math.cos(Math.toRadians(totalAngle));
    double arrowDirZ = Math.sin(Math.toRadians(totalAngle));
    Vector arrowDir = new Vector(arrowDirX, event.getEntity().getLocation().getDirection().getY(), arrowDirZ).multiply(event.getForce());
    but if I compare the arrow's which the server generates from a player firing a bow to this code under the exact same circumstances they produce different results.