Table of Contents

Class RandomInventoryItemsBuilder

Namespace
S1API.Entities
Assembly
S1API.dll

Builder for configuring startup items and random cash for NPCs. Public surface uses strings/primitives only. All configurations are optional.

public sealed class RandomInventoryItemsBuilder
Inheritance
RandomInventoryItemsBuilder
Inherited Members
Extension Methods

Methods

WithClearInventoryEachNight(bool)

Configures whether the inventory should be cleared each night. Default: true if only random items are configured, false if startup items are configured (to preserve them).

public RandomInventoryItemsBuilder WithClearInventoryEachNight(bool clearEachNight)

Parameters

clearEachNight bool

If true, inventory is cleared on sleep. If false, items persist across sleep cycles.

Returns

RandomInventoryItemsBuilder

WithRandomCash(int, int)

Enables and configures random cash generation.

public RandomInventoryItemsBuilder WithRandomCash(int min, int max)

Parameters

min int

Minimum cash amount.

max int

Maximum cash amount.

Returns

RandomInventoryItemsBuilder

WithStartupItem(string)

Adds a single startup item that will be present in the NPC's inventory when spawned.

public RandomInventoryItemsBuilder WithStartupItem(string itemId)

Parameters

itemId string

The ID of the item to add.

Returns

RandomInventoryItemsBuilder

WithStartupItems(params string[])

Adds multiple startup items that will be present in the NPC's inventory when spawned.

public RandomInventoryItemsBuilder WithStartupItems(params string[] itemIds)

Parameters

itemIds string[]

Array of item IDs to add.

Returns

RandomInventoryItemsBuilder