Class ItemTagFilter

java.lang.Object
alexiil.mc.lib.attributes.item.filter.ItemTagFilter
All Implemented Interfaces:
ItemFilter, ReadableItemFilter, ResolvableItemFilter

public final class ItemTagFilter extends Object implements ResolvableItemFilter
A ResolvableItemFilter that matches any Items in a Tag.
  • Field Details

    • tag

      public final net.minecraft.tag.Tag<net.minecraft.item.Item> tag
  • Constructor Details

    • ItemTagFilter

      public ItemTagFilter(net.minecraft.tag.Tag<net.minecraft.item.Item> tag)
  • Method Details

    • resolve

      public ReadableItemFilter resolve()
      Description copied from interface: ResolvableItemFilter
      Resolves this ReadableItemFilter. Note that this must return one of the valid types of ReadableItemFilter, except this!

      This is intended for use-cases where you actually need to read the filter - for other cases there's usually little reason to call this, as "matches" should be faster for most reasonable implementations. (However some implementations - for example lambdas - might be faster to call multiple times if you resolve them before checking them).

      Specified by:
      resolve in interface ResolvableItemFilter