EmeraldsForVillagerTypeItem

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

Implements

EmeraldsForVillagerTypeItem implements the following interfaces:

ItemListing

Members

static create(cost as int, maxUses as int, villagerXp as int, trades as IItemStack[VillagerType]) as EmeraldsForVillagerTypeItem
Creates a new EmeraldsForVillagerTypeItem trade

Returns: A new EmeraldsForVillagerTypeItem

script.zs
// EmeraldsForVillagerTypeItem.create(cost as int, maxUses as int, villagerXp as int, trades as IItemStack[VillagerType]) as EmeraldsForVillagerTypeItem;
EmeraldsForVillagerTypeItem.create(1, 16, 2, {<villagertype:minecraft:desert>: <item:minecraft:sand>, <villagertype:minecraft:plains>: <item:minecraft:dirt>});

Parameters:

cost Type: int - How many emeralds should the map cost
maxUses Type: int - How many times this trade can be used
villagerXp Type: int - How much experience does this trade reward the villager
trades Type: IItemStack[VillagerType] - A map of VillagerType to Item trades

Return Type: EmeraldsForVillagerTypeItem

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

Parameters:

traderEntity Type: Entity
random Type: RandomSource

Return Type: MerchantOffer