Importare la Classe

Link to importare-la-classe

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)
ParametroTipo
Parametro
offer
Tipo
MerchantOffer

Link to notifyTradeUpdated

Name: notifyTradeUpdated

ZenScript
Copy
Merchant.notifyTradeUpdated(stack as ItemStack)
ParametroTipo
Parametro
stack
Tipo
ItemStack

Link to openTradingScreen

Name: openTradingScreen

ZenScript
Copy
Merchant.openTradingScreen(player as Player, displayName as Component, level as int)
ParametroTipo
Parametro
player
Tipo
Player
Parametro
displayName
Tipo
Component
Parametro
level
Tipo
int

Link to setTradingPlayer

Name: setTradingPlayer

ZenScript
Copy
Merchant.setTradingPlayer(player as Player?)
ParametroTipo
Parametro
player
Tipo
Player?

Name: showProgressBar

Return Type: boolean

ZenScript
Copy
// Merchant.showProgressBar() as boolean

myMerchant.showProgressBar();
NomeTipoHa GetterHa Setter
Nome
canRestock
Tipo
boolean
Ha Getter
Ha Setter
no
Nome
isClientSide
Tipo
boolean
Ha Getter
Ha Setter
no
Nome
notifyTradeSound
Tipo
SoundEvent
Ha Getter
Ha Setter
no
Nome
offers
Tipo
MerchantOffers
Ha Getter
Ha Setter
no
Nome
showProgressBar
Tipo
boolean
Ha Getter
Ha Setter
no
Nome
tradingPlayer
Tipo
Merchant
Ha Getter
Ha Setter
Nome
villagerXp
Tipo
int
Ha Getter
Ha Setter
no