ItemsAndEmeraldsToItems

Link to itemsandemeraldstoitems

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
Copy
import crafttweaker.api.villager.trade.type.ItemsAndEmeraldsToItems;

Implemented Interfaces

Link to implemented-interfaces

ItemsAndEmeraldsToItems implements the following interfaces. That means all methods defined in these interfaces are also available in ItemsAndEmeraldsToItems

ZenScript
Copy
new ItemsAndEmeraldsToItems(fromItem as ItemLike, fromCount as int, toItem as ItemDefinition, toCount as int, maxUses as int, villagerXp as int) as ItemsAndEmeraldsToItems
new ItemsAndEmeraldsToItems(<item:minecraft:dirt>, 4, <item:minecraft:diamond>, 1, 8, 2);
ParameterTypeDescription
Parameter
fromItem
Type
ItemLike
Description
The secondary item that is being given to the villager
Parameter
fromCount
Type
int
Description
The amount of the secondary item that is being given to the villager
Parameter
toItem
Type
ItemDefinition
Description
The Item that is being sold by the villager
Parameter
toCount
Type
int
Description
The amount of the item that is being sold by the villager
Parameter
maxUses
Type
int
Description
How many times can this trade be used
Parameter
villagerXp
Type
int
Description
How much experience does this trade reward the villager
ZenScript
Copy
new ItemsAndEmeraldsToItems(fromItem as ItemLike, fromCount as int, emeraldCost as int, toItem as ItemDefinition, toCount as int, maxUses as int, villagerXp as int) as ItemsAndEmeraldsToItems
new ItemsAndEmeraldsToItems(<item:minecraft:dirt>, 4, 2, <item:minecraft:diamond>, 1, 8, 2);
ParameterTypeDescription
Parameter
fromItem
Type
ItemLike
Description
The secondary item that is being given to the villager
Parameter
fromCount
Type
int
Description
The amount of the secondary item that is being given to the villager
Parameter
emeraldCost
Type
int
Description
How many emeralds will be given to the villager
Parameter
toItem
Type
ItemDefinition
Description
The Item that is being sold by the villager
Parameter
toCount
Type
int
Description
The amount of the item that is being sold by the villager
Parameter
maxUses
Type
int
Description
How many times can this trade be used
Parameter
villagerXp
Type
int
Description
How much experience does this trade reward the villager