Skip to content

API reference Obsidian.API.Loot.Functions

EnchantRandomlyFunction class

Adds one random enchantment at a random level. A book becomes a single enchanted book.

public sealed class EnchantRandomlyFunction : LootFunction

In Obsidian.API.

Constructors

public EnchantRandomlyFunction();

Properties

IncludeAdditionalCostComponent

public bool IncludeAdditionalCostComponent { get; init; }

Adds a price for the enchantment to a trade selling the stack, when the context allows it (LootContext.AdditionalCostComponentAllowed).

OnlyCompatible

public bool OnlyCompatible { get; init; }

Only picks enchantments that support the item. Books accept any enchantment either way.

Options

public ImmutableArray<EnchantmentDefinition>? Options { get; init; }

The enchantments to pick from; every enchantment when null.

On this page