Class CustomItemDefinition.SimpleBuilder

java.lang.Object
cn.nukkit.item.customitem.CustomItemDefinition.SimpleBuilder
Direct Known Subclasses:
CustomItemDefinition.ArmorBuilder, CustomItemDefinition.EdibleBuilder, CustomItemDefinition.ToolBuilder
Enclosing class:
CustomItemDefinition

public static class CustomItemDefinition.SimpleBuilder extends Object
  • Field Details

    • identifier

      protected final String identifier
    • nbt

      protected final CompoundTag nbt
  • Constructor Details

  • Method Details

    • allowOffHand

      public CustomItemDefinition.SimpleBuilder allowOffHand(boolean allowOffHand)
      是否允许副手持有

      Whether to allow the offHand to have

    • handEquipped

      public CustomItemDefinition.SimpleBuilder handEquipped(boolean handEquipped)
      控制第三人称手持物品的显示方式

      Control how third-person handheld items are displayed

    • foil

      public CustomItemDefinition.SimpleBuilder foil(boolean foil)
      Parameters:
      foil - 自定义物品是否带有附魔光辉效果
      whether or not the item has an enchanted light effect
    • creativeGroup

      public CustomItemDefinition.SimpleBuilder creativeGroup(String creativeGroup)
      控制自定义物品在创造栏的分组,例如所有的附魔书是一组

      Control the grouping of custom items in the creation inventory, e.g. all enchantment books are grouped together

      See Also:
    • renderOffsets

      public CustomItemDefinition.SimpleBuilder renderOffsets(@NonNull @NonNull RenderOffsets renderOffsets)
      控制自定义物品在不同视角下的渲染偏移

      Control rendering offsets of custom items at different viewpoints

    • tag

      向自定义物品添加一个tag,通常用于合成等

      Add a tag to a custom item, usually used for crafting, etc. todo: 2022/12/13 检查是否真的在客户端起作用

      Parameters:
      tag - the tag
    • customBuild

      public CustomItemDefinition customBuild(Consumer<CompoundTag> nbt)
      对要发送给客户端的物品ComponentNBT进行自定义处理,这里包含了所有对自定义物品的定义。在符合条件的情况下,你可以任意修改。

      Custom processing of the item to be sent to the client ComponentNBT, which contains all definitions for custom item. You can modify them as much as you want, under the right conditions.

    • build

      public CustomItemDefinition build()
    • calculateID

      protected CustomItemDefinition calculateID()
    • addRepairItems

      @Since("1.19.40-r1") protected CustomItemDefinition.SimpleBuilder addRepairItems(@NonNull @NonNull List<Item> repairItems, String molang)