Use this for projectile start position
Code:
private static Position center(Entity entity) {
Position position = entity.getPosition();
if (entity instanceof CharacterEntity) {
CharacterEntity attacker = (CharacterEntity) entity;
if (attacker.getSize() > 2) {
int deltax = (int) Math.ceil((double) attacker.getSize() / 3d);
int deltay = (int) Math.ceil((double) attacker.getSize() / 3d);
position = new Position(attacker.getPosition().getX() + deltax, attacker.getPosition().getY() + deltay, attacker.getPosition().getZ());
}
}
return position;
}