EnchantedItemForEmeralds

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

Implements

EnchantedItemForEmeralds implements the following interfaces:

ItemListing

Constructors

new(item as Item, baseEmeraldCost as int, maxUses as int, villagerXp as int)
script.zs
// new EnchantedItemForEmeralds(item as Item, baseEmeraldCost as int, maxUses as int, villagerXp as int);
new EnchantedItemForEmeralds(myItem, myInt, myInt, myInt);

Parameters:

item Type: ItemDefinition - The Item that is being sold by the villager
baseEmeraldCost Type: int - The base cost of the trade before any multipliers are applied
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, baseEmeraldCost as int, maxUses as int, villagerXp as int, priceMultiplier as float)
script.zs
// new EnchantedItemForEmeralds(item as Item, baseEmeraldCost as int, maxUses as int, villagerXp as int, priceMultiplier as float);
new EnchantedItemForEmeralds(myItem, myInt, myInt, myInt, myFloat);

Parameters:

item Type: ItemDefinition - The Item that is being sold by the villager
baseEmeraldCost Type: int - The base cost of the trade before any multipliers are applied
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
// EnchantedItemForEmeralds.getOffer(traderEntity as Entity, random as RandomSource) as MerchantOffer;
myEnchantedItemForEmeralds.getOffer(myEntity, myRandomSource);

Parameters:

traderEntity Type: Entity
random Type: RandomSource

Return Type: MerchantOffer