Project MMO

Project MMO

Perks Config Syntax and Examples

Perks can be configured via scripting and datapack. Whether you are using scripting or datapacks, you will need to know what the properties are for the perk you are configuring. This will inform you on what to include in the {} of the datapack or the special nodes in your scripting.

For perks from addons, you will need to refer to their documentation, but you can check here for the Built-in Perk Properties

Datapack Example File

{
"type": "PERKS",
"perks": {
//perks are nested under the event they apply to.
//Each event is an array [] with each perk as an item in that list
//eg "EVENT": [ {perk A}, {perk B}, {perk C} ]
"JUMP": [
{
"per_level": 0.0005,
"perk": "pmmo:jump_boost",
"skill": "agility"
}
],
"SKILL_UP": [
{
"perk": "pmmo:fireworks",
"skill": "mining"
},
{
"per_level": 0.05,
"perk": "pmmo:attribute",
"attribute": "minecraft:generic.max_health",
"max_boost": 10.0,
"skill": "endurance"
}
]
//events don't have to have perks. You can add or omit whatever events
//you do or do not have perks for.
}
}

Scripting Example File

WITH config(perks)
set(clear_all); //removes all perks from defaults before we start adding our own. not required.
set().event(SKILL_UP)
.perk(pmmo:fireworks)
.skill(mining);
set().event(DEAL_DAMAGE)
.perk(pmmo:damage_boost)
.skill(archery)
.applies_to(["minecraft:bow","minecraft:crossbow","minecraft:trident"]);
//notice for lists, you must write is as a standard JSON array
END
//Another approach for less typing
WITH config(perks).event(SKILL_UP).perk(pmmo:fireworks);
set().skill(archery);
set().skill(mining);
set().skill(dragon_slaying);
END

Scripting Syntax

Each configuration uses a combination of set(config_keyword).value(some_value);. The table below lists each configuration node's keyword, purpose and the value node format.

set node keysetting functionspecial nodesvalue node
clear_allclears the perks config of all perks
blankstart each perk with set()event(EVENT_TYPE) specifies which event this perk is for.property(value) perks take multiple values chained together where the attribute you are setting is the value node and the value inside the () is the value