Recipepublic class MerchantRecipe extends Object implements Recipe
VillagerReplenishTradeEvent| Constructor | Description | 
|---|---|
MerchantRecipe(ItemStack result,
              int maxUses) | 
|
MerchantRecipe(ItemStack result,
              int uses,
              int maxUses,
              boolean experienceReward) | 
|
MerchantRecipe(ItemStack result,
              int uses,
              int maxUses,
              boolean experienceReward,
              int villagerExperience,
              float priceMultiplier) | 
| Modifier and Type | Method | Description | 
|---|---|---|
void | 
addIngredient(ItemStack item) | 
|
List<ItemStack> | 
getIngredients() | 
|
int | 
getMaxUses() | 
 Get the maximum number of uses this trade has. 
 | 
float | 
getPriceMultiplier() | 
 Gets the additive price multiplier for the cost of this trade. 
 | 
ItemStack | 
getResult() | 
 Get the result of this recipe. 
 | 
int | 
getUses() | 
 Get the number of times this trade has been used. 
 | 
int | 
getVillagerExperience() | 
 Gets the amount of experience the villager earns from this trade. 
 | 
boolean | 
hasExperienceReward() | 
 Whether to reward experience to the player for the trade. 
 | 
void | 
removeIngredient(int index) | 
|
void | 
setExperienceReward(boolean flag) | 
 Set whether to reward experience to the player for the trade. 
 | 
void | 
setIngredients(List<ItemStack> ingredients) | 
|
void | 
setMaxUses(int maxUses) | 
 Set the maximum number of uses this trade has. 
 | 
void | 
setPriceMultiplier(float priceMultiplier) | 
 Sets the additive price multiplier for the cost of this trade. 
 | 
void | 
setUses(int uses) | 
 Set the number of times this trade has been used. 
 | 
void | 
setVillagerExperience(int villagerExperience) | 
 Sets the amount of experience the villager earns from this trade. 
 | 
public MerchantRecipe(@NotNull
                      ItemStack result,
                      int maxUses)
public MerchantRecipe(@NotNull
                      ItemStack result,
                      int uses,
                      int maxUses,
                      boolean experienceReward)
public MerchantRecipe(@NotNull
                      ItemStack result,
                      int uses,
                      int maxUses,
                      boolean experienceReward,
                      int villagerExperience,
                      float priceMultiplier)
@NotNull public ItemStack getResult()
Recipepublic void addIngredient(@NotNull
                          ItemStack item)
public void removeIngredient(int index)
public int getUses()
public void setUses(int uses)
uses - the number of usespublic int getMaxUses()
public void setMaxUses(int maxUses)
maxUses - the maximum number of time this trade can be usedpublic boolean hasExperienceReward()
public void setExperienceReward(boolean flag)
flag - whether to reward experience to the player for completing
 this tradepublic int getVillagerExperience()
public void setVillagerExperience(int villagerExperience)
villagerExperience - new experience amountpublic float getPriceMultiplier()
public void setPriceMultiplier(float priceMultiplier)
priceMultiplier - new price multiplierCopyright © 2019. All rights reserved.