Skip to content

Client Outlines

Moth edited this page Aug 9, 2026 · 1 revision

Client Outlines

ClientOutlines controls outlines locally on the client.

Use client outlines when an effect only needs to exist for the current client and does not need server synchronization.

import moth.butterflyapi.client.outline.ClientOutlines;

Set an Outline

ClientOutlines.set(
        entity,
        OutlineStyle.builder("#FFAA33")
                .thickness(2)
                .build()
);

Clear an Outline

ClientOutlines.clear(
        entity
);

Clear All Client Outlines

Remove every locally controlled outline with:

ClientOutlines.clearAll();

Using Outline Styles

Client outlines use the same OutlineStyle system as server outlines.

For example:

OutlineStyle style =
        OutlineStyle.builder("#66CCFF")
                .thickness(3)
                .placement(
                        OutlinePlacement.OUTSIDE
                )
                .visibleThroughWalls(true)
                .consistentThickness(true)
                .build();

ClientOutlines.set(
        entity,
        style
);

See Outline Styles for all available style options.

Cutout or Translucent Renderers

For cutout or translucent custom rendering, use:

OutlineStyle.builder("#FFFFFF")
        .matchModelLayer(true)
        .build();

This helps the outline mask follow the source render layer.

Custom Renderers

Custom renderers that need to contribute their own outline mask can use:

OutlineRenderers.capture(...)

Block entities whose renderer exists only for outline-mask contribution can implement:

OutlineOnlyBlockEntity

Client vs Server

Use ClientOutlines when:

  • The effect is local
  • Only the current client needs to see it
  • No synchronization is required

Use Server Outlines when:

  • The logical server controls the effect
  • Multiple clients need synchronized state
  • Different viewers may receive different outlines

Related Pages

Clone this wiki locally