Interface ItemEnchantments.Builder
- All Superinterfaces:
DataComponentBuilder<ItemEnchantments>
,ShownInTooltip.Builder<ItemEnchantments.Builder>
- Enclosing interface:
ItemEnchantments
@Experimental
@NonExtendable
public static interface ItemEnchantments.Builder
extends ShownInTooltip.Builder<ItemEnchantments.Builder>, DataComponentBuilder<ItemEnchantments>
Builder for
ItemEnchantments
.-
Method Summary
Modifier and TypeMethodDescriptionadd
(Enchantment enchantment, @org.checkerframework.common.value.qual.IntRange(from=1L, to=255L) int level) Adds an enchantment with the given level to this component.addAll
(Map<Enchantment, @IntRange(from=1L,to=255L) Integer> enchantments) Adds enchantments with the given level to this component.Methods inherited from interface io.papermc.paper.datacomponent.DataComponentBuilder
build
Methods inherited from interface io.papermc.paper.datacomponent.item.ShownInTooltip.Builder
showInTooltip
-
Method Details
-
add
@Contract(value="_, _ -> this", mutates="this") ItemEnchantments.Builder add(Enchantment enchantment, @org.checkerframework.common.value.qual.IntRange(from=1L, to=255L) int level) Adds an enchantment with the given level to this component.- Parameters:
enchantment
- enchantmentlevel
- level- Returns:
- the builder for chaining
- See Also:
-
addAll
@Contract(value="_ -> this", mutates="this") ItemEnchantments.Builder addAll(Map<Enchantment, @IntRange(from=1L,to=255L) Integer> enchantments) Adds enchantments with the given level to this component.- Parameters:
enchantments
- enchantments- Returns:
- the builder for chaining
- See Also:
-