Skip to content

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 ​

readonly addMultipliedBase: number

Defined in: packages/prismarine/src/enchantment/attributes.ts:24

add_multiplied_base: a fraction of the base, added after every add_value.

addMultipliedTotal ​

readonly addMultipliedTotal: number

Defined in: packages/prismarine/src/enchantment/attributes.ts:26

add_multiplied_total: a fraction of the running total, applied last.

addValue ​

readonly addValue: 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 ​

EnchantmentRegistry

stack ​

ItemStack

attribute ​

string

A namespaced attribute id, for example minecraft:mining_efficiency.

Returns ​

AttributeContribution


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 ​

EnchantmentRegistry

stack ​

ItemStack

attribute ​

string

base ​

number

Returns ​

number