Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.author.example.lists;
- import com.author.example.Main;
- import net.minecraft.item.*;
- import net.minecraftforge.fml.RegistryObject;
- import net.minecraftforge.registries.DeferredRegister;
- import net.minecraftforge.registries.ForgeRegistries;
- public class ItemList {
- public static final ItemGroup EXAMPLE = Main.EXAMPLE_TAB;
- // ItemGroup.MISC for vanilla item groups
- public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, Main.MOD_ID);
- public static final RegistryObject<Item> MOD_ORE = ITEMS.register("mod_ore", () -> new Item(new Item.Properties().group(EXAMPLE)));
- public static final RegistryObject<Item> MOD_CROP = ITEMS.register("mod_crop", () -> new Item(new Item.Properties().food(FoodList.MOD_CROP).group(EXAMPLE)));
- public static final RegistryObject<Item> MOD_SEEDS = ITEMS.register("mod_seeds", () -> new BlockItem(BlockList.MOD_CROP.get(), new Item.Properties().group(EXAMPLE)));
- public static final RegistryObject<Item> MOD_BERRIES = ITEMS.register("mod_berry_bush", () -> new BlockItem(BlockList.MOD_BERRY_BUSH.get(), new Item.Properties().food(FoodList.MOD_BERRIES).group(EXAMPLE)));
- public static final RegistryObject<Item> MOD_FLUID_BUCKET = ITEMS.register("mod_fluid_bucket", () -> new BucketItem(() -> FluidList.MOD_STILL_FLUID.get(), new Item.Properties().group(EXAMPLE).maxStackSize(1)));
- // Not necessary to create block items here since a subscribe event does this in the main class
- //public static final RegistryObject<Item> BLOCK_OF_MOD_ORE = ITEMS.register("block_of_mod_ore", () -> new BlockItem(BlockList.BLOCK_OF_MOD_ORE.get(), new Item.Properties().group(EXAMPLE)));
- //public static final RegistryObject<Item> MOD_PLANKS = ITEMS.register("mod_planks", () -> new BlockItem(BlockList.MOD_PLANKS.get(), new Item.Properties().group(EXAMPLE)));
- //public static final RegistryObject<Item> MOD_SLAB = ITEMS.register("mod_slab", () -> new BlockItem(BlockList.MOD_SLAB.get(), new Item.Properties().group(EXAMPLE)));
- //public static final RegistryObject<Item> MOD_STAIRS = ITEMS.register("mod_stairs", () -> new BlockItem(BlockList.MOD_STAIRS.get(), new Item.Properties().group(EXAMPLE)));
- //public static final RegistryObject<Item> MOD_WALL = ITEMS.register("mod_wall", () -> new BlockItem(BlockList.MOD_WALL.get(), new Item.Properties().group(EXAMPLE)));
- }
Advertisement
Add Comment
Please, Sign In to add comment