Interface ItemType

All Superinterfaces:
ComponentLike, DataHolder, DataHolder.Immutable<ItemType>, DefaultedRegistryValue, Taggable<ItemType>, ValueContainer

A type of item.
  • Method Details

    • block

      Gets the corresponding BlockType of this item if one exists.
      Returns:
      The Block
    • container

      Optional<ItemType> container()
      Gets the container item of this item if one exists.

      e.g. ItemTypes.BUCKET for ItemTypes.WATER_BUCKET

      Returns:
      The container item.
    • maxStackQuantity

      int maxStackQuantity()
      Gets the default maximum quantity for ItemStacks of this item.
      Returns:
      Max stack quantity
    • rarity

      ItemRarity rarity()
      Gets the default ItemRarity for this ItemType.
      Returns:
      The default rarity for the item type.
    • isAnyOf

      boolean isAnyOf(Supplier<? extends ItemType>... types)
      Returns true if this type is any of the given item types
      Parameters:
      types - the item types to check
      Returns:
      true if this type is any of the given item types
    • isAnyOf

      boolean isAnyOf(ItemType... types)
      Returns true if this type is any of the given item types
      Parameters:
      types - the item types to check
      Returns:
      true if this type is any of the given item types