ItemCost
Link to itemcost
Importing the class
Link to 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.
ZenScript Copyimport crafttweaker.api.villager.ItemCost;
Extending Record
Link to extending-record
ItemCost extends Record. That means all methods available in Record are also available in ItemCost
Static Methods
Link to static-methods
Name: of
Return Type: ItemCost
ZenScript CopyItemCost.of(stack as IItemStack) as ItemCost
Parameter | Type |
---|---|
Parameter stack | Type IItemStack |
Name: of
Return Type: ItemCost
ZenScript CopyItemCost.of(stack as IItemStack, predicate as DataComponentPredicate) as ItemCost
Parameter | Type |
---|---|
Parameter stack | Type IItemStack |
Parameter predicate | Type DataComponentPredicate |
Methods
Link to methods
Name: components
Return Type: DataComponentPredicate
ZenScript Copy// ItemCost.components() as DataComponentPredicate
myItemCost.components();
Name: test
Return Type: boolean
ZenScript CopyItemCost.test(stack as IItemStack) as boolean
Parameter | Type |
---|---|
Parameter stack | Type IItemStack |
Name: withComponents
Return Type: ItemCost
ZenScript CopyItemCost.withComponents(operator as UnaryOperator<DataComponentPredicateBuilder>) as ItemCost
Parameter | Type |
---|---|
Parameter operator | Type UnaryOperator<DataComponentPredicateBuilder> |
Properties
Link to properties
Name | Type | Has Getter | Has Setter |
---|---|---|---|
Name count | Type int | Has Getter true | Has Setter false |
Name item | Type ItemDefinition | Has Getter true | Has Setter false |
Name itemStack | Type IItemStack | Has Getter true | Has Setter false |