Home Commands Examples Getting Started With Scripts Global Keywords

BasicItemListing

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

Implements

BasicItemListing implements the following interfaces:

ItemListing

Constructors

new(price as ItemStack, price2 as ItemStack, forSale as ItemStack, maxTrades as int, xp as int, priceMult as float)
script.zs
// new BasicItemListing(price as ItemStack, price2 as ItemStack, forSale as ItemStack, maxTrades as int, xp as int, priceMult as float);
new BasicItemListing(myItemStack, myItemStack, myItemStack, myInt, myInt, myFloat);

Parameters:

price Type: ItemStack - The primary Item that is being given to the villager
price2 Type: ItemStack - The secondary item that is being given to the villager
forSale Type: ItemStack - The Item that is being sold by the villager
maxTrades Type: int - How many times can this trade be used
xp Type: int - How much experience does this trade reward the villager
priceMult 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
// BasicItemListing.getOffer(traderEntity as Entity, random as RandomSource) as MerchantOffer;
myBasicItemListing.getOffer(myEntity, myRandomSource);

Parameters:

traderEntity Type: Entity
random Type: RandomSource

Return Type: MerchantOffer