Recipe
public class MerchantRecipe extends Object implements Recipe
VillagerReplenishTradeEvent
Constructor | Description |
---|---|
MerchantRecipe(ItemStack result,
int maxUses) |
|
MerchantRecipe(ItemStack result,
int uses,
int maxUses,
boolean experienceReward) |
Modifier and Type | Method | Description |
---|---|---|
void |
addIngredient(ItemStack item) |
|
List<ItemStack> |
getIngredients() |
|
int |
getMaxUses() |
Get the maximum number of uses this trade has.
|
ItemStack |
getResult() |
Get the result of this recipe.
|
int |
getUses() |
Get the number of times this trade has been used.
|
boolean |
hasExperienceReward() |
Whether to reward experience for the trade.
|
void |
removeIngredient(int index) |
|
void |
setExperienceReward(boolean flag) |
Set whether to reward experience for the trade.
|
void |
setIngredients(List<ItemStack> ingredients) |
|
void |
setMaxUses(int maxUses) |
Set the maximum number of uses this trade has.
|
void |
setUses(int uses) |
Set the number of times this trade has been used.
|
public MerchantRecipe(@NotNull ItemStack result, int maxUses)
public MerchantRecipe(@NotNull ItemStack result, int uses, int maxUses, boolean experienceReward)
@NotNull public ItemStack getResult()
Recipe
public 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 for completing this tradeCopyright © 2020. All rights reserved.