Item Drops

API Reference

Welcome to the complete API reference for the Item Drops plugin. This section provides detailed documentation for all classes, interfaces, and methods available in the plugin.

🔗 Core API

LootGenerator

The main class for generating item drops based on drop tables and context.

DropTable

Configuration class that defines possible drops and their probabilities.

DropContext

Contextual data that influences drop generation (player level, luck, location, etc.).

📋 Interfaces

ILootGenerator

Interface for implementing custom loot generation logic.

IDrop

Interface for defining individual drop items.

IItemProvider

Interface for connecting to item databases.

🔧 Modifiers

LuckModifier

Modifies drop chances based on luck factors.

LevelBonusModifier

Increases drop quantities based on player level.

RarityFilterModifier

Filters drops by minimum rarity level.

📊 Data Structures

DropResult

Contains information about generated drops.

ItemData

Item definition and properties.

DropInstance

Runtime representation of a drop.

🎯 Schema Documentation

Configuration Schema

Complete schema reference for drop table configuration files.

🔍 Quick API Examples

Basic Usage

using ItemDrops.Core.Generation;
using ItemDrops.Core.Types;

// Create generator
var generator = new LootGenerator();

// Set up context
var context = new DropContext();
context.SetData("PlayerLevel", 10);
context.SetData("LuckModifier", 1.2f);

// Generate drops
var drops = generator.GenerateLoot(dropTable, context);

Advanced Usage

// Add modifiers
generator.AddModifier(new LuckModifier(1.5f));
generator.AddModifier(new LevelBonusModifier(20, 1.3f));

// Generate with guaranteed drops
var allDrops = generator.GenerateLootWithGuaranteed(
    dropTables, 
    guaranteedDrops, 
    context
);

Looking for something specific? Check the Schema Documentation for configuration details or Examples for practical usage.