ItemsForEmeralds

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.ItemsForEmeralds;

Implements

ItemsForEmeralds implements the following interfaces:

ItemListing

Constructors

new(block as Block, emeraldCost as int, numberOfItems as int, maxUses as int, villagerXp as int)
script.zs
// new ItemsForEmeralds(block as Block, emeraldCost as int, numberOfItems as int, maxUses as int, villagerXp as int);
new ItemsForEmeralds(myBlock, myInt, myInt, myInt, myInt);

Parameters:

block Type: Block - The Block that is being sold by the villager
emeraldCost Type: int - How many emeralds will be given to the villager
numberOfItems Type: int - The amount of the Block being sold to 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(item as Item, emeraldCost as int, numberOfItems as int, villagerXp as int)
script.zs
// new ItemsForEmeralds(item as ItemDefinition, emeraldCost as int, numberOfItems as int, villagerXp as int);
new ItemsForEmeralds(myItem, myInt, myInt, myInt);

Parameters:

item Type: ItemDefinition - The Item that is being sold by the villager
emeraldCost Type: int - How many emeralds will be given to the villager
numberOfItems Type: int - The amount of the Item being sold to the villager
villagerXp Type: int - How much experience does this trade reward the villager
new(itemStack as ItemStack, emeraldCost as int, numberOfItems as int, maxUses as int, villagerXp as int)
script.zs
// new ItemsForEmeralds(itemStack as ItemStack, emeraldCost as int, numberOfItems as int, maxUses as int, villagerXp as int);
new ItemsForEmeralds(myItemStack, myInt, myInt, myInt, myInt);

Parameters:

itemStack Type: ItemStack - The Item that is being sold by the villager
emeraldCost Type: int - How many emeralds will be given to the villager
numberOfItems Type: int - The amount of the Item being sold to 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(itemStack as ItemStack, emeraldCost as int, numberOfItems as int, maxUses as int, villagerXp as int, priceMultiplier as float)
script.zs
// new ItemsForEmeralds(itemStack as ItemStack, emeraldCost as int, numberOfItems as int, maxUses as int, villagerXp as int, priceMultiplier as float);
new ItemsForEmeralds(myItemStack, myInt, myInt, myInt, myInt, myFloat);

Parameters:

itemStack Type: ItemStack - The Item that is being sold by the villager
emeraldCost Type: int - How many emeralds will be given to the villager
numberOfItems Type: int - The amount of the Item being sold to 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
priceMultiplier Type: float - How much the price is affected by demand, Hero of the Village, and village reputation

Members

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

Parameters:

traderEntity Type: Entity
random Type: RandomSource

Return Type: MerchantOffer