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