Skip to content

Alpha Release: Damage Events

Caltinor edited this page Feb 13, 2022 · 1 revision

This is the fifth alpha and revolves around the slew of damage events. Both damage dealt to players and damage dealt by players are captured in this release.

Damage Received Events

Damage received is damage dealt to the player and allows the player to dictate what skills a player should gain experience in when they are damaged. As with any event, this fires an EventTrigger for addons and Perks.

A quick note on perks, this event does provide the "damageIn" float value and accepts an output of "damage".

The events implemented when a player takes damage are

RECEIVE_DAMAGE
FROM_MOBS
FROM_PLAYERS
FROM_ANIMALS
FROM_PROJECTILES
FROM_MAGIC
FROM_ENVIRONMENT
FROM_IMPACT

FROM_MOBS and FROM_ANIMALS

both of these have a special feature related to what classifies an entity as a mob or an animal. There is now two new Entity_Type tags under the pmmo namespace calls "mobs" and "animals" respectively. All members of these tags are considered part of the associated type. Keep this in mind when configuring modded entities as they will not naturally be configured into these types.

you can configure the xp to be gained by an entity in these tags in their respective pmmo configurations under "xp_values" and the event name.

FROM_PLAYERS

captures any damage received from another player, this does capture indirect cases like from arrows and will supersede the FROM_PROJECTILE type. You will need to set up an entity configuration for "minecraft:player" to set xp values for this type.

FROM_ENVIRONMENT

This captures sources like fire, lava, cactii, drowning, sweet berry bushes, and many more damage sources from the environment itself

FROM_IMPACT

This captures damage from collisions: falling, falling on stalagmites, flying into walls

FROM_MAGIC

this is mostly potion sources, but may capture modded sources as well as long as they are using "magic" or "indirectMagic" DamageSources.

FROM_PROJECTILES

This will capture any projectiles that do not have an entity source. it is captured after all other non-generic types have been tested.

RECEIVE_DAMAGE

is the catch-all for damage received by the player. If the source cannot be determined to be captured by another type, this is used.

Configuration

with the exception of mobs, animals, and players, each type is configured universally in the server config. you may set the skill(s) you want to award xp in and a modifier. The modifier multiplies the damage received to give the xp value. All skills listed will be awarded the same XP.

Damage Dealt Events

These events fire when a player deals damage to another entity. As with any event this also fires an EventTrigger and a perk, however this perk does not accept any outputs.

The events which fire are:

DEAL_MELEE_DAMAGE
MELEE_TO_MOBS
MELEE_TO_PLAYERS
MELEE_TO_ANIMALS
DEAL_RANGED_DAMAGE
RANGED_TO_MOBS
RANGED_TO_PLAYERS
RANGED_TO_ANIMALS

Like the damage received event, this event also uses the same tags "pmmo:mobs" and "pmmo:animals" to determine which category the event is. Further, whether the player has dealt melee or ranged damage is also captured. There is no distinction of source though. That is just too convoluted to design for.

DEAL_RANGED_DAMAGE and DEAL_MELEE_DAMAGE

are catch-alls for damage dealt that doesn't get captured by the tags and are configurable in the server config.

Clone this wiki locally