Jump to content

Custom creative tabs in forge 1.18


ClEeVEeR

Recommended Posts

I would like to make a creative tab for my mod

My issue is probably verry obvious but I dont know how to tell the item to go in the group

Here is the code:

package io.github.ClEeVEeRYT.Everlandia.ever.init;

import io.github.ClEeVEeRYT.Everlandia.Everlandia;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.ItemLike;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;

public final class EverItemInit {
    private EverItemInit() {}

    public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, Everlandia.MODID);

    public static final RegistryObject<BlockItem> MUSH_DIRT =ITEMS.register("mush_dirt", () -> new BlockItem(EverBlockInit.MUSH_DIRT.get(), new Item.Properties().tab());

    public static class EnderGroup extends CreativeModeTab {

        public EnderGroup() {
            super("end_everlandia_tab");
        }

        @Override
        public ItemStack makeIcon() {
        return new ItemStack (EverItemInit.MUSH_DIRT.get()));
        }
    }
}

Thanks in advance

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.