Project MMO

Project MMO

Special Abilities, "Perks"

Perks are a highly configurable system that allows users to trigger certain abilities when events happen in PMMO. While PMMO ships with a number of built in perks, the API allows other mods to add their own, which you can then configure to your liking.

For Developers go HERE

How do perks work

Perks are configured in the perks config. When an gameplay event occurs, requirements are checked first. If the player is not prohibitted from the action, special event triggers from addons occur. After those, all perks configured for that event will attempt to activate. Most perks have conditions such as specific skills, cooldowns, damage types, weapons used, etc. For all that meet their conditions, they activate and their special abilities go into effect. After this, any applicable experience is awarded.

Perks are also not tied to any specific skill or event. For example fireworks are configured for when players level up in skills, but they don't have to be. You could have them activate after a monster kill instead. The options are really limited only by your imagination.

Individual Perk Configurations

Perks are very dynamic and each perk can have any number of settings. For example let's use the perk pmmo:attribute with Minecraft's generic.max_health which gives extra hearts to the player based on their skill level

"EVENT_NAME": [
{
"perk": "pmmo:attribute",
"skill": "endurance",
"attribute": "minecraft:generic.max_health",
"per_level": 1,
"max_boost": 10
}
]

This perk has 4 settings skill, attribute, per_level and max_boost. When the EVENT_NAME event is triggered, this perk will use the player's endurance level. This particular perk is then going to give the player extra hearts according to the settings. In this case it's one half-heart per 1 level of the skill. So at 9 endurance, the player gets 4.5 hearts. The max boost sets a cap on how much extra health the player can get from skills. In this case it is set at 10, or 5 hearts.

Suppose this was my configuration though

"EVENT_NAME": [
{
"perk": "pmmo:attribute",
"skill": "endurance",
"attribute": "minecraft:generic.max_health",
"per_level": 1,
"max_boost": 10
},
{
"perk": "pmmo:attribute",
"skill": "combat",
"attribute": "minecraft:generic.max_health",
"per_level": 1,
"max_boost": 20
}
]

in this case the perk is calculated based on my endurance level AND my combat level. And combat has a higher cap. You can start to see how perks are dynamic.

Event Configuration

In the above section, we used a generic "EVENT_NAME", but you should be using actual event names. The full list of event names can be found HERE.

It is important to know what your perks do, so that you know what events to put them under. For example, it may not make sense to use "pmmo:jump_boost" under "BLOCK_BREAK" and have the player hop every time they break a block (as funny as that looks).

Default Properties

All perks are affected by the following properties. The below table lists them and the effect it will have on your perk.

propertyeffect
cooldownprevents this perk from activating until the duration has elapsed. Note: this applies to all versions of this perk, not just the perk for that configuration. For example a firework on level-up would not fire for the second skill if the cooldown had not elapsed
chancea value between 0.0 and 1.0 for the likelihood this perk will execute. 0.1 = 10%
skillspecifies a skill to supply to this perk. When this is used, the player's level in the skill will be passed to the perk when executed.
min_levelthe minimum level in the specified skill the player must have for this perk to execute. omitting the skill will negate this property
max_levelthe maximum level in the specified skill the player must have for this perk to execute. omitting the skill will negate thsi property
per_x_levelExecutes the perk only if the player's level is divisible by this value. omitting the skill will negate this property
milestonesA list of levels that this perk executes for. omitting the skill will negate this property

PMMO Perks

These are all the perks PMMO provides without any addons. The defaults listed below are the values if you omit the property in your configuration. By using a property in your pmmo-Perks.toml, the default is ignored.

pmmo:break_speed

Modifies the break-speed of blocks. Only works with the BREAK_SPEED event.

propertydefaultdescription
pickaxe_dig0how much faster pickaxes should break blocks per skill level
axe_dig0how much faster axes should break blocks per skill level
shovel_dig0how much faster shovels should break blocks per skill level
hoe_dig0how much faster hoes should break blocks per skill level
shears_dig0how much faster shears should break blocks per skill level
sword_dig0how much faster swords should break blocks per skill level
max_boostnonesee above.

pmmo:fireworks

Shoots a firework into the air above the player. Only works with the SKILL_UP event.

propertydefaultdescription
skill"none"The skill this firework should activate for.

pmmo:attribute

Gives the player an attribute modifier. This works with modded attributes. For the full list of vanilla attribute IDs, go HERE

propertydefaultdescription
attributenoneThe attribute ID being modified
max_boost0see above.
per_level0multiplies the player's skill by this value to set the attribute value
base0base value added to attribute value on top of per_level value
multiplicativefalseif true uses the attribute MULTIPLY operation. If false, uses the ADDITION operation

pmmo:temp_attribute

Gives the player an attribute for a specific duration, then removes it.

propertydefaultdescription
attributenoneThe attribute ID being modified
duration0How long the attribute should last. Default would be an instantaneous removal
max_boost0see above.
per_level0multiplies the player's skill by this value to set the attribute value
base0base value added to attribute value on top of per_level value
multiplicativefalseif true uses the attribute MULTIPLY operation. If false, uses the ADDITION operation

pmmo:jump_boost

Gives the player a vertical boost. If used with the JUMP event, will add to the jump, otherwise the perk will just launch the player into the air a certain amount.

propertydefaultdescription
max_boost0.25The maximum height added to the jump
per_level0.0005How much jump height each level of the skill contributes
base0A flat amount to add to the jump amount

pmmo:breath

Restores a portion of the breath bar after the last breath bubble dissapears

propertydefaultdescription
cooldown600How frequent the breath can refresh. setting to zero will make breath infinite
per_level1The amount of breath restored per level in the skill
base0A flat amount to add to the amount of breath restored
max_boost2bilThe maximum breath that can be restored, capped at player breath attribute

pmmo:damage_reduce

Reduces damage received when used with the RECEIVE_DAMAGE event.

propertydefaultdescription
per_level0.025Amount of damage per level in the specified skill to reduce by
for_damage"omitted"a Minecraft damage type id this reduction should apply to. If using damage type tags, place a # before the tag ID.
max_boostn/alimits the max reduction that can be achieved
base0A flat amount added to the per_level amount for the damage reduced

pmmo:damage_boost

Increases damage to attacks. This is the only damage booster for archery, magic, and gunslinging. Note that melee attack boosting should use pmmo:attribute and use the vanilla attack damage attribute.

propertydefaultdescription
applies_to["weapon:id"]Specifies which weapons will have boosted damage. The default is no weapons
for_damagenoneSpecifeis which damage types will have boosted damage. the default is all damage types
per_level0.05How much per, level in the skill will the damage be boosted by. Omitting the skill in this perk will result in no damage boosted
base1Since damage is a multiplier by default, the base is added to make damage equal to at least 1x the base damage. You could set this to zero to make players deal less damage before they reach a certain skill level, or if using multiplicative = false
multiplicativetrueMakes damage a multiplier. If false, adds to the damage by a flat amount
max_boost2bilThe maximum damage (including vanilla's value) the player can inflict

pmmo:effect

Gives the player an effect for a specific time

propertydefaultdescription
effectnoneThe ID of the effect being applied. eg minecraft:slowness
duration100The number of ticks the effect should last per level
per_level1multiplies the level by this value before multiplying by duration
modifier0sets the level of the effect. all effect levels are +1 than their modifier
ambientfalseshould an effect's particles be hidden
visibletrueshould an effect show in the players inventory and hud
max_boostn/athe number of ticks the effect's duration should be limited to
base0A flat amount to add to the duration
show_icontrueif false, hides the icon in the HUD and inventory

pmmo:command

Runs the specified command or function when triggered. Note the Glossary entry for this perk will display the property literally. It is advised to name your functions something intuitive, if using functions.

propertydefaultdescriptionExample
commandnoneRuns a single command linecommand = "give @s minecraft:diamond 10
functionnoneExecutes a function. takes precedence over command if both are presentfunction = "mypack:myfunction"

pmmo:villager_boost

Reduces the villager's trades to post-cured level when interacted with. Only works with the ENTITY event.

propertydefaultdescription
cooldown1000the number of ticks before another villager modification can occur

pmmo:tame_boost

Increases the attributes of the tamed animal. Only works with the TAMING event. Currently, all attributes modified are hardcoded to these values.

attributevalue
jump strength0.005
health1.0
speed0.01
armor0.01
damage0.01
propertydefaultdescription
per_level0.05Each attribute is increased by this value * the skill level * the attribute value above
skilltamingwhich skill affects the animal scaling
max_boost2bilthe maximum any single attribute can be boosted