Package net.minestom.server.item
Interface ItemStack.Builder
- Enclosing interface:
ItemStack
public static sealed interface ItemStack.Builder
-
Method Summary
Modifier and TypeMethodDescription@NotNull ItemStack.Builder
amount
(int amount) @NotNull ItemStack
build()
default @NotNull ItemStack.Builder
customModelData
(int customModelData) default @NotNull ItemStack.Builder
customName
(@NotNull Component customName) default @NotNull ItemStack.Builder
glowing()
default @NotNull ItemStack.Builder
glowing
(boolean glowing) @NotNull ItemStack.Builder
Sets all available tooltip hide flags.default @NotNull ItemStack.Builder
default @NotNull ItemStack.Builder
@NotNull ItemStack.Builder
default @NotNull ItemStack.Builder
maxStackSize
(int maxStackSize) @NotNull ItemStack.Builder
remove
(@NotNull DataComponent<?> component) default @NotNull ItemStack.Builder
set
(@NotNull DataComponent<Unit> component) <T> @NotNull ItemStack.Builder
set
(@NotNull DataComponent<T> component, T value) <T> @NotNull ItemStack.Builder
default <T> void
-
Method Details
-
material
@Contract("_ -> this") @NotNull @NotNull ItemStack.Builder material(@NotNull @NotNull Material material) -
amount
-
set
@Contract("_, _ -> this") @NotNull <T> @NotNull ItemStack.Builder set(@NotNull @NotNull DataComponent<T> component, T value) -
set
@Contract("_ -> this") @NotNull default @NotNull ItemStack.Builder set(@NotNull @NotNull DataComponent<Unit> component) -
remove
@Contract("_ -> this") @NotNull @NotNull ItemStack.Builder remove(@NotNull @NotNull DataComponent<?> component) -
customName
-
lore
-
lore
-
customModelData
-
glowing
-
glowing
-
maxStackSize
-
hideExtraTooltip
Sets all available tooltip hide flags. The result should be an item with only name and lore.
One notable behavior here is that
ItemComponent.ATTRIBUTE_MODIFIERS
will be added if it is not present. This is because armor flags in tooltips use attribute modifiers show flag to display or not, but are not actually based on the attribute modifiers component. -
set
@Contract("_, _ -> this") @NotNull <T> @NotNull ItemStack.Builder set(@NotNull @NotNull Tag<T> tag, @Nullable T value) -
setTag
-
build
-