Skip to content

File experience.json

This config is used to define experience behavior such as how much experience is required to level up or how experience can be gained. It is may be located in the experience.json file inside each category folder. This file is optional, and if it is absent then experience is not enabled for this category.

This is probably the most complex part of configuration.

Example

json
{
	"experience_per_level": {
		"type": "expression",
		"data": {
			"expression": "min(level ^ 1.432 + 10, 200)"
		}
	},
	"sources": [
		{
			"type": "puffish_skills:kill_entity",
			"data": {
				"parameters": {
					"dropped_xp": {
						"type": "entity_dropped_experience"
					},
					"max_health": {
						"type": "entity_max_health"
					}
				},
				"experience": [
					{
						"expression": "dropped_xp + max_health / 20"
					}
				],
				"anti_farming": {
					"enabled": true,
					"limit_per_chunk": 15,
					"reset_after_seconds": 300
				}
			}
		}
	]
}

JSON Structure

PropertyDescription
enabledA boolean. Defines if experience is enabled.
experience_per_levelAn 'experience_per_level' object. Defines how much experience is needed to level up and gain point.
sourcesAn array of source objects.

experience_per_level object

PropertyDescription
typeA string. Defines the type of the experience per level. Allowed values are values, expression
dataAn experience_per_level_data element.

experience_per_level_data object when type is values

PropertyDescription
valuesAn array of integers. Each value defines experience needed for each level.

experience_per_level_data object when type is expression

PropertyDescription
expressionAn expression string that contains arithmetic expression. Variable level can be used in the expression.

source object

PropertyDescription
typeA string. Defines the type of the source.
dataAn source_data element.

Experience sources

You can read more about experience sources here.