Interface ItemStack.Builder

Enclosing interface:
ItemStack

public static sealed interface ItemStack.Builder
  • Method Details

    • material

      @Contract("_ -> this") @NotNull @NotNull ItemStack.Builder material(@NotNull @NotNull Material material)
    • amount

      @Contract("_ -> this") @NotNull @NotNull ItemStack.Builder amount(int 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

      @NotNull default @NotNull ItemStack.Builder customName(@NotNull @NotNull Component customName)
    • lore

      @NotNull default @NotNull ItemStack.Builder lore(@NotNull @NotNull Component... lore)
    • lore

      @NotNull default @NotNull ItemStack.Builder lore(@NotNull @NotNull List<Component> lore)
    • customModelData

      @NotNull default @NotNull ItemStack.Builder customModelData(int customModelData)
    • glowing

      @NotNull default @NotNull ItemStack.Builder glowing()
    • glowing

      @NotNull default @NotNull ItemStack.Builder glowing(boolean glowing)
    • maxStackSize

      @NotNull default @NotNull ItemStack.Builder maxStackSize(int maxStackSize)
    • hideExtraTooltip

      @NotNull @NotNull ItemStack.Builder 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

      default <T> void setTag(@NotNull @NotNull Tag<T> tag, @Nullable T value)
    • build

      @Contract(value="-> new", pure=true) @NotNull @NotNull ItemStack build()