Home Commands Examples Getting Started With Scripts Global Keywords

MerchantOffer

Importing the class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

script.zs
import crafttweaker.api.villager.MerchantOffer;

Constructors

script.zs
new MerchantOffer(baseCostA as ItemStack, result as ItemStack, maxUses as int, xp as int, priceMultiplier as float) as MerchantOffer
ParameterType
Parameter
baseCostA
Type
ItemStack
Parameter
result
Type
ItemStack
Parameter
maxUses
Type
int
Parameter
xp
Type
int
Parameter
priceMultiplier
Type
float
script.zs
new MerchantOffer(baseCostA as ItemStack, costB as ItemStack, result as ItemStack, maxUses as int, xp as int, priceMultiplier as float) as MerchantOffer
ParameterType
Parameter
baseCostA
Type
ItemStack
Parameter
costB
Type
ItemStack
Parameter
result
Type
ItemStack
Parameter
maxUses
Type
int
Parameter
xp
Type
int
Parameter
priceMultiplier
Type
float
script.zs
new MerchantOffer(baseCostA as ItemStack, costB as ItemStack, result as ItemStack, uses as int, maxUses as int, xp as int, priceMultiplier as float) as MerchantOffer
ParameterType
Parameter
baseCostA
Type
ItemStack
Parameter
costB
Type
ItemStack
Parameter
result
Type
ItemStack
Parameter
uses
Type
int
Parameter
maxUses
Type
int
Parameter
xp
Type
int
Parameter
priceMultiplier
Type
float
script.zs
new MerchantOffer(baseCostA as ItemStack, costB as ItemStack, result as ItemStack, uses as int, maxUses as int, xp as int, priceMultiplier as float, demand as int) as MerchantOffer
ParameterType
Parameter
baseCostA
Type
ItemStack
Parameter
costB
Type
ItemStack
Parameter
result
Type
ItemStack
Parameter
uses
Type
int
Parameter
maxUses
Type
int
Parameter
xp
Type
int
Parameter
priceMultiplier
Type
float
Parameter
demand
Type
int

Methods

script.zs
MerchantOffer.addToSpecialPriceDiff(specialPriceDiff as int)
ParameterType
Parameter
specialPriceDiff
Type
int

Return Type: IItemStack

script.zs
// MerchantOffer.assemble() as IItemStack
myMerchantOffer.assemble();

Return Type: IData

script.zs
// MerchantOffer.createTag() as IData
myMerchantOffer.createTag();

Return Type: IItemStack

script.zs
// MerchantOffer.getBaseCostA() as IItemStack
myMerchantOffer.getBaseCostA();

Return Type: IItemStack

script.zs
// MerchantOffer.getCostA() as IItemStack
myMerchantOffer.getCostA();

Return Type: IItemStack

script.zs
// MerchantOffer.getCostB() as IItemStack
myMerchantOffer.getCostB();

Return Type: int

script.zs
// MerchantOffer.getDemand() as int
myMerchantOffer.getDemand();

Return Type: int

script.zs
// MerchantOffer.getMaxUses() as int
myMerchantOffer.getMaxUses();

Return Type: float

script.zs
// MerchantOffer.getPriceMultiplier() as float
myMerchantOffer.getPriceMultiplier();

Return Type: IItemStack

script.zs
// MerchantOffer.getResult() as IItemStack
myMerchantOffer.getResult();

Return Type: int

script.zs
// MerchantOffer.getSpecialPriceDiff() as int
myMerchantOffer.getSpecialPriceDiff();

Return Type: int

script.zs
// MerchantOffer.getUses() as int
myMerchantOffer.getUses();

Return Type: int

script.zs
// MerchantOffer.getXp() as int
myMerchantOffer.getXp();
script.zs
// MerchantOffer.increaseUses()
myMerchantOffer.increaseUses();

Return Type: boolean

script.zs
// MerchantOffer.isOutOfStock() as boolean
myMerchantOffer.isOutOfStock();

Return Type: boolean

script.zs
// MerchantOffer.needsRestock() as boolean
myMerchantOffer.needsRestock();
script.zs
// MerchantOffer.resetSpecialPriceDiff()
myMerchantOffer.resetSpecialPriceDiff();
script.zs
// MerchantOffer.resetUses()
myMerchantOffer.resetUses();

Return Type: boolean

script.zs
MerchantOffer.satisfiedBy(a as IItemStack, b as IItemStack) as boolean
ParameterType
Parameter
a
Type
IItemStack
Parameter
b
Type
IItemStack
script.zs
MerchantOffer.setSpecialPriceDiff(specialPriceDiff as int)
ParameterType
Parameter
specialPriceDiff
Type
int
script.zs
// MerchantOffer.setToOutOfStock()
myMerchantOffer.setToOutOfStock();

Return Type: boolean

script.zs
// MerchantOffer.shouldRewardExp() as boolean
myMerchantOffer.shouldRewardExp();

Return Type: boolean

script.zs
MerchantOffer.take(a as IItemStack, b as IItemStack) as boolean
ParameterType
Parameter
a
Type
IItemStack
Parameter
b
Type
IItemStack
script.zs
// MerchantOffer.updateDemand()
myMerchantOffer.updateDemand();

Properties

NameTypeHas GetterHas Setter
Name
baseCostA
Type
IItemStack
Has Getter
true
Has Setter
false
Name
costA
Type
IItemStack
Has Getter
true
Has Setter
false
Name
costB
Type
IItemStack
Has Getter
true
Has Setter
false
Name
demand
Type
int
Has Getter
true
Has Setter
false
Name
maxUses
Type
int
Has Getter
true
Has Setter
false
Name
needsRestock
Type
boolean
Has Getter
true
Has Setter
false
Name
outOfStock
Type
boolean
Has Getter
true
Has Setter
false
Name
priceMultiplier
Type
float
Has Getter
true
Has Setter
false
Name
result
Type
IItemStack
Has Getter
true
Has Setter
false
Name
shouldRewardExp
Type
boolean
Has Getter
true
Has Setter
false
Name
specialPriceDiff
Type
int
Has Getter
true
Has Setter
true
Name
uses
Type
int
Has Getter
true
Has Setter
false
Name
xp
Type
int
Has Getter
true
Has Setter
false