Skip to main content

Resource Definitions

File: data/<namespace>/saturn/resource/<path>.json. For example, the following file defines example:mana. A resource stores an entity's current value, while the definition supplies the bounds and the display method; merely creating a definition does not automatically initialise the resource for every entity or grant abilities.

FieldTypeRequiredDefaultDescription
default_valueNumber provideryes—Value used when the resource is initialised.
minNumber providerno0Lower bound of the resource.
maxNumber provideryes—Upper bound of the resource.
iconIconnoomittedTexture ID or item template.
particle_colorRGB stringno"#FFFFFF"Particle colour.
barsArray of resource barsno[]Display bars for this resource.

Example​

data/example/saturn/resource/mana.json
{
"default_value": 50,
"min": 0,
"max": 100,
"icon": {
"id": "minecraft:lapis_lazuli"
},
"particle_color": "#4488FF",
"bars": [
{
"anchor": "left",
"renderer": {
"type": "saturn:text_only",
"format": "%current% / %maximum%",
"color": "#4488FF"
}
}
]
}

Use add_resource to add or remove resources as an effect, and a resource cost to charge a payment. For initialisation and transactional interfaces on the development side, see the Java API.