EmeraldForItems

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

Implements

EmeraldForItems implements the following interfaces:

ItemListing

Constructors

new(item as ItemLike, cost as int, maxUses as int, villagerXp as int)
script.zs
// new EmeraldForItems(item as ItemLike, cost as int, maxUses as int, villagerXp as int);
new EmeraldForItems(myItemLike, myInt, myInt, myInt);

Parameters:

item Type: ItemLike - The Item that is being given to the villager
cost Type: int - How many emeralds does this trade cost
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
// EmeraldForItems.getOffer(traderEntity as Entity, random as RandomSource) as MerchantOffer;
myEmeraldForItems.getOffer(myEntity, myRandomSource);

Parameters:

traderEntity Type: Entity
random Type: RandomSource

Return Type: MerchantOffer