API reference / @jsprismarine/prismarine / enchantment/mitigation
enchantment/mitigation
Interfaces
MitigationInput
Defined in: packages/prismarine/src/enchantment/mitigation.ts:27
Everything the protection total is worked out from.
Properties
content
readonlycontent:ServerContent|undefined
Defined in: packages/prismarine/src/enchantment/mitigation.ts:29
The content build, or undefined when the server has none.
equipment
readonlyequipment:ViewableEquipment
Defined in: packages/prismarine/src/enchantment/mitigation.ts:33
What the victim is wearing and holding.
source
readonlysource:LootKill
Defined in: packages/prismarine/src/enchantment/mitigation.ts:35
What hit them, which is what Fire Protection and Feather Falling branch on.
victim
readonlyvictim:ViewableEntity
Defined in: packages/prismarine/src/enchantment/mitigation.ts:31
Who is being hit, which is this_entity for every damage_protection condition.
Functions
enchantedDamageContext()
enchantedDamageContext(
input):EnchantedDamageContext|undefined
Defined in: packages/prismarine/src/enchantment/mitigation.ts:72
The enchanted_damage context one blow evaluates in.
Undefined when the damage source has nothing on record, because the key set requires damage_source and a condition that reads a missing required parameter reports rather than quietly matching.
Parameters
input
Returns
EnchantedDamageContext | undefined
enchantmentProtection()
enchantmentProtection(
input):number
Defined in: packages/prismarine/src/enchantment/mitigation.ts:46
The Enchantment Protection Factor of everything worn, against one blow.
Parameters
input
Returns
number
The factor, which the damage formula caps at 20 out of 25.