Home Commands Examples Getting Started With Scripts Global Keywords
BracketDumpers BracketHandlers BracketValidators ResourceLocationBracketHandler

Merchant

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import crafttweaker.api.entity.type.villager.Merchant;

Members

Getter
script.zs
// Merchant.canRestock as bool
myMerchant.canRestock

Return Type: bool

canRestock() as bool
script.zs
// Merchant.canRestock() as bool;
myMerchant.canRestock();

Return Type: bool

Getter
script.zs
// Merchant.isClientSide as bool
myMerchant.isClientSide

Return Type: bool

isClientSide() as bool
script.zs
// Merchant.isClientSide() as bool;
myMerchant.isClientSide();

Return Type: bool

notifyTrade(offer as MerchantOffer)
script.zs
// Merchant.notifyTrade(offer as MerchantOffer);
myMerchant.notifyTrade(myMerchantOffer);

Parameters:

Getter
script.zs
// Merchant.notifyTradeSound as SoundEvent
myMerchant.notifyTradeSound

Return Type: SoundEvent

notifyTradeSound() as SoundEvent
script.zs
// Merchant.notifyTradeSound() as SoundEvent;
myMerchant.notifyTradeSound();

Return Type: SoundEvent

notifyTradeUpdated(stack as ItemStack)
script.zs
// Merchant.notifyTradeUpdated(stack as ItemStack);
myMerchant.notifyTradeUpdated(myItemStack);

Parameters:

stack Type: ItemStack
Getter
script.zs
// Merchant.offers as MerchantOffers
myMerchant.offers

Return Type: MerchantOffers

offers() as MerchantOffers
script.zs
// Merchant.offers() as MerchantOffers;
myMerchant.offers();

Return Type: MerchantOffers

openTradingScreen(player as Player, displayName as Component, level as int)
script.zs
// Merchant.openTradingScreen(player as Player, displayName as Component, level as int);
myMerchant.openTradingScreen(myPlayer, myComponent, myInt);

Parameters:

player Type: Player
displayName Type: Component
level Type: int
Getter
script.zs
// Merchant.showProgressBar as bool
myMerchant.showProgressBar

Return Type: bool

showProgressBar() as bool
script.zs
// Merchant.showProgressBar() as bool;
myMerchant.showProgressBar();

Return Type: bool

Getter
script.zs
// Merchant.tradingPlayer as Player
myMerchant.tradingPlayer

Return Type: Player

Setter
script.zs
// Merchant.tradingPlayer = (player as Player);
myMerchant.tradingPlayer = myPlayer;

Parameters:

player Type: Player
tradingPlayer(player as Player)
script.zs
// Merchant.tradingPlayer(player as Player);
myMerchant.tradingPlayer(myPlayer);

Parameters:

player Type: Player
tradingPlayer() as Player
script.zs
// Merchant.tradingPlayer() as Player;
myMerchant.tradingPlayer();

Return Type: Player

Getter
script.zs
// Merchant.villagerXp as int
myMerchant.villagerXp

Return Type: int

villagerXp() as int
script.zs
// Merchant.villagerXp() as int;
myMerchant.villagerXp();

Return Type: int