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
(@NotNull List<Float> floats, @NotNull List<Boolean> flags, @NotNull List<String> strings, @NotNull List<RGBLike> colors) default @NotNull ItemStack.Builder
customName
(@NotNull Component customName) default @NotNull ItemStack.Builder
glowing()
default @NotNull ItemStack.Builder
glowing
(boolean glowing) @NotNull ItemStack.Builder
Hides all components which append tooltip lines usingDataComponents.TOOLTIP_DISPLAY
.default @NotNull ItemStack.Builder
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
-
itemModel
-
customModelData
-
glowing
-
glowing
-
maxStackSize
-
hideExtraTooltip
Hides all components which append tooltip lines using
DataComponents.TOOLTIP_DISPLAY
. The result should be an item with only name and lore. -
set
@Contract("_, _ -> this") @NotNull <T> @NotNull ItemStack.Builder set(@NotNull @NotNull Tag<T> tag, @Nullable T value) -
setTag
-
build
-