ItemsAndEmeraldsToItems

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.

script.zs
import crafttweaker.api.villager.trade.type.ItemsAndEmeraldsToItems;

Implements

ItemsAndEmeraldsToItems implements the following interfaces:

ItemListing

Constructors

new(fromItem as ItemLike, fromCount as int, toItem as Item, toCount as int, maxUses as int, villagerXp as int)
script.zs
// new ItemsAndEmeraldsToItems(fromItem as ItemLike, fromCount as int, toItem as ItemDefinition, toCount as int, maxUses as int, villagerXp as int);
new ItemsAndEmeraldsToItems(myItemLike, myInt, myItem, myInt, myInt, myInt);

Parameters:

fromItem Type: ItemLike - The secondary item that is being given to the villager
fromCount Type: int - The amount of the secondary item that is being given to the villager
toItem Type: ItemDefinition - The Item that is being sold by the villager
toCount Type: int - The amount of the item that is being sold by the villager
maxUses Type: int - How many times can this trade be used
villagerXp Type: int - How much experience does this trade reward the villager
new(fromItem as ItemLike, fromCount as int, emeraldCost as int, toItem as Item, toCount as int, maxUses as int, villagerXp as int)
script.zs
// new ItemsAndEmeraldsToItems(fromItem as ItemLike, fromCount as int, emeraldCost as int, toItem as ItemDefinition, toCount as int, maxUses as int, villagerXp as int);
new ItemsAndEmeraldsToItems(myItemLike, myInt, myInt, myItem, myInt, myInt, myInt);

Parameters:

fromItem Type: ItemLike - The secondary item that is being given to the villager
fromCount Type: int - The amount of the secondary item that is being given to the villager
emeraldCost Type: int - How many emeralds will be given to the villager
toItem Type: ItemDefinition - The Item that is being sold by the villager
toCount Type: int - The amount of the item that is being sold by the villager
maxUses Type: int - How many times can this trade be used
villagerXp Type: int - How much experience does this trade reward the villager

Members

getOffer(traderEntity as Entity, random as RandomSource) as MerchantOffer
script.zs
// ItemsAndEmeraldsToItems.getOffer(traderEntity as Entity, random as RandomSource) as MerchantOffer;
myItemsAndEmeraldsToItems.getOffer(myEntity, myRandomSource);

Parameters:

traderEntity Type: Entity
random Type: RandomSource

Return Type: MerchantOffer