Package com.shanebeestudios.coreapi.util
Class ItemBuilder
java.lang.Object
com.shanebeestudios.coreapi.util.ItemBuilder
Build an ItemStack
-
Method Summary
Modifier and TypeMethodDescriptionaddEnchant(@NotNull Enchantment enchantment, int level) Add an enchantment to this itemAdd a line of lore to the lore of this itemamount(int amount) Modify the amount of this itembuild()Build this builder into an ItemStackstatic ItemBuilderCreate a new builderstatic ItemBuilderCreate a new builderstatic ItemBuilderCreate a new builderstatic ItemBuilderCreate a new builderfood(@NotNull Consumer<FoodComponent> food) Modify the food component of this itemSet the lore of this itemModify the ItemMeta of this itemSet the name of this itemtool(@NotNull Consumer<ToolComponent> tool) Modify the tool component of this itemModify the NMS ItemStack of this item<T> ItemBuildervanillaComponent(@NotNull net.minecraft.core.component.DataComponentType<T> type, T value) Add a vanilla component to this item
-
Method Details
-
builder
Create a new builder- Parameters:
material- Material to create- Returns:
- New builder
-
builder
Create a new builder- Parameters:
material- Material to createamount- Amount of ItemStack- Returns:
- New builder
-
builder
Create a new builder- Parameters:
type- ItemType to create- Returns:
- New builder
-
builder
Create a new builder- Parameters:
type- ItemType to createamount- Amount of ItemStack- Returns:
- New builder
-
amount
Modify the amount of this item- Parameters:
amount- Amount of item- Returns:
- Builder
-
name
Set the name of this item- Parameters:
name- Name of item- Returns:
- Builder
-
lore
Set the lore of this item- Parameters:
lore- Lore to set- Returns:
- Builder
-
addLore
Add a line of lore to the lore of this item- Parameters:
lore- Lore to add- Returns:
- Builder
-
addEnchant
Add an enchantment to this item- Parameters:
enchantment- Enchantment to addlevel- Level of enchantment to add- Returns:
- Builder
-
food
Modify the food component of this item- Parameters:
food- Food component to modify- Returns:
- Builder
-
tool
Modify the tool component of this item- Parameters:
tool- Tool component to modify- Returns:
- Builder
-
meta
Modify the ItemMeta of this item- Parameters:
meta- ItemMeta to modify- Returns:
- Builder
-
vanillaComponent
public <T> ItemBuilder vanillaComponent(@NotNull @NotNull net.minecraft.core.component.DataComponentType<T> type, @Nullable T value) Add a vanilla component to this item- Type Parameters:
T- Class type of component- Parameters:
type- Type of component to addvalue- Value to add- Returns:
- Builder
-
vanilla
Modify the NMS ItemStack of this item- Parameters:
vanilla- NMS ItemStack to modify- Returns:
- Builder
-
build
Build this builder into an ItemStack- Returns:
- ItemStack from builder
-