sm.item
Allows checking for static infortmation about items.
Constants
| Name | Type | Description |
|---|---|---|
trackingType |
table | The item tracking types list. |
trackingType
Value type: table
Item tracking filter types
{
mainQuest,
sideQuest,
researchable,
}
Server + Client
getBuoyancyRating
sm.item.getBuoyancyRating( uuid )
Returns the buoyancy rating of an item.
Parameters:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | The item uuid. |
Returns:
| Type | Description |
|---|---|
| integer | The buoyancy. |
getCharacterShape
sm.item.getCharacterShape( uuid )
Return the data for the character Shape.
Parameters:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | The shape uuid. |
Returns:
| Type | Description |
|---|---|
| table | The character shape data. |
getDensityRating
sm.item.getDensityRating( uuid )
Returns the density rating of an item.
Parameters:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | The item uuid. |
Returns:
| Type | Description |
|---|---|
| integer | The density. |
getDurabilityRating
sm.item.getDurabilityRating( uuid )
Returns the durability rating of an item.
Parameters:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | The item uuid. |
Returns:
| Type | Description |
|---|---|
| integer | The durability. |
getEdible
sm.item.getEdible( uuid )
Return the data for the edible Shape.
Parameters:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | The shape uuid. |
Returns:
| Type | Description |
|---|---|
| table | The edible data. |
getFeatureData
sm.item.getFeatureData( uuid )
Returns the shapes feature data.
Parameters:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | The item uuid. |
Returns:
| Type | Description |
|---|---|
| table | The feature data table |
getFrictionRating
sm.item.getFrictionRating( uuid )
Returns the friction rating of an item.
Parameters:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | The item uuid. |
Returns:
| Type | Description |
|---|---|
| integer | The friction. |
getInteractablesUuidsOfType
sm.item.getInteractablesUuidsOfType( interactableType )
Returns a table of all interactable uuids of a interactable type
Parameters:
| Name | Type | Description |
|---|---|---|
interactableType |
string | The interactable type name |
Returns:
getMaterial
sm.item.getMaterial( uuid )
Returns the material of a shape uuid.
Parameters:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | The uuid of the shape. |
Returns:
| Type | Description |
|---|---|
| string | The shape's material. |
getMaterialId
sm.item.getMaterialId( uuid )
Returns the material id of a shape uuid.
Parameters:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | The uuid of the shape. |
Returns:
| Type | Description |
|---|---|
| integer | The shape's material id. |
getPlantable
sm.item.getPlantable( uuid )
Return the data for the plantable Shape.
Parameters:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | The shape uuid. |
Returns:
| Type | Description |
|---|---|
| table | The plantable data. |
getPlantableUuids
sm.item.getPlantableUuids( )
Returns a table of all plantable uuids.
Returns:
getQualityLevel
sm.item.getQualityLevel( uuid )
Return the quality level for the Shape.
Parameters:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | The shape uuid. |
Returns:
| Type | Description |
|---|---|
| integer | The quality level. |
getShapeDefaultColor
sm.item.getShapeDefaultColor( uuid )
Returns the default color of a shape
Parameters:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | The item uuid. |
Returns:
| Type | Description |
|---|---|
| Color | Color of the shape. |
getShapeOffset
sm.item.getShapeOffset( uuid )
Return the Shape offset
Parameters:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | The shape uuid. |
Returns:
| Type | Description |
|---|---|
| Vec3 | The offset vector. |
getShapeRotation
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:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | The shape uuid. |
rotationIndex (optional) |
integer | The rotation index to get the rotation for. (Defaults to 0) |
localNormal (optional) |
Vec3 | The local space normal the is considered to be placed on. (Defaults to positive Z axis) |
Returns:
| Type | Description |
|---|---|
| Quat | The local shape rotation. |
getShapeSize
sm.item.getShapeSize( uuid )
Returns the block dimensions of an shape. Returns nil if the uuid is not an item.
Parameters:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | The item uuid. |
Returns:
| Type | Description |
|---|---|
| Vec3 | Size of the shape. |
getStackSize
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:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | The item uuid. |
Returns:
| Type | Description |
|---|---|
| integer | The stack size. |
isBlock
sm.item.isBlock( uuid )
Check if the item is a block.
Parameters:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | The item uuid. |
Returns:
| Type | Description |
|---|---|
| boolean | True if the item is a block. |
isFlammable
sm.item.isFlammable( uuid )
Returns whether the item is flammable.
Parameters:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | The item uuid. |
Returns:
| Type | Description |
|---|---|
| boolean | True if flammable. |
isHarvestablePart
sm.item.isHarvestablePart( uuid )
Return whether the Shape uuid belongs to a harvestable shape.
Parameters:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | The shape uuid. |
Returns:
| Type | Description |
|---|---|
| boolean | True if shape is a harvestable shape. |
isJoint
sm.item.isJoint( uuid )
Check if the item is a Joint.
Parameters:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | The item uuid. |
Returns:
| Type | Description |
|---|---|
| boolean | True if the item is a joint. |
isPart
sm.item.isPart( uuid )
Check if the item is a part.
Parameters:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | The item uuid. |
Returns:
| Type | Description |
|---|---|
| boolean | True if the item is a part. |
isTool
sm.item.isTool( uuid )
Check if the item uuid belongs to a Tool.
Parameters:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | The uuid. |
Returns:
| Type | Description |
|---|---|
| boolean | True if the item uuid belongs to a tool. |
Client-only
addTrackedItem
sm.item.addTrackedItem( uuid, type )
Adds a shape uuid to be a tracked item.
Parameters:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | The uuid of the shape. |
type |
integer | The sm.item.trackingType. |
removeTrackedItem
sm.item.removeTrackedItem( uuid, type )
Removes a shape uuid from the tracked items.
Parameters:
| Name | Type | Description |
|---|---|---|
uuid |
Uuid | The uuid of the shape. |
type |
integer | The sm.item.trackingType. |