-
Notifications
You must be signed in to change notification settings - Fork 22
Alpha Release: Damage Events
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 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
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.
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.
This captures sources like fire, lava, cactii, drowning, sweet berry bushes, and many more damage sources from the environment itself
This captures damage from collisions: falling, falling on stalagmites, flying into walls
this is mostly potion sources, but may capture modded sources as well as long as they are using "magic" or "indirectMagic" DamageSource
s.
This will capture any projectiles that do not have an entity source. it is captured after all other non-generic types have been tested.
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.
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.
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.
are catch-alls for damage dealt that doesn't get captured by the tags and are configurable in the server config.