Home Migration Guide Getting Started With Scripts Commands Examples
BracketHandlers

MCMerchantOffer

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

Constructors

script.zs
new MCMerchantOffer(baseCostA as ItemStack, result as ItemStack, maxUses as int, xp as int, priceMultiplier as float) as MCMerchantOffer
ParameterTypeDescription
Parameter
baseCostA
Type
ItemStack
Description
No description provided
Parameter
result
Type
ItemStack
Description
No description provided
Parameter
maxUses
Type
int
Description
No description provided
Parameter
xp
Type
int
Description
No description provided
Parameter
priceMultiplier
Type
float
Description
No description provided
script.zs
new MCMerchantOffer(baseCostA as ItemStack, costB as ItemStack, result as ItemStack, maxUses as int, xp as int, priceMultiplier as float) as MCMerchantOffer
ParameterTypeDescription
Parameter
baseCostA
Type
ItemStack
Description
No description provided
Parameter
costB
Type
ItemStack
Description
No description provided
Parameter
result
Type
ItemStack
Description
No description provided
Parameter
maxUses
Type
int
Description
No description provided
Parameter
xp
Type
int
Description
No description provided
Parameter
priceMultiplier
Type
float
Description
No description provided
script.zs
new MCMerchantOffer(baseCostA as ItemStack, costB as ItemStack, result as ItemStack, uses as int, maxUses as int, xp as int, priceMultiplier as float) as MCMerchantOffer
ParameterTypeDescription
Parameter
baseCostA
Type
ItemStack
Description
No description provided
Parameter
costB
Type
ItemStack
Description
No description provided
Parameter
result
Type
ItemStack
Description
No description provided
Parameter
uses
Type
int
Description
No description provided
Parameter
maxUses
Type
int
Description
No description provided
Parameter
xp
Type
int
Description
No description provided
Parameter
priceMultiplier
Type
float
Description
No description provided
script.zs
new MCMerchantOffer(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 MCMerchantOffer
ParameterTypeDescription
Parameter
baseCostA
Type
ItemStack
Description
No description provided
Parameter
costB
Type
ItemStack
Description
No description provided
Parameter
result
Type
ItemStack
Description
No description provided
Parameter
uses
Type
int
Description
No description provided
Parameter
maxUses
Type
int
Description
No description provided
Parameter
xp
Type
int
Description
No description provided
Parameter
priceMultiplier
Type
float
Description
No description provided
Parameter
demand
Type
int
Description
No description provided

Methods

Return Type: void

script.zs
// MCMerchantOffer.calculateDemand() as void
myMCMerchantOffer.calculateDemand();

Return Type: boolean

script.zs
MCMerchantOffer.doTransaction(a as IItemStack, b as IItemStack) as boolean
ParameterTypeDescription
Parameter
a
Type
IItemStack
Description
No Description Provided
Parameter
b
Type
IItemStack
Description
No Description Provided

Return Type: IItemStack

script.zs
// MCMerchantOffer.getBuyingStackFirst() as IItemStack
myMCMerchantOffer.getBuyingStackFirst();

Return Type: IItemStack

script.zs
// MCMerchantOffer.getBuyingStackSecond() as IItemStack
myMCMerchantOffer.getBuyingStackSecond();

Return Type: IItemStack

script.zs
// MCMerchantOffer.getCopyOfSellingStack() as IItemStack
myMCMerchantOffer.getCopyOfSellingStack();

Return Type: int

script.zs
// MCMerchantOffer.getDemand() as int
myMCMerchantOffer.getDemand();

Return Type: IItemStack

script.zs
// MCMerchantOffer.getDiscountedBuyingStackFirst() as IItemStack
myMCMerchantOffer.getDiscountedBuyingStackFirst();

Return Type: boolean

script.zs
// MCMerchantOffer.getDoesRewardExp() as boolean
myMCMerchantOffer.getDoesRewardExp();

Return Type: int

script.zs
// MCMerchantOffer.getGivenExp() as int
myMCMerchantOffer.getGivenExp();

Return Type: int

script.zs
// MCMerchantOffer.getMaxUses() as int
myMCMerchantOffer.getMaxUses();

Return Type: float

script.zs
// MCMerchantOffer.getPriceMultiplier() as float
myMCMerchantOffer.getPriceMultiplier();

Return Type: IItemStack

script.zs
// MCMerchantOffer.getSellingStack() as IItemStack
myMCMerchantOffer.getSellingStack();

Return Type: int

script.zs
// MCMerchantOffer.getSpecialPrice() as int
myMCMerchantOffer.getSpecialPrice();

Return Type: int

script.zs
// MCMerchantOffer.getUses() as int
myMCMerchantOffer.getUses();

Return Type: boolean

script.zs
// MCMerchantOffer.hasBeenUsed() as boolean
myMCMerchantOffer.hasBeenUsed();

Return Type: boolean

script.zs
// MCMerchantOffer.hasNoUsesLeft() as boolean
myMCMerchantOffer.hasNoUsesLeft();

Return Type: void

script.zs
MCMerchantOffer.increaseSpecialPrice(specialPrice as int) as void
ParameterTypeDescription
Parameter
specialPrice
Type
int
Description
No Description Provided

Return Type: void

script.zs
// MCMerchantOffer.increaseUses() as void
myMCMerchantOffer.increaseUses();

Return Type: void

script.zs
// MCMerchantOffer.makeUnavailable() as void
myMCMerchantOffer.makeUnavailable();

Return Type: boolean

script.zs
MCMerchantOffer.matches(a as IItemStack, b as IItemStack) as boolean
ParameterTypeDescription
Parameter
a
Type
IItemStack
Description
No Description Provided
Parameter
b
Type
IItemStack
Description
No Description Provided

Return Type: void

script.zs
// MCMerchantOffer.resetSpecialPrice() as void
myMCMerchantOffer.resetSpecialPrice();

Return Type: void

script.zs
// MCMerchantOffer.resetUses() as void
myMCMerchantOffer.resetUses();

Return Type: void

script.zs
MCMerchantOffer.setSpecialPrice(specialPrice as int) as void
ParameterTypeDescription
Parameter
specialPrice
Type
int
Description
No Description Provided

Return Type: IData

script.zs
// MCMerchantOffer.write() as IData
myMCMerchantOffer.write();

Properties

NameTypeHas GetterHas SetterDescription
Name
buyingStackFirst
Type
IItemStack
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
buyingStackSecond
Type
IItemStack
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
copyOfSellingStack
Type
IItemStack
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
demand
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
discountedBuyingStackFirst
Type
IItemStack
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
doesRewardExp
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
givenExp
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
hasBeenUsed
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
hasNoUsesLeft
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
maxUses
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
priceMultiplier
Type
float
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
sellingStack
Type
IItemStack
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
specialPrice
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
uses
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided