Skip to main content

Cutgrass

Based on game build 714014 | Last updated: 2026-03-05

Overview

cutgrass is a Prefab that defines a small, stackable item found in the game world, used as food for herbivores (e.g., beefalo), fuel for fire-based constructs (e.g., lightning rod), and a repair material for certain structures. It integrates with multiple core systems: inventory, edible, fuel, repairer, and utility systems like snowmandecor. It is pristined and network-aware, with a client-side-only early return to avoid duplicating work on non-master instances.

Usage example

local cutgrass = SpawnPrefab("cutgrass")
cutgrass.components.stackable:SetSize(5)
cutgrass.components.edible:Eat()
cutgrass.components.fuel:StartBurn()
cutgrass.components.repairer:RepairEntity(target_structure)

Dependencies & tags

Components used: inventoryitem, stackable, edible, inspectable, tradable, fuel, repairer, snowmandecor, and utility functions: MakeInventoryPhysics, MakeInventoryFloatable, MakeSmallBurnable, MakeSmallPropagator, MakeHauntableLaunchAndIgnite.
Tags: cattoy, renewable, cutgrass.

Properties

PropertyTypeDefault ValueDescription
animstate.bankstring"cutgrass"Animation bank name used by the AnimState component.
animstate.buildstring"cutgrass"Build/model name used by the AnimState component.
pickupsoundstring"vegetation_grassy"Sound name played when the item is picked up.
components.stackable.maxsizenumberTUNING.STACK_SIZE_SMALLITEMMaximum stack size for the item.
components.edible.foodtypeFOODTYPEFOODTYPE.ROUGHAGEFood classification for the edible behavior.
components.edible.healthvaluenumberTUNING.HEALING_TINYHealth restored when consumed.
components.edible.hungervaluenumberTUNING.CALORIES_TINY/2Hunger restored when consumed.
components.fuel.fuelvaluenumberTUNING.SMALL_FUELFuel units provided when burned.
components.repairer.healthrepairvaluenumberTUNING.REPAIR_CUTGRASS_HEALTHHealth repaired per use.
components.repairer.repairmaterialMATERIALSMATERIALS.HAYMaterial type used in repair UI and compatibility checks.

Main functions

No custom methods are defined in cutgrass.lua. All functionality is exposed via attached component APIs.

Events & listeners

No direct event listeners or events are pushed by this prefab. It relies on its components to emit and respond to events internally.

Notable external events triggered by consumers of this prefab (e.g., when eaten, burned, or used in repair) follow standard component behavior:

  • edible component may emit oneat and healthdelta events.
  • fuel component emits onignite, onburn, and onextinguish.
  • repairer component emits onrepair when repair is performed. (See components/edible.lua, fuel.lua, repairer.lua for full event lists.)