Table of Contents

Class ItemCreator

Namespace
S1API.Items
Assembly
S1API.dll

Provides convenient static methods for creating custom items. Use CreateBuilder() for flexible configuration or CreateItem(string, string, string, ItemCategory, int, float, float, LegalStatus, bool, FullRank?, Sprite, Equippable) for quick creation.

[Obsolete("Use S1API.Items.Storable.ItemCreator instead")]
public static class ItemCreator
Inheritance
ItemCreator
Inherited Members

Remarks

All items in Schedule One are storable items (StorableItemDefinition), so both methods create the same type.

Methods

CloneFrom(StorableItemDefinition)

Creates a new storable item builder by cloning an existing storable item wrapper.

public static StorableItemDefinitionBuilder CloneFrom(StorableItemDefinition source)

Parameters

source StorableItemDefinition

The storable item definition to clone.

Returns

StorableItemDefinitionBuilder

A builder pre-configured with the source item properties.

Exceptions

ArgumentNullException

Thrown if the source definition is null.

CloneFrom(string)

Creates a new storable item builder by cloning an existing item by ID.

public static StorableItemDefinitionBuilder CloneFrom(string sourceItemId)

Parameters

sourceItemId string

The ID of the item to clone.

Returns

StorableItemDefinitionBuilder

A builder pre-configured with the source item properties.

Exceptions

ArgumentException

Thrown if the source item ID is not found or is not a storable item.

CreateBuilder()

Creates a new builder for composing an item definition with full flexibility. Use fluent methods to configure the item, then call Build() to register it.

public static StorableItemDefinitionBuilder CreateBuilder()

Returns

StorableItemDefinitionBuilder

A new StorableItemDefinitionBuilder instance for fluent configuration.

Examples

var item = ItemCreator.CreateBuilder()
    .WithBasicInfo("my_tool", "Custom Tool", "A custom tool", ItemCategory.Tools)
    .WithStackLimit(5)
    .WithPricing(25f, 0.3f)
    .Build();

CreateEquippableBuilder()

Creates a new equippable builder for creating custom equippable components. Use this to create equippable behavior that can be attached to items.

public static EquippableBuilder CreateEquippableBuilder()

Returns

EquippableBuilder

A new EquippableBuilder instance.

Examples

var equippable = ItemCreator.CreateEquippableBuilder()
    .CreateBasicEquippable("MyEquippable")
    .WithInteraction(canInteract: true, canPickup: true)
    .Build();

CreateItem(string, string, string, ItemCategory, int, float, float, LegalStatus, bool, FullRank?, Sprite, Equippable)

Creates an item with common parameters in a single call. The item is automatically registered with the game's registry.

public static StorableItemDefinition CreateItem(string id, string name, string description, ItemCategory category, int stackLimit = 10, float basePurchasePrice = 10, float resellMultiplier = 0.5, LegalStatus legalStatus = LegalStatus.Legal, bool requiresLevelToPurchase = false, FullRank? requiredRank = null, Sprite icon = null, Equippable equippable = null)

Parameters

id string

Unique identifier for the item (e.g., "my_custom_tool").

name string

Display name shown in UI.

description string

Item description shown in tooltips.

category ItemCategory

Item category for inventory organization.

stackLimit int

Maximum quantity per inventory slot (default: 10).

basePurchasePrice float

Base price when buying from shops (default: 10).

resellMultiplier float

Fraction of purchase price recovered when selling (default: 0.5).

legalStatus LegalStatus

Whether the item is legal or illegal (default: Legal).

requiresLevelToPurchase bool

Whether purchasing the item requires a certain player rank (default: false).

requiredRank FullRank?

The player rank required to purchase the item, if applicable (default: null).

icon Sprite

Optional sprite to use as the item icon.

equippable Equippable

Optional equippable component to attach.

Returns

StorableItemDefinition

A wrapper around the created item definition.

Examples

var item = ItemCreator.CreateItem(
    id: "my_tool",
    name: "Custom Tool",
    description: "A custom tool for crafting",
    category: ItemCategory.Tools,
    stackLimit: 5,
    basePurchasePrice: 25f
);