Package net.minestom.server.item
Interface ItemStack.Builder
- All Superinterfaces:
TagWritable
- Enclosing interface:
ItemStack
-
Method Summary
Modifier and TypeMethodDescription@NotNull ItemStack.Builderamount(int amount) @NotNull ItemStackbuild()default @NotNull ItemStack.BuildercustomModelData(int customModelData) 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.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) default <T> @NotNull ItemStack.BuilderMethods inherited from interface net.minestom.server.tag.TagWritable
removeTag, setTag
-
Method Details
-
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_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 default <T> @NotNull ItemStack.Builder set(@NotNull @NotNull Tag<T> tag, @Nullable T value) -
build
-