Skip to content

Render Manager

The RenderManager lets plugins draw shapes and text both in the world (esp boxes, tracers, nametags) and on the screen overlay (HUD). It is located in the com.originmint.managers.RenderManager class.

The drawing methods are identical on 1.8.9, 1.18.2, 1.20.4 and 1.21 — the same plugin drawing code compiles and runs on every supported version.


Coordinates and colors

World methods take absolute world coordinates — the manager converts them to camera-relative coordinates for you. Overlay methods take screen pixels with the origin in the top-left corner; use getOverlayWidth() and getOverlayHeight() for the current screen size.

Colors are either four floats (r, g, b, a, each 0.01.0) or a packed int in ARGB order, for example 0xFFFF0000 for opaque red.

Most world methods accept lineWidth (line thickness in pixels) and throughWalls (when true, the shape is visible through terrain).


World drawing

drawWorldBox

Draws a wireframe box between two world positions.

RenderManager render = RenderManager.getInstance();
// minX, minY, minZ, maxX, maxY, maxZ, r, g, b, a, lineWidth, throughWalls
render.drawWorldBox(10, 64, 10, 11, 65, 11, 0.2F, 1.0F, 0.4F, 1.0F, 2.0F, true);

drawBlockBox

Draws a wireframe box around a single block position.

// x, y, z, argb [, lineWidth, throughWalls]
render.drawBlockBox(10, 64, 10, 0xFF2ED1FF);
render.drawBlockBox(10, 64, 10, 0xFF2ED1FF, 2.0F, true);
// or with float colors
render.drawBlockBox(10, 64, 10, 0.2F, 0.8F, 1.0F, 1.0F);

drawWorldLine

Draws a line between two world positions.

// x1, y1, z1, x2, y2, z2, r, g, b, a, lineWidth, throughWalls
render.drawWorldLine(10.5, 65, 10.5, 10.5, 70, 10.5, 1.0F, 0.8F, 0.1F, 1.0F, 2.0F, true);

drawWorldNameTag

Draws a billboarded nametag (always facing the camera) at a world position. line2 may be an empty string. The optional textSize multiplies the base size (1.0F is the default).

// x, y, z, line1, line2, r, g, b, a, throughWalls, withBackground [, textSize]
render.drawWorldNameTag(10.5, 67, 10.5, "Title", "subtitle", 1.0F, 1.0F, 1.0F, 1.0F, true, true);
// argb overload with custom text size
render.drawWorldNameTag(10.5, 68, 10.5, "Big tag", "", 0xFFFFD24D, true, false, 1.5F);

Entity helpers

These overloads take a net.minecraft.entity.Entity directly (the class name is the same on every supported version) and draw around its bounding box. They are safe to call with null — nothing is drawn.

import net.minecraft.entity.Entity;

// Box around the entity
render.drawEntityBox(entity, 0x80FF0000);
render.drawEntityBox(entity, 1.0F, 0.0F, 0.0F, 0.5F, 2.0F, true);

// Line from the camera to the entity
render.drawEntityLine(entity, 0x8000FF00);
render.drawEntityLine(entity, 0.0F, 1.0F, 0.0F, 0.5F, 2.0F, true);

// Tracer from the bottom-center of the screen to the entity
render.drawTracerLine(entity, 0x800000FF);
render.drawTracerLine(entity, 0.0F, 0.0F, 1.0F, 0.5F, 2.0F, true);

Overlay drawing

Overlay methods draw flat shapes on the screen during the OVERLAY render tick. Positions and sizes are in screen pixels.

int width = render.getOverlayWidth();
int height = render.getOverlayHeight();

// x, y, width, height, r, g, b, a — filled rectangle
render.drawOverlayFilledRect(10, 10, 220, 70, 0.0F, 0.0F, 0.0F, 0.6F);

// x, y, width, height, r, g, b, a, lineWidth — rectangle outline
render.drawOverlayRect(10, 10, 220, 70, 0.2F, 1.0F, 0.4F, 1.0F, 2.0F);

// x1, y1, x2, y2, r, g, b, a, lineWidth
render.drawOverlayLine(10, 10, 230, 80, 1.0F, 0.3F, 0.3F, 1.0F, 2.0F);

// x, y, text, r, g, b, a, size
render.drawOverlayText(18, 18, "Hello " + width + "x" + height, 1.0F, 1.0F, 1.0F, 1.0F, 16);

Full example

See the World and overlay drawing example for a complete plugin that draws world shapes and a HUD panel on every supported version.