Inventool Documentation
  • Inventool Documentation
  • đŸ•šī¸Quick Start
    • Installation
    • Start Creating
  • 💡General
    • Running the Demo
    • Menu Options
    • UI Updates
    • UI Customizations
      • uGUI
      • UI Toolkit
    • Custom Item Drops
  • 🎓Tutorials
    • Demo Walkthrough
  • âœī¸Editors
    • Inventool
      • Inventory
      • Equipment
      • Items
      • Currencies
      • Crafting
      • Dismantling
      • Enchanting
      • Stats
        • Stat IDs
        • Attributes
      • Settings
    • Item Type Manager
    • Localization Editor
    • Stats Editor
    • Merchants
      • Shopkeeper
      • Craftsman
      • Enchanter
    • Storage
    • Loot
      • Loot Box
      • Item Pouch
      • Currency Pouch
    • Components
      • Initializer
      • UI
        • uGUI
          • Inventool Window
          • Split UI
            • Inventory Window UGUI
            • Equipment Window UGUI
            • Key Items Window UGUI
            • Crafting Window UGUI
            • Enchanting Window UGUI
            • Storage Window UGUI
            • Shop Window UGUI
            • Selector UGUI
          • Action Menu UGUI
          • Hover Details UGUI
          • Confirm Prompt UGUI
          • Quantity Prompt UGUI
          • Character Viewer Element UGUI
        • UI Toolkit
          • Inventool Window
          • Split UI
            • Inventory Window
            • Equipment Window
            • Key Items Window
            • Crafting Window
            • Enchanting Window
            • Storage Window
            • Shop Window
          • Action Menu
          • Hover Details
          • Confirm Prompt
          • Quantity Prompt
        • Character Viewer
      • Overworld Merchant
      • Storage Keeper
      • Item Drop
      • Item Spawner
      • Input
        • Cross Input Support
        • Cross Input Support UGUI
          • Target Selectable
  • 📄Scripting API
    • Initialization
    • Inventory
    • Equipment
      • Equipment Slot
    • Items
      • Item
      • Item Type
      • Item Stack
      • Item Drop
      • Item Spawner
      • Loot Box
      • Item Pouch
    • Currencies
      • Currency Identity
      • Currency
        • Value
      • Currency Pouch
    • Crafting
      • Craft
      • Crafter
    • Enchanting
      • Enchantment
    • Stats
      • Stat Identity
      • Attribute
      • Stat
        • Stat Value
          • Value
        • Effectiveness
      • Stat Profile
    • Storing
      • Storage
      • Storage Keeper
    • Settings
    • Merchants
      • Shopkeeper
      • Craftsman
      • Enchanter
      • Overworld Merchant
    • UI
      • uGUI
        • Inventool Window UGUI
        • Split UI
          • Draggable Window UGUI
            • Inventory Window UGUI
            • Equipment Window UGUI
            • Key Items Window UGUI
            • Crafting Window UGUI
            • Enchanting Window UGUI
            • Storage Window UGUI
            • Shop Window UGUI
          • Selector UGUI
        • Action Menu UGUI
        • Hover Details UGUI
        • Confirm Prompt UGUI
        • Quantity Prompt UGUI
        • Draggable Element UGUI
          • Equipment Slot Element UGUI
          • Item Slot Element UGUI
          • Item Stack Element UGUI
        • Action Menu Option UGUI
        • Currency Element UGUI
        • Inventory Filter UGUI
        • Inventory Slot UGUI
        • Key Item Element UGUI
        • Shop Item Element UGUI
        • Storage Currency Element UGUI
        • Stat Element UGUI
      • UI Toolkit
        • Inventool Window
        • Split UI
          • Draggable Window
            • Inventory Window
            • Equipment Window
            • Key Items Window
            • Crafting Window
            • Enchanting Window
            • Storage Window
            • Shop Window
        • Action Menu
        • Hover Details
        • Confirm Prompt
        • Quantity Prompt
        • Item Elements
          • Item Stack Element
          • Equipment Slot Element
          • Item Slot Element
          • Shop Item Element
      • Action Menu Option
      • Character Viewer
    • Events
    • Sounds
    • Saving & Loading
      • Inventory & Equipment
      • Storage
    • Input
      • Cross Input Support
      • Cross Input Support UGUI
    • Localization
      • Localization Settings
      • Localizer
  • đŸ› ī¸Support
    • Getting Help
  • 📚Changelogs
    • Latest Releases
    • Future Plans
  • ⭐Rate Me?
Powered by GitBook
On this page
  • Fields & Properties
  • Enchantment Mode
  • Creating Item Types
  • Getting Item Types
  • Single Item Type
  • Get All Item Types
  • Get All Parent Item Types
  1. Scripting API
  2. Items

Item Type

Scripting with the ItemType class.

An ItemType is a type of an item. Item types are used to set commonalities of a group of items and are also useful for filtering items in the inventory.

Fields & Properties

Name
Description
Type
Access

id

The unique ID of this item type.

int

public

displayName

The display name of this type that will be displayed in-game.

string

public

localizedDisplayNameKey

The key of the localized display name string.

string

public

icon

The item type icon that will be displayed in the inventory filter list.

Sprite

public

iconColorTint

The color tint of the icon.

Color

public

parent

The parent item type. This will be null if the item type is not a subtype.

ItemType

public

enchantmentMode

The enchantment mode of this item type.

EnchantmentMode

public

sortingOrder

The order in which the item type option will appear in the inventory. Lower values will appear first.

int

public

equippable

If this item type should support equipping.

bool

public

consumable

If this item type should support consuming.

bool

public

stackable

If stacking is possible for items of this type.

bool

public

droppable

If the player can manually drop items of this type.

bool

public

sellable

If items of this type can be sold in market places.

bool

public

IsSubtype

If this is a subtype of another.

bool

public

Enchantment Mode

EnchantmentMode is an enum that sets the enchantment rule for the items of the item type.

Name
Description

None

Items of this type cannot be enchanted or be used for enchanting.

Enchantable

Items of this type can be enchanted.

Enchanter

Items of this type can be used for enchanting.

Creating Item Types

It's not at all recommended to create item types at runtime, but it is possible. Item types are scriptable objects which cannot be created as assets at runtime for later use. You would need to load your generated item types on your own.

ItemType myItemType = ScriptableObject.CreateInstance<ItemType>();

Item type IDs must be unique. When creating item types from the Item Type Manager, unique IDs are set automatically. However, this is not done when creating item types at runtime. You'd need to create your own method of ensuring IDs of generated item types are unique.

Getting Item Types

Single Item Type

You can get item types by their name or ID with the GetItemType method.

ItemType myItemType = Inventool.GetItemType("My Item Type Name");

Get All Item Types

var itemTypes = Inventool.GetAllItemTypes();

Get All Parent Item Types

var itemTypes = Inventool.GetAllParentItemTypes();

Get All Sub Item Types

var itemTypes = Inventool.GetAllSubItemTypes();
PreviousItemNextItem Stack

Last updated 3 months ago

📄