ItemCost
Importing the class
If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.
import crafttweaker.api.villager.ItemCost;
Members
components() as DataComponentPredicate
Getter
// ItemCost.count as intmyItemCost.count
Return Type:
int
Getter
// ItemCost.item as ItemDefinitionmyItemCost.item
Return Type:
ItemDefinition
Getter
// ItemCost.itemStack as IItemStackmyItemCost.itemStack
Return Type:
IItemStack
static of(stack as IItemStack) as ItemCost
ItemCost.of(myIItemStack);
Parameters:
stack: IItemStack
Type: IItemStack
Return Type:
ItemCost
static of(stack as IItemStack, predicate as DataComponentPredicate) as ItemCost
ItemCost.of(myIItemStack, myDataComponentPredicate);
Parameters:
stack: IItemStack
Type: IItemStack
predicate: DataComponentPredicate
Type: DataComponentPredicate
Return Type:
ItemCost
test(stack as IItemStack) as bool
myItemCost.test(myIItemStack);
Parameters:
stack: IItemStack
Type: IItemStack
Return Type:
bool
withComponents(operator as UnaryOperator<Builder>) as ItemCost
myItemCost.withComponents(myUnaryOperator);
Parameters:
operator: UnaryOperator<DataComponentPredicateBuilder>
Type: UnaryOperator<DataComponentPredicateBuilder>
Return Type:
ItemCost