sm.item

Allows checking for static infortmation about items.

Constants:

Functions:

  • addTrackedItem
  • getBuoyancyRating
  • getCharacterShape
  • getDensityRating
  • getDurabilityRating
  • getEdible
  • getFeatureData
  • getFrictionRating
  • getInteractablesUuidsOfType
  • getMaterial
  • getMaterialId
  • getPlantable
  • getPlantableUuids
  • getQualityLevel
  • getShapeDefaultColor
  • getShapeOffset
  • getShapeRotation
  • getShapeSize
  • getStackSize
  • isBlock
  • isFlammable
  • isHarvestablePart
  • isJoint
  • isPart
  • isTool
  • removeTrackedItem

  • sm.item.trackingType table

    Item tracking filter types

    mainQuest
    sideQuest
    researchable

    sm.item.addTrackedItem(uuid, type)

    Client only

    Adds a shape uuid to be a tracked item.

    Parameters:

    TypeNameDescription
    UuiduuidThe uuid of the shape.
    integertypeThe sm.item.trackingType.

    sm.item.getBuoyancyRating(uuid)

    Returns the buoyancy rating of an item.

    Parameters:

    TypeNameDescription
    UuiduuidThe item uuid.

    Returns:

    TypeDescription
    integerThe buoyancy.

    sm.item.getCharacterShape(uuid)

    Return the data for the character Shape.

    Parameters:

    TypeNameDescription
    UuiduuidThe shape uuid.

    Returns:

    TypeDescription
    tableThe character shape data.

    sm.item.getDensityRating(uuid)

    Returns the density rating of an item.

    Parameters:

    TypeNameDescription
    UuiduuidThe item uuid.

    Returns:

    TypeDescription
    integerThe density.

    sm.item.getDurabilityRating(uuid)

    Returns the durability rating of an item.

    Parameters:

    TypeNameDescription
    UuiduuidThe item uuid.

    Returns:

    TypeDescription
    integerThe durability.

    sm.item.getEdible(uuid)

    Return the data for the edible Shape.

    Parameters:

    TypeNameDescription
    UuiduuidThe shape uuid.

    Returns:

    TypeDescription
    tableThe edible data.

    sm.item.getFeatureData(uuid)

    Returns the shapes feature data.

    Parameters:

    TypeNameDescription
    UuiduuidThe item uuid.

    Returns:

    TypeDescription
    tableThe feature data table

    sm.item.getFrictionRating(uuid)

    Returns the friction rating of an item.

    Parameters:

    TypeNameDescription
    UuiduuidThe item uuid.

    Returns:

    TypeDescription
    integerThe friction.

    sm.item.getInteractablesUuidsOfType(interactableType)

    Returns a table of all interactable uuids of a interactable type

    Parameters:

    TypeNameDescription
    stringinteractableTypeThe interactable type name

    Returns:

    TypeDescription
    tabletable of interactable uuids {Uuid, ..}

    sm.item.getMaterial(uuid)

    Returns the material of a shape uuid.

    Parameters:

    TypeNameDescription
    UuiduuidThe uuid of the shape.

    Returns:

    TypeDescription
    stringThe shape's material.

    sm.item.getMaterialId(uuid)

    Returns the material id of a shape uuid.

    Parameters:

    TypeNameDescription
    UuiduuidThe uuid of the shape.

    Returns:

    TypeDescription
    integerThe shape's material id.

    sm.item.getPlantable(uuid)

    Return the data for the plantable Shape.

    Parameters:

    TypeNameDescription
    UuiduuidThe shape uuid.

    Returns:

    TypeDescription
    tableThe plantable data.

    sm.item.getPlantableUuids()

    Returns a table of all plantable uuids.

    Returns:

    TypeDescription
    tabletable of all plantable uuids {Uuid, ..}.

    sm.item.getQualityLevel(uuid)

    Return the quality level for the Shape.

    Parameters:

    TypeNameDescription
    UuiduuidThe shape uuid.

    Returns:

    TypeDescription
    integerThe quality level.

    sm.item.getShapeDefaultColor(uuid)

    Returns the default color of a shape

    Parameters:

    TypeNameDescription
    UuiduuidThe item uuid.

    Returns:

    TypeDescription
    ColorColor of the shape.

    sm.item.getShapeOffset(uuid)

    Return the Shape offset

    Parameters:

    TypeNameDescription
    UuiduuidThe shape uuid.

    Returns:

    TypeDescription
    Vec3The offset vector.

    sm.item.getShapeRotation(uuid, rotationIndex?, localNormal?)

    Gets the shape local rotation given a shape rotation index and a surface normal in local space (unit axis vector).

    Parameters:

    TypeNameDescription
    UuiduuidThe shape uuid.
    integerrotationIndex?The rotation index to get the rotation for. (Defaults to 0)
    Vec3localNormal?The local space normal the is considered to be placed on. (Defaults to positive Z axis)

    Returns:

    TypeDescription
    QuatThe local shape rotation.

    sm.item.getShapeSize(uuid)

    Returns the block dimensions of an shape. Returns nil if the uuid is not an item.

    Parameters:

    TypeNameDescription
    UuiduuidThe item uuid.

    Returns:

    TypeDescription
    Vec3Size of the shape.

    sm.item.getStackSize(uuid)

    Return the stack size for the item. Returns the default stack size of 1 if the item is not found or is a Tool.

    Parameters:

    TypeNameDescription
    UuiduuidThe item uuid.

    Returns:

    TypeDescription
    integerThe stack size.

    sm.item.isBlock(uuid)

    Check if the item is a block.

    Parameters:

    TypeNameDescription
    UuiduuidThe item uuid.

    Returns:

    TypeDescription
    booleanTrue if the item is a block.

    sm.item.isFlammable(uuid)

    Returns whether the item is flammable.

    Parameters:

    TypeNameDescription
    UuiduuidThe item uuid.

    Returns:

    TypeDescription
    booleanTrue if flammable.

    sm.item.isHarvestablePart(uuid)

    Return whether the Shape uuid belongs to a harvestable shape.

    Parameters:

    TypeNameDescription
    UuiduuidThe shape uuid.

    Returns:

    TypeDescription
    booleanTrue if shape is a harvestable shape.

    sm.item.isJoint(uuid)

    Check if the item is a Joint.

    Parameters:

    TypeNameDescription
    UuiduuidThe item uuid.

    Returns:

    TypeDescription
    booleanTrue if the item is a joint.

    sm.item.isPart(uuid)

    Check if the item is a part.

    Parameters:

    TypeNameDescription
    UuiduuidThe item uuid.

    Returns:

    TypeDescription
    booleanTrue if the item is a part.

    sm.item.isTool(uuid)

    Check if the item uuid belongs to a Tool.

    Parameters:

    TypeNameDescription
    UuiduuidThe uuid.

    Returns:

    TypeDescription
    booleanTrue if the item uuid belongs to a tool.

    sm.item.removeTrackedItem(uuid, type)

    Client only

    Removes a shape uuid from the tracked items.

    Parameters:

    TypeNameDescription
    UuiduuidThe uuid of the shape.
    integertypeThe sm.item.trackingType.