Package net.minestom.server.item
Interface ItemStack.Builder
- Enclosing interface:
ItemStack
public static sealed interface ItemStack.Builder
-
Method Summary
Modifier and TypeMethodDescription@NotNull ItemStack.Builderamount(int amount) @NotNull ItemStackbuild()default @NotNull ItemStack.BuildercustomModelData(@NotNull List<Float> floats, @NotNull List<Boolean> flags, @NotNull List<String> strings, @NotNull List<RGBLike> colors) default @NotNull ItemStack.BuildercustomName(@NotNull Component customName) default @NotNull ItemStack.Builderglowing()default @NotNull ItemStack.Builderglowing(boolean glowing) @NotNull ItemStack.BuilderSets all available tooltip hide flags.default @NotNull ItemStack.Builderdefault @NotNull ItemStack.Builderdefault @NotNull ItemStack.Builder@NotNull ItemStack.Builderdefault @NotNull ItemStack.BuildermaxStackSize(int maxStackSize) @NotNull ItemStack.Builderremove(@NotNull DataComponent<?> component) default @NotNull ItemStack.Builderset(@NotNull DataComponent<Unit> component) <T> @NotNull ItemStack.Builderset(@NotNull DataComponent<T> component, T value) <T> @NotNull ItemStack.Builderdefault <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
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_MODIFIERSwill 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
-