Trading Interface
Allows for automatic trading and manipulation of some villager properties
Functions | Description |
---|---|
getProfession() | Gets the current villager profession |
getTrades() | Gets all available trades on for a villager |
trade(from, to, trade) | Makes a trade with a villager |
restock() | Forces a villager to restock its trades |
cycleTrades() | Forces a villager to reset its trades |
getProfession()
Description
Gets the current villager profession
Returns
- boolean - The state of the operation
- string - Error message, If there is a failure on the operation or the profession name
getTrades()
Description
Gets all available trades on for a villager
Returns
- boolean - The state of the operation
- string | table - Error message, If there is a failure on the operation or a table representing the trades
trade(from, to, trade)
Description
Makes a trade with a villager
Parameters
- from: string - a inventory from where to get the trade resources
- to: string - a inventory to place the trade result
- trade: number - the index of the trade
Returns
- boolean - The state of the operation
- string - Error message, If there is a failure on the operation
restock()
Description
Forces a villager to restock its trades
Returns
- boolean - The state of the operation
- string - Error message, If there is a failure on the operation
cycleTrades()
Description
Forces a villager to reset its trades
Returns
- boolean - The state of the operation
- string - Error message, If there is a failure on the operation