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)
参数类型
参数
offer
类型
MerchantOffer

Link to notifyTradeUpdated

Name: notifyTradeUpdated

ZenScript
Copy
Merchant.notifyTradeUpdated(stack as ItemStack)
参数类型
参数
堆叠
类型
物品应用

Link to openTradingScreen

Name: openTradingScreen

ZenScript
Copy
Merchant.openTradingScreen(player as Player, displayName as Component, level as int)
参数类型
参数
player
类型
Player
参数
displayName
类型
Component
参数
level
类型
int

Link to setTradingPlayer

Name: setTradingPlayer

ZenScript
Copy
Merchant.setTradingPlayer(player as Player?)
参数类型
参数
player
类型
Player?

Name: showProgressBar

Return Type: boolean

ZenScript
Copy
// Merchant.showProgressBar() as boolean

myMerchant.showProgressBar();
名称类型可获得可设置
名称
canRestock
类型
布尔值
可获得
true
可设置
false
名称
isClientSide
类型
布尔值
可获得
true
可设置
false
名称
notifyTradeSound
类型
SoundEvent
可获得
true
可设置
false
名称
offers
类型
MerchantOffers
可获得
true
可设置
false
名称
showProgressBar
类型
布尔值
可获得
true
可设置
false
名称
tradingPlayer
类型
Merchant
可获得
true
可设置
true
名称
villagerXp
类型
int
可获得
true
可设置
false