类 ItemBuilder

java.lang.Object
cn.afternode.commons.bukkit.gui.ItemBuilder

public class ItemBuilder extends Object
Tool for create an item
  • 构造器详细资料

    • ItemBuilder

      public ItemBuilder(org.bukkit.Material material)
      Primary constructor
      参数:
      material - material
  • 方法详细资料

    • material

      public ItemBuilder material(org.bukkit.Material material)
      Set material for this item
      参数:
      material - material
      返回:
      this
    • material

      public org.bukkit.Material material()
      Get material of this item
      返回:
      material
    • name

      public ItemBuilder name(net.kyori.adventure.text.ComponentLike name)
      Set name of this item
      参数:
      name - Name or null as default
      返回:
      this
      另请参阅:
      • ItemMeta.displayName(Component)
    • name

      public ItemBuilder name(net.kyori.adventure.text.Component name)
      Set name of this item
      参数:
      name - Name or null as default
      返回:
      this
    • name

      public ItemBuilder name(MessageBuilder builder)
      Set name of this item from builder
      参数:
      builder - builder
      返回:
      this
    • name

      public net.kyori.adventure.text.Component name()
      Get name of this item
      返回:
      name
    • lore

      public ItemBuilder lore(net.kyori.adventure.text.ComponentLike... lore)
      Add lore to this item
      参数:
      lore - lore
      返回:
      this
    • lore

      public ItemBuilder lore(MessageBuilder... lore)
      Add lore to this item
      参数:
      lore - lore
      返回:
      this
    • lore

      public ItemBuilder lore(net.kyori.adventure.text.Component... lore)
      Add lore to this item
      参数:
      lore - lore
      返回:
      this
    • newLore

      public ItemBuilder newLore()
      Reset lore of this item
      返回:
      this
    • model

      public ItemBuilder model(Integer model)
      Set custom model data for this item, null to clear
      参数:
      model - model
      返回:
      this
      另请参阅:
      • ItemMeta.setCustomModelData(Integer)
    • model

      public Integer model()
      Get current custom model data
      返回:
      data
    • enchant

      public ItemBuilder enchant(org.bukkit.enchantments.Enchantment enchantment, int level)
      Set enchantment level for this item
      参数:
      enchantment - enchantment
      level - level
      返回:
      this
      另请参阅:
      • ItemMeta.addEnchant(Enchantment, int, boolean)
    • removeEnchant

      public ItemBuilder removeEnchant(org.bukkit.enchantments.Enchantment enchantment)
      Remove enchantment from this item
      参数:
      enchantment - enchantment
      返回:
      this
    • enchant

      public Integer enchant(org.bukkit.enchantments.Enchantment enchantment)
      Get enchantment level of this item
      参数:
      enchantment - enchantment
      返回:
      level
    • clearEnchantments

      public ItemBuilder clearEnchantments()
      Clear existing enchantments
      返回:
      this
    • flag

      public ItemBuilder flag(org.bukkit.inventory.ItemFlag... flags)
      Add flags for this item
      参数:
      flags - flags
      返回:
      this
    • removeFlags

      public ItemBuilder removeFlags(org.bukkit.inventory.ItemFlag... flags)
      Remove flags from this item
      参数:
      flags - flags
      返回:
      this
    • flags

      public Set<org.bukkit.inventory.ItemFlag> flags()
      Get flags from this item
      返回:
      flags
    • clearFlags

      public ItemBuilder clearFlags()
      Clear existing flags
      返回:
      this
    • unbreakable

      public ItemBuilder unbreakable(boolean unbreakable)
      Set unbreakable tag
      参数:
      unbreakable - value
      返回:
      this
      另请参阅:
      • ItemMeta.setUnbreakable(boolean)
    • unbreakable

      public boolean unbreakable()
      Get unbreakable tag value
      返回:
      value
    • attribute

      public ItemBuilder attribute(org.bukkit.attribute.Attribute attribute, org.bukkit.attribute.AttributeModifier... modifiers)
      Add attribute modifier
      参数:
      attribute - attribute
      modifiers - modifiers
      返回:
      this
      另请参阅:
      • ItemMeta.addAttributeModifier(Attribute, AttributeModifier)
    • attribute

      public Collection<org.bukkit.attribute.AttributeModifier> attribute(org.bukkit.attribute.Attribute attribute)
      Get modifiers of an attribute
      参数:
      attribute - attribute
      返回:
      modifiers
    • attributes

      public com.google.common.collect.Multimap<org.bukkit.attribute.Attribute,org.bukkit.attribute.AttributeModifier> attributes()
      Get existing attribute modifiers from this item
      返回:
      modifiers
    • clearAttributes

      public ItemBuilder clearAttributes()
      Clear existing attribute modifiers
      返回:
      this
    • build

      public org.bukkit.inventory.ItemStack build()
      Convert to item
      返回:
      result item