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.
import crafttweaker.api.villager.MerchantOffer;
Constructors
new MerchantOffer(baseCostA as ItemStack, result as ItemStack, maxUses as int, xp as int, priceMultiplier as float) as MerchantOffer
Parameter | Type |
---|---|
Parameter baseCostA | Type ItemStack |
Parameter result | Type ItemStack |
Parameter maxUses | Type int |
Parameter xp | Type int |
Parameter priceMultiplier | Type float |
new MerchantOffer(baseCostA as ItemStack, costB as ItemStack, result as ItemStack, maxUses as int, xp as int, priceMultiplier as float) as MerchantOffer
Parameter | Type |
---|---|
Parameter baseCostA | Type ItemStack |
Parameter costB | Type ItemStack |
Parameter result | Type ItemStack |
Parameter maxUses | Type int |
Parameter xp | Type int |
Parameter priceMultiplier | Type float |
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
Parameter | Type |
---|---|
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 |
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
Parameter | Type |
---|---|
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
MerchantOffer.addToSpecialPriceDiff(specialPriceDiff as int)
Parameter | Type |
---|---|
Parameter specialPriceDiff | Type int |
Return Type: IItemStack
// MerchantOffer.assemble() as IItemStack
myMerchantOffer.assemble();
Return Type: IData
// MerchantOffer.createTag() as IData
myMerchantOffer.createTag();
Return Type: IItemStack
// MerchantOffer.getBaseCostA() as IItemStack
myMerchantOffer.getBaseCostA();
Return Type: IItemStack
// MerchantOffer.getCostA() as IItemStack
myMerchantOffer.getCostA();
Return Type: IItemStack
// MerchantOffer.getCostB() as IItemStack
myMerchantOffer.getCostB();
Return Type: int
// MerchantOffer.getDemand() as int
myMerchantOffer.getDemand();
Return Type: int
// MerchantOffer.getMaxUses() as int
myMerchantOffer.getMaxUses();
Return Type: float
// MerchantOffer.getPriceMultiplier() as float
myMerchantOffer.getPriceMultiplier();
Return Type: IItemStack
// MerchantOffer.getResult() as IItemStack
myMerchantOffer.getResult();
Return Type: int
// MerchantOffer.getSpecialPriceDiff() as int
myMerchantOffer.getSpecialPriceDiff();
Return Type: int
// MerchantOffer.getUses() as int
myMerchantOffer.getUses();
Return Type: int
// MerchantOffer.getXp() as int
myMerchantOffer.getXp();
// MerchantOffer.increaseUses()
myMerchantOffer.increaseUses();
Return Type: boolean
// MerchantOffer.isOutOfStock() as boolean
myMerchantOffer.isOutOfStock();
Return Type: boolean
// MerchantOffer.needsRestock() as boolean
myMerchantOffer.needsRestock();
// MerchantOffer.resetSpecialPriceDiff()
myMerchantOffer.resetSpecialPriceDiff();
// MerchantOffer.resetUses()
myMerchantOffer.resetUses();
Return Type: boolean
MerchantOffer.satisfiedBy(a as IItemStack, b as IItemStack) as boolean
Parameter | Type |
---|---|
Parameter a | Type IItemStack |
Parameter b | Type IItemStack |
MerchantOffer.setSpecialPriceDiff(specialPriceDiff as int)
Parameter | Type |
---|---|
Parameter specialPriceDiff | Type int |
// MerchantOffer.setToOutOfStock()
myMerchantOffer.setToOutOfStock();
Return Type: boolean
// MerchantOffer.shouldRewardExp() as boolean
myMerchantOffer.shouldRewardExp();
Return Type: boolean
MerchantOffer.take(a as IItemStack, b as IItemStack) as boolean
Parameter | Type |
---|---|
Parameter a | Type IItemStack |
Parameter b | Type IItemStack |
// MerchantOffer.updateDemand()
myMerchantOffer.updateDemand();
Properties
Name | Type | Has Getter | Has 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 |