Importing the class

Link to 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.

ZenScript
Copy
import crafttweaker.api.entity.type.villager.Merchant;

Name: canRestock

Return Type: boolean

ZenScript
Copy
// Merchant.canRestock() as boolean

myMerchant.canRestock();

Link to getNotifyTradeSound

Name: getNotifyTradeSound

Return Type: SoundEvent

ZenScript
Copy
// Merchant.getNotifyTradeSound() as SoundEvent

myMerchant.getNotifyTradeSound();

Name: getOffers

Return Type: MerchantOffers

ZenScript
Copy
// Merchant.getOffers() as MerchantOffers

myMerchant.getOffers();

Link to getTradingPlayer

Name: getTradingPlayer

Return Type: Player?

ZenScript
Copy
// Merchant.getTradingPlayer() as Player?

myMerchant.getTradingPlayer();

Name: getVillagerXp

Return Type: int

ZenScript
Copy
// Merchant.getVillagerXp() as int

myMerchant.getVillagerXp();

Name: isClientSide

Return Type: boolean

ZenScript
Copy
// Merchant.isClientSide() as boolean

myMerchant.isClientSide();

Name: notifyTrade

Return Type: void

ZenScript
Copy
Merchant.notifyTrade(offer as MerchantOffer) as void
ParameterTypeDescription
Parameter
offer
Type
MerchantOffer
Description
No Description Provided

Link to notifyTradeUpdated

Name: notifyTradeUpdated

Return Type: void

ZenScript
Copy
Merchant.notifyTradeUpdated(stack as ItemStack) as void
ParameterTypeDescription
Parameter
stack
Type
ItemStack
Description
No Description Provided

Link to openTradingScreen

Name: openTradingScreen

Return Type: void

ZenScript
Copy
Merchant.openTradingScreen(player as Player, displayName as Component, level as int) as void
ParameterTypeDescription
Parameter
player
Type
Player
Description
No Description Provided
Parameter
displayName
Type
Component
Description
No Description Provided
Parameter
level
Type
int
Description
No Description Provided

Link to setTradingPlayer

Name: setTradingPlayer

Return Type: void

ZenScript
Copy
Merchant.setTradingPlayer(player as Player?) as void
ParameterTypeDescription
Parameter
player
Type
Player?
Description
No Description Provided

Name: showProgressBar

Return Type: boolean

ZenScript
Copy
// Merchant.showProgressBar() as boolean

myMerchant.showProgressBar();
NameTypeHas GetterHas SetterDescription
Name
canRestock
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
isClientSide
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
notifyTradeSound
Type
SoundEvent
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
offers
Type
MerchantOffers
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
showProgressBar
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
tradingPlayer
Type
Merchant
Has Getter
true
Has Setter
true
Description
No Description Provided
Name
villagerXp
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided