Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Player player = Canary.getServer().getPlayer(caller.getName());
- double pitch = (player.getPitch() + 90.0F) * Math.PI / 180.0D;
- double rot = (player.getRotation() + 90.0F) * Math.PI / 180.0D;
- double x = Math.sin(pitch) * Math.cos(rot);
- double y = Math.sin(pitch) * Math.sin(rot);
- double z = Math.cos(pitch);
- Vector3D v = new Vector3D(x, z, y); // Wichtig hier ist x, z, y weil in minecraft z und y vertauscht sind
- v.multiply(3);
- Arrow entity = (Arrow) Canary.factory().getEntityFactory().newEntity(EntityType.ARROW, player.getLocation());
- entity.spawn();
- entity.moveEntity(v.getX(), v.getY(), v.getZ());
Advertisement
Add Comment
Please, Sign In to add comment