Skip to content

@minecraft/server


@minecraft/server / EnchantWithLevelsFunction

Class: EnchantWithLevelsFunction ​

Defined in: @minecraft/server/index.d.ts:8413

Loot item function that applies a random enchant to the dropped item.

Extends ​

Properties ​

conditions ​

readonly conditions: LootItemCondition[]

Defined in: @minecraft/server/index.d.ts:15793

Inherited from ​

LootItemFunction.conditions


levels ​

readonly levels: NumberRange

Defined in: @minecraft/server/index.d.ts:8422

Remarks ​

The value range from which the function randomly chooses the level of enchantment to apply. Contains minimum and maximum values.


treasure ​

readonly treasure: boolean

Defined in: @minecraft/server/index.d.ts:8429

Remarks ​

Value that determines whether or not treasure enchants should be included in the random enchant selection.