Build Path Problem in Hour 3

15 views
Skip to first unread message

Endia Williams

unread,
May 12, 2016, 4:51:33 PM5/12/16
to Sams Teach Yourself Minecraft Mod Development in 24 Hours
I am having a seemingly small but frustrating issue with the build path. I'm in Hour 3 and I just got done crafting my first couple of recipes, which produce an apple and a carrot because I haven't made the custom items for the recipes yet, although they will produce a unique item later on down the road. This is the code I've got so far, with additional imports having been added from the generic ones in the first couple of chapters due to Eclipse telling me that they needed to be added. I suspect this may be related to my problem, since this isn't mentioned in the book.

package com.endiabanana.avatarmod;

import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraft.item.ItemStack;

@Mod(modid = AvatarMod.MODID, version = AvatarMod.VERSION)
public class AvatarMod
{
    public static final String MODID = "endiabanana_avatarmod";
    public static final String VERSION = "1.0";
    
    @EventHandler
    public void init(FMLInitializationEvent event)
    {
        GameRegistry.addRecipe(new ItemStack(Items.apple),
        "A A",
        " A ",
        "BCD",
        'A', Items.string, 'B', Blocks.stained_glass, 3, 'C', Items.glass_bottle, 'D', Blocks.stained_glass, 11
        );
        
        GameRegistry.addRecipe(new ItemStack(Items.carrot),
        "A A",
        " A ",
        "BCD",
        'A', Items.string, 'B', Blocks.stained_glass, 11, 'C', Items.glass_bottle, 'D', Blocks.stained_glass, 3
        );
    }
}

The errors I'm getting are

Project 'MDKExample' is missing required source folder: 'src/main/java'

and

Project 'MDKExample' is missing required source folder: 'src/main/resources'

I created the package for my mod in src/main/java as instructed so I really have no idea what's going on. What did I do wrong? Thanks.

Jimmy Koene

unread,
May 20, 2016, 6:03:11 AM5/20/16
to Sams Teach Yourself Minecraft Mod Development in 24 Hours
Hi,

Did you test your project any earlier or is this the first time you started it up? Also, did you make any changes in the setup since creating it?

Kind regards,

Jimmy Koene

Endia Williams

unread,
May 20, 2016, 10:53:43 AM5/20/16
to Sams Teach Yourself Minecraft Mod Development in 24 Hours
I tested the project earlier and I had no issue. No, the only thing I did was create the package as instructed in the right folder, copy the code over and edit it to include my recipes and my own mod name etc, and then add the imports it told me I needed to add because I was getting errors like it didn't recognize GameRegistry so I had to add an import.
Reply all
Reply to author
Forward
0 new messages