@LexManos I think I've made a lot more concise!!!!
package jetcobblestone.firstmod;
import jetcobblestone.firstmod.lists.itemList;
import net.minecraft.item.Foods;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
public class ItemsLoader
{
@SubscribeEvent
public static void registerItems(final RegistryEvent.Register<Item> event)
{
event.getRegistry().registerAll
(
itemList.hair_fibre = new Item(new Item.Properties().food(Foods.COOKIE).group(ItemGroup.FOOD).maxStackSize(1)).setRegistryName(location("hair_fibre"))
);
}
private static ResourceLocation location(String name)
{
return new ResourceLocation(FirstMod.modid, name);
}
}
I didn't realise you could have the @Mod.EventBus... outside of a class, but I understand now that it's meant to go outside a class, thanks to your reply
Also I think you have a few haters
Don't know why though... you've been really helpful
Also, do you have any suggested improvements? Like for efficiency or smmin.
For example I don't know if there is a better way to do that helper method at the end, or if it's even advised.
I'm really happy I got this to work without copying code straight from a tutorial! I'm now really excited for this, as it will be really easy to navigate in the future.
Again, is it advised to separate everything into different classes for efficiency? It certainly makes code easier to navigate.
Edit: I only just realised ur the guy who makes forge lmao
Really nice to see somebody so high up in the community help on small posts like this one!