Interface GuiPaintWorklet

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface GuiPaintWorklet
Trusted mod-code callback that records bounded, renderer-neutral GUI paint commands.

Worklets never receive Minecraft renderer objects. The callback may use animation time, but should provide a stable cacheKey(GuiPaintWorkletContext) when its output can be reused.

  • Method Details

    • paint

      void paint(GuiPaintWorkletContext context, GuiPaintRecorder recorder)
    • cacheKey

      default Object cacheKey(GuiPaintWorkletContext context)
      Returns an immutable reusable command key, or null to record each execution. Width, height, physical scale, states and declared properties are included automatically. Animation time is excluded; time-dependent output must include its clock or a quantized time bucket in this key. Inputs and returned keys must not mutate.