API reference Obsidian.API.Loot.Functions
EnchantWithLevelsFunction class
Enchants the stack like an enchanting table at EnchantWithLevelsFunction.Levels levels. A book becomes a single enchanted book.
public sealed class EnchantWithLevelsFunction : LootFunction
In Obsidian.API.
Constructors
public EnchantWithLevelsFunction();Properties
IncludeAdditionalCostComponent
public bool IncludeAdditionalCostComponent { get; init; }Adds the levels to the price of a trade selling the stack, when the context allows it (LootContext.AdditionalCostComponentAllowed).
public required INumberProvider Levels { get; init; }Options
public ImmutableArray<EnchantmentDefinition>? Options { get; init; }The enchantments to pick from; every enchantment when null.