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

ZenScript
Copy
Merchant.notifyTrade(offer as MerchantOffer)
ParameterType
Parameter
offer
Type
MerchantOffer

Link to notifyTradeUpdated

Name: notifyTradeUpdated

ZenScript
Copy
Merchant.notifyTradeUpdated(stack as ItemStack)
ParameterType
Parameter
stack
Type
ItemStack

Link to openTradingScreen

Name: openTradingScreen

ZenScript
Copy
Merchant.openTradingScreen(player as Player, displayName as Component, level as int)
ParameterType
Parameter
player
Type
Player
Parameter
displayName
Type
Component
Parameter
level
Type
int

Link to setTradingPlayer

Name: setTradingPlayer

ZenScript
Copy
Merchant.setTradingPlayer(player as Player?)
ParameterType
Parameter
player
Type
Player?

Name: showProgressBar

Return Type: boolean

ZenScript
Copy
// Merchant.showProgressBar() as boolean

myMerchant.showProgressBar();
이름TypeHas GetterHas Setter
이름
canRestock
Type
boolean
Has Getter
true
Has Setter
false
이름
isClientSide
Type
boolean
Has Getter
true
Has Setter
false
이름
notifyTradeSound
Type
SoundEvent
Has Getter
true
Has Setter
false
이름
offers
Type
MerchantOffers
Has Getter
true
Has Setter
false
이름
showProgressBar
Type
boolean
Has Getter
true
Has Setter
false
이름
tradingPlayer
Type
Merchant
Has Getter
true
Has Setter
true
이름
villagerXp
Type
int
Has Getter
true
Has Setter
false