Thanks for your reply! Finally got it working correctly!
new code:
public class PathRenderer {
private Minecraft mc;
public PathRenderer() {
mc = Minecraft.getInstance();
}
@SubscribeEvent
public void render(RenderWorldLastEvent event){
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder buffer = tessellator.getBuffer();
MatrixStack matrixStack = event.getMatrixStack();
Vec3d pos = mc.player.getPositionVec();
matrixStack.push();
matrixStack.translate(-pos.x, -pos.y, -pos.z);
RenderSystem.color3f(1, 0, 0);
RenderSystem.lineWidth(6);
buffer.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION);
Matrix4f matrix = matrixStack.getLast().getMatrix();
Color c = new Color(1f, 0f, 0f, 1f);
drawLine(matrix, buffer, new Vec3d(0, 57, 0), new Vec3d(5, 57, 0));
tessellator.draw();
matrixStack.pop();
}
private void drawLine(Matrix4f matrix, BufferBuilder buffer, Vec3d p1, Vec3d p2) {
buffer.pos(matrix, (float)p1.x + 0.5f, (float)p1.y + 0.5f, (float)p1.z + 0.5f).endVertex();
buffer.pos(matrix, (float)p2.x + 0.5f, (float)p2.y + 0.5f, (float)p2.z + 0.5f).endVertex();
}
}