Skip to content

Client Attribute Files

Smileycorp edited this page Feb 27, 2024 · 3 revisions

Attribute Icons

Attribute icons are the icons rendered at the top of the screen, under the class name.

They are stored at assets/<namespace>/textures/attribute/<attribute name>.png in a texture pack, the default one which can be found in the dcclasses folder in your config folder.

For example the minecraft attribute generic.max_health would be stored at assets/minecraft/textures/attribute/generic.max_health.png and the paraglider attribute paraglider:max_stamina would be stored at assets/paraglider/textures/attribute/max_stamina.png

These namespaces correspond to the namespace in the registry name of a given attribute, for example paraglider: would correspond to paraglider and no namespace would be minecraft.

Attribute Display Properties

As well as using icons the mod uses attribute display properties, located in the assets/<namespace>/attributes.json file.

This namespace can be anything, and does not correspond to anything in particular, but in the example pack attributes have been seperated by mod id.

Below are the default examples for minecraft and paraglider.

example1
{
	"generic.max_health": {
		"base_value": 2,
		"display_mode": "DECIMAL",
		"text_colour": "dark_red"
	},
	"generic.armor": {
		"base_value": 2,
		"display_mode": "DECIMAL"
	},
	"generic.movement_speed": {
		"base_value": 0.1,
		"display_mode": "DECIMAL"
	}
}
example2
{
	"paraglider:max_stamina": {
		"base_value": 28,
		"display_mode": "PERCENTAGE",
		"text_colour": "#55FF55"
	}
}

As shown in the file, each attribute entry is defined by putting the attribute registry name, then a list of properties.

Base Value

base_value determines the usual value of a given attribute that the displayed value is calculated from, for example generic.max_health is defined a 2 (two half hearts), with no defined base value, it will be 1 by default.

You can find a list of default values here.

Display Mode

display_mode can either be defined by PERCENTAGE or DECIMAL, and if not defined will be DECIMAL by default.

PERCENTAGE displays the total attribute value as a percentage of base_value for example a paraglider:max_stamina stat of 35 will display as 125%, as 35 is 125% of the base value 28.

DECIMAL displays the total attribute value as a decimal of base_value for example a generic.max_health stat of 21 will display as 10.5 (10 and a half hearts).

Text Colour

text_colour determines the colour the text will be rendered as, by default it will be white.

Text colour can either use one of the text formatting colours e.g. red, gold, or dark_red, check here for a full list, or # followed by a hex code e.g. #55FF55.

Clone this wiki locally