Skip to main content

Paint API

Paint API allows you to draw things on the screen, both from server and directly from client. This can allow you to create widgets from server side or effects on screen or in world from client side.

Currently it doesn't support any input, but in future, in-game menus similar to Source engine ones will be supported.

Paintable objects are created from NBT/Json objects and all have an id. If id isn't provided, a random one will be generated. Objects x and z are absolute positions based on screen, but you can align elements in one of the corners of screen. You can bulk add multiple objects in one json object.

You can edit paintable objects with /kubejs paint command, but the recommended way is using player methods - .paint({ object }), .removePaint(id), .clearPaint(). Paintable objects will be cleared when players leave world/server, if its persistent, then it must be re-added in player.logged_in event every time.