API reference / @jsprismarine/prismarine / enchantment/attributes
enchantment/attributes
Interfaces
AttributeContribution
Defined in: packages/prismarine/src/enchantment/attributes.ts:20
The three operations an attribute modifier can use, summed separately.
Properties
addMultipliedBase
readonlyaddMultipliedBase:number
Defined in: packages/prismarine/src/enchantment/attributes.ts:24
add_multiplied_base: a fraction of the base, added after every add_value.
addMultipliedTotal
readonlyaddMultipliedTotal:number
Defined in: packages/prismarine/src/enchantment/attributes.ts:26
add_multiplied_total: a fraction of the running total, applied last.
addValue
readonlyaddValue:number
Defined in: packages/prismarine/src/enchantment/attributes.ts:22
add_value: added straight onto the base.
Functions
attributeContributionOf()
attributeContributionOf(
registry,stack,attribute):AttributeContribution
Defined in: packages/prismarine/src/enchantment/attributes.ts:37
What one stack's enchantments contribute to one attribute.
Parameters
registry
stack
attribute
string
A namespaced attribute id, for example minecraft:mining_efficiency.
Returns
attributeValueOf()
attributeValueOf(
registry,stack,attribute,base):number
Defined in: packages/prismarine/src/enchantment/attributes.ts:64
One attribute's value with a stack's enchantments applied, in Java's order: every add_value, then every add_multiplied_base against the original base, then every add_multiplied_total against the running total.
Parameters
registry
stack
attribute
string
base
number
Returns
number