Skip to content

Server Outlines

Moth edited this page Aug 9, 2026 · 1 revision

Server Outlines

ServerOutlines controls outlines from the logical server.

Use server outlines when the server should decide which entities or block entities are outlined.

import moth.butterflyapi.outline.ServerOutlines;

Outline an Entity

Create a style:

OutlineStyle style =
        OutlineStyle.builder("#FFFFFF")
                .thickness(2)
                .build();

Then apply it:

ServerOutlines.set(
        targetEntity,
        style
);

Clear an Entity Outline

ServerOutlines.clear(
        targetEntity
);

Viewer-Specific Outlines

Butterfly API can show an outline to one specific player.

ServerOutlines.setFor(
        player,
        targetEntity,
        OutlineStyle.builder("#66CCFF")
                .thickness(3)
                .placement(
                        OutlinePlacement.OUTSIDE
                )
                .build()
);

This allows the server to control which viewer receives the outline.

Clear a Viewer-Specific Outline

ServerOutlines.clearFor(
        player,
        targetEntity
);

Block Entity Outlines

ServerOutlines also supports block entities.

ServerOutlines.set(
        displayCaseBlockEntity,
        OutlineStyle.of("#FFFFFF")
);

Clear a Block Entity Outline

ServerOutlines.clear(
        displayCaseBlockEntity
);

Example

OutlineStyle questStyle =
        OutlineStyle.builder("#FFFFFF")
                .thickness(2)
                .placement(
                        OutlinePlacement.CENTERED
                )
                .visibleThroughWalls(true)
                .build();

ServerOutlines.set(
        targetEntity,
        questStyle
);

Later:

ServerOutlines.clear(
        targetEntity
);

When to Use ServerOutlines

Use ServerOutlines when:

  • The logical server controls the outline
  • The outline should be synchronized to clients
  • Different players may need different outline states
  • A block entity should receive a synchronized outline

For a purely local effect, use Client Outlines instead.

Related Pages

Clone this wiki locally