Class ItemCustom

java.lang.Object
cn.nukkit.item.Item
cn.nukkit.item.StringItem
cn.nukkit.item.customitem.ItemCustom
All Implemented Interfaces:
BlockID, ItemID, Cloneable
Direct Known Subclasses:
ItemCustomArmor, ItemCustomEdible, ItemCustomTool

@PowerNukkitXOnly @Since("1.6.0.0-PNX") public abstract class ItemCustom extends StringItem
继承这个类实现自定义物品,重写Item中的方法控制方块属性

Inherit this class to implement a custom item, override the methods in the Item to control the feature of the item.

Author:
lt_name
  • Constructor Details

    • ItemCustom

      public ItemCustom(@Nonnull String id, @Nullable String name)
    • ItemCustom

      public ItemCustom(@Nonnull String id, @Nullable String name, @Nonnull String textureName)
  • Method Details

    • getDefinition

      public abstract CustomItemDefinition getDefinition()
      该方法设置自定义物品的定义

      This method sets the definition of custom item

    • clone

      public ItemCustom clone()
      Overrides:
      clone in class StringItem
    • getTextureName

      public String getTextureName()