ItemsForEmeralds

Link to itemsforemeralds

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.villager.trade.type.ItemsForEmeralds;

已实现的接口

Link to 已实现的接口

ItemsForEmeralds implements the following interfaces. That means all methods defined in these interfaces are also available in ItemsForEmeralds

Constructor #构造函数

Link to constructor-构造函数

ZenScript
Copy
new ItemsForEmeralds(item as ItemDefinition, emeraldCost as int, numberOfItems as int, villagerXp as int) as ItemsForEmeralds
new ItemsForEmeralds(<item:minecraft:diamond>, 2, 4, 2);
参数类型描述
参数
item
类型
ItemDefinition
描述
The Item that is being sold by the villager
参数
emeraldCost
类型
int
描述
How many emeralds will be given to the villager
参数
numberOfItems
类型
int
描述
The amount of the Item being sold to the villager
参数
villagerXp
类型
int
描述
How much experience does this trade reward the villager
ZenScript
Copy
new ItemsForEmeralds(block as Block, emeraldCost as int, numberOfItems as int, maxUses as int, villagerXp as int) as ItemsForEmeralds
new ItemsForEmeralds(<block:minecraft:dirt>, 2, 4, 8, 2);
参数类型描述
参数
block #方块
类型
Block
描述
The Block that is being sold by the villager
参数
emeraldCost
类型
int
描述
How many emeralds will be given to the villager
参数
numberOfItems
类型
int
描述
The amount of the Block being sold to the villager
参数
maxUses
类型
int
描述
How many times can this trade be used
参数
villagerXp
类型
int
描述
How much experience does this trade reward the villager
ZenScript
Copy
new ItemsForEmeralds(itemStack as ItemStack, emeraldCost as int, numberOfItems as int, maxUses as int, villagerXp as int, priceMultiplier as float) as ItemsForEmeralds
new ItemsForEmeralds(<item:minecraft:diamond>, 2, 4, 8, 2, 0.05);
参数类型描述
参数
物品应用
类型
物品应用
描述
The Item that is being sold by the villager
参数
emeraldCost
类型
int
描述
How many emeralds will be given to the villager
参数
numberOfItems
类型
int
描述
The amount of the Item being sold to the villager
参数
maxUses
类型
int
描述
How many times can this trade be used
参数
villagerXp
类型
int
描述
How much experience does this trade reward the villager
参数
priceMultiplier
类型
float
描述
How much the price is affected by demand, Hero of the Village, and village reputation