Search Results for

    Show / Hide Table of Contents

    Class Item

    A wrapper class for InventorySystem.Items.ItemBase.

    Inheritance
    System.Object
    TypeCastObject<Item>
    Item
    Ammo
    Armor
    Firearm
    Flashlight
    Jailbird
    Keycard
    MicroHid
    Radio
    Throwable
    Usable
    Implements
    IWrapper<InventorySystem.Items.ItemBase>
    Inherited Members
    TypeCastObject<Item>.Cast<TObject>()
    TypeCastObject<Item>.Cast<TObject>(TObject)
    TypeCastObject<Item>.As<TObject>()
    TypeCastObject<Item>.Is<TObject>(TObject)
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Exiled.API.Features.Items
    Assembly: Exiled.API.dll
    Syntax
    public class Item : TypeCastObject<Item>, IWrapper<ItemBase>

    Constructors

    | Improve this Doc View Source

    Item(ItemBase)

    Initializes a new instance of the Item class.

    Declaration
    public Item(ItemBase itemBase)
    Parameters
    Type Name Description
    InventorySystem.Items.ItemBase itemBase

    The InventorySystem.Items.ItemBase to encapsulate.

    Properties

    | Improve this Doc View Source

    Base

    Gets the InventorySystem.Items.ItemBase of the item.

    Declaration
    public ItemBase Base { get; }
    Property Value
    Type Description
    InventorySystem.Items.ItemBase
    | Improve this Doc View Source

    Category

    Gets the ItemCategory of the item.

    Declaration
    public ItemCategory Category { get; }
    Property Value
    Type Description
    ItemCategory
    | Improve this Doc View Source

    IsAmmo

    Gets a value indicating whether or not this item is ammunition.

    Declaration
    public bool IsAmmo { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsArmor

    Gets a value indicating whether or not this item is armor.

    Declaration
    public bool IsArmor { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsConsumable

    Gets a value indicating whether or not this item will be destroy when being used.

    Declaration
    public bool IsConsumable { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsDisarmer

    Gets a value indicating whether or not this item can be used to disarm players.

    Declaration
    public bool IsDisarmer { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsInInventory

    Gets a value indicating whether if the item are in an inventory.

    Declaration
    public bool IsInInventory { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsKeycard

    Gets a value indicating whether or not this item is a keycard.

    Declaration
    public bool IsKeycard { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsLightEmitter

    Gets a value indicating whether or not this item emits light.

    Declaration
    public bool IsLightEmitter { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsThrowable

    Gets a value indicating whether or not this item is a throwable item.

    Declaration
    public bool IsThrowable { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsUsable

    Gets a value indicating whether or not this item can be used by a player.

    Declaration
    public bool IsUsable { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsWeapon

    Gets a value indicating whether or not this item is a weapon.

    Declaration
    public bool IsWeapon { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    List

    Gets a list of all Item's on the server.

    Declaration
    public static IEnumerable<Item> List { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<Item>
    | Improve this Doc View Source

    Owner

    Gets the Player who owns the item.

    Declaration
    public Player Owner { get; }
    Property Value
    Type Description
    Player
    | Improve this Doc View Source

    Scale

    Gets or sets the scale for the item.

    Declaration
    public Vector3 Scale { get; set; }
    Property Value
    Type Description
    UnityEngine.Vector3
    | Improve this Doc View Source

    Serial

    Gets or sets the unique serial number for the item.

    Declaration
    public ushort Serial { get; set; }
    Property Value
    Type Description
    System.UInt16
    | Improve this Doc View Source

    TierFlags

    Gets the ItemTierFlags of the item.

    Declaration
    public ItemTierFlags TierFlags { get; }
    Property Value
    Type Description
    ItemTierFlags
    | Improve this Doc View Source

    Type

    Gets the ItemType of the item.

    Declaration
    public ItemType Type { get; }
    Property Value
    Type Description
    ItemType
    | Improve this Doc View Source

    Weight

    Gets the Weight of the item.

    Declaration
    public float Weight { get; }
    Property Value
    Type Description
    System.Single

    Methods

    | Improve this Doc View Source

    ChangeItemOwner(Player, Player)

    Changes the owner of the Item.

    Declaration
    public void ChangeItemOwner(Player oldOwner, Player newOwner)
    Parameters
    Type Name Description
    Player oldOwner

    Old Item owner.

    Player newOwner

    New Item owner.

    | Improve this Doc View Source

    Clone()

    Clones the current item with a different serial.

    Declaration
    public virtual Item Clone()
    Returns
    Type Description
    Item

    Cloned item object.

    | Improve this Doc View Source

    Create(ItemType, Player)

    Creates a new Item with the proper inherited subclass.

    Based on the type, the returned Item can be casted into a subclass to gain more control over the object.
    - Usable items (Adrenaline, Medkit, Painkillers, SCP-207, SCP-268, and SCP-500) should be casted to the Usable class.
    - All valid ammo should be casted to the Ammo class.
    - All valid firearms (not including the Micro HID) should be casted to the Firearm class.
    - All valid keycards should be casted to the Keycard class.
    - All valid armor should be casted to the Armor class.
    - Explosive grenades and SCP-018 should be casted to the ExplosiveGrenade class.
    - Flash grenades should be casted to the FlashGrenade class.


    The following have their own respective classes:
    - Flashlights can be casted to Flashlight.
    - Radios can be casted to Radio.
    - The Micro HID can be casted to MicroHid.
    - SCP-244 A and B variants can be casted to Scp244.
    - SCP-330 can be casted to Scp330.
    - SCP-2176 can be casted to the Scp2176 class.
    - SCP-1576 can be casted to the Scp1576 class.
    - Jailbird can be casted to the Jailbird class.

    Items that are not listed above do not have a subclass, and can only use the base Item class.

    Declaration
    public static Item Create(ItemType type, Player owner = null)
    Parameters
    Type Name Description
    ItemType type

    The ItemType of the item to create.

    Player owner

    The Player who owns the item by default.

    Returns
    Type Description
    Item

    The Item created. This can be cast as a subclass.

    | Improve this Doc View Source

    CreatePickup(Vector3, Quaternion, Boolean)

    Creates the Pickup that based on this Item.

    Declaration
    public virtual Pickup CreatePickup(Vector3 position, Quaternion rotation = default(Quaternion), bool spawn = true)
    Parameters
    Type Name Description
    UnityEngine.Vector3 position

    The location to spawn the item.

    UnityEngine.Quaternion rotation

    The rotation of the item.

    System.Boolean spawn

    Whether the Pickup should be initially spawned.

    Returns
    Type Description
    Pickup

    The created Pickup.

    | Improve this Doc View Source

    Destroy()

    Destroy this item.

    Declaration
    public void Destroy()
    | Improve this Doc View Source

    Get(ItemBase)

    Gets an existing Item or creates a new instance of one.

    Declaration
    public static Item Get(ItemBase itemBase)
    Parameters
    Type Name Description
    InventorySystem.Items.ItemBase itemBase

    The InventorySystem.Items.ItemBase to convert into an item.

    Returns
    Type Description
    Item

    The item wrapper for the given InventorySystem.Items.ItemBase.

    | Improve this Doc View Source

    Get(UInt16)

    Gets the Item belonging to the specified serial.

    Declaration
    public static Item Get(ushort serial)
    Parameters
    Type Name Description
    System.UInt16 serial

    The Item serial.

    Returns
    Type Description
    Item

    Returns the Item found or null if not found.

    | Improve this Doc View Source

    Give(Player)

    Gives this item to a Player.

    Declaration
    public void Give(Player player)
    Parameters
    Type Name Description
    Player player

    The Player to give the item to.

    | Improve this Doc View Source

    ToString()

    Returns the Item in a human readable format.

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    A string containing Item-related data.

    Overrides
    System.Object.ToString()

    Implements

    IWrapper<T>

    Extension Methods

    ReflectionExtensions.CopyProperties(Object, Object)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX