Home Commands Examples Getting Started With Scripts Global Keywords

Composter

Importing the class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

script.zs
import crafttweaker.api.misc.Composter;

Methods

Sets the compost value of the given IItemStack.

The amount should be between 0 and 1, anything above 1 would just be wasted.

script.zs
// Composter.setValue(stack as IItemStack, amount as float)
composter.setValue(<item:minecraft:diamond>, 0.85);
ParameterTypeDescription
Parameter
stack
Type
IItemStack
Description
The stack to be compostable
Parameter
amount
Type
float
Description
The amount of Compost that should be added when the item is put in a Composter.