Skip to main content

Segmented bar

saturn:segmented_bar

Represents the resource amount with multiple colour blocks.

Used for ResourceBar.renderer; it displays the resource snapshot and does not modify the resource. Colours are written as #RRGGBB.

JSON fields​

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:segmented_bar
segmentsIntegeryes—Number of segments. Codec range: 1, 256.
gapIntegerno1Gap between segments, in pixels. Codec range: 0, 32.
full_color#RRGGBB stringno"#FFFFFF"Colour of a filled segment.
empty_color#RRGGBB stringno"#555555"Colour of an empty segment.

JSON example​

{
"type": "saturn:segmented_bar",
"segments": 1
}

This is a value to embed in the corresponding field, not a standalone loadable data pack file. The example: references in the examples must be replaced with defined entries.

Java entry point​

com.iafenvoy.saturn.data.resourcebar.builtin.renderdata.SegmentedRenderData. This page is based on the Codec in the current 26.1.2 source.