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.
import crafttweaker.api.villager.trade.type.EmeraldsForVillagerTypeItem;
Implements
EmeraldsForVillagerTypeItem
implements the following interfaces:
Members
static create(cost as int, maxUses as int, villagerXp as int, trades as IItemStack[VillagerType]) as EmeraldsForVillagerTypeItem
Creates a new EmeraldsForVillagerTypeItem tradescript.zs
Returns: A new EmeraldsForVillagerTypeItem
// 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: int
Type: int
- How many emeralds should the map cost maxUses: int
Type: int
- How many times this trade can be used villagerXp: int
Type: int
- How much experience does this trade reward the villager trades: IItemStack[VillagerType]
Type: IItemStack[VillagerType]
- A map of VillagerType
to Item
trades
Return Type:
EmeraldsForVillagerTypeItem
getOffer(traderEntity as Entity, random as RandomSource) as MerchantOffer
// EmeraldsForVillagerTypeItem.getOffer(traderEntity as Entity, random as RandomSource) as MerchantOffer;myEmeraldsForVillagerTypeItem.getOffer(myEntity, myRandomSource);
Parameters:
random: RandomSource
Type: RandomSource
Return Type:
MerchantOffer