Class CreativeTabX

java.lang.Object
org.moddingx.libx.creativetab.CreativeTabX

public abstract class CreativeTabX extends Object
Class to register and populate a creative tab. You should subclass it and create an instance in your mods' constructor.
  • Field Details

    • mod

      protected final ModX mod
    • id

      protected final net.minecraft.resources.ResourceLocation id
  • Constructor Details

    • CreativeTabX

      protected CreativeTabX(ModX mod)
    • CreativeTabX

      protected CreativeTabX(ModX mod, String name)
  • Method Details

    • tab

      public net.minecraft.world.item.CreativeModeTab tab()
      Gets the creative tab.
      Throws:
      IllegalArgumentException - if the tab has not yet been created.
    • buildTab

      protected void buildTab(net.minecraft.world.item.CreativeModeTab.Builder builder)
      Sets some basic creative tab information. This is not for tab contents. The default implementation just sets the tab title.
    • addItems

      protected abstract void addItems(CreativeTabX.TabContext ctx)
      Adds the items to the tab.
    • addModItems

      protected void addModItems(CreativeTabX.TabContext ctx)
      Adds all items from the current mod into the tab.
    • addModItems

      protected void addModItems(CreativeTabX.TabContext ctx, Comparator<net.minecraft.world.item.Item> order)
      Adds all items from the current mod into the tab using a custom order.
    • addModItems

      protected void addModItems(CreativeTabX.TabContext ctx, Predicate<net.minecraft.world.item.Item> items)
      Adds all items from the current mod, that match a predicate into the tab.
    • addModItems

      protected void addModItems(CreativeTabX.TabContext ctx, Comparator<net.minecraft.world.item.Item> order, Predicate<net.minecraft.world.item.Item> items)
      Adds all items from the current mod, that match a predicate into the tab using a custom order.
    • addModItemStacks

      protected void addModItemStacks(CreativeTabX.TabContext ctx, Function<net.minecraft.world.item.Item,Stream<net.minecraft.world.item.ItemStack>> stacks)
      Generates a stream of item stacks for each item from the current mod and adds the stacks to the tab.
    • addModItemStacks

      protected void addModItemStacks(CreativeTabX.TabContext ctx, Comparator<net.minecraft.world.item.Item> order, Function<net.minecraft.world.item.Item,Stream<net.minecraft.world.item.ItemStack>> stacks)
      Generates a stream of item stacks for each item from the current mod and adds the stacks to the tab using a custom order.