There are A LOT of different modding tutorials out there for 1.7.2...
BUT...
They sometimes don't get updated don't have more advanced tutorials for more experienced coders and don't keep things organized(well, most do, but some don't)
THEN I THOUGHT...
Why not make my own modding tutorials for New Coders AND Experienced Coders...
1: Download Eclipse
2: Download Minecraft Forge SRC 1.7.2 RECOMMENDED (UNDER THE FILES TAB NEAR TOP OF PAGE)
2A: YOU MUST HAVE THE LATEST JAVA JRE FROM ORACLE!!!!!!!!!!!! OR THIS WONT WORK!!!!!!
3: Unzip Eclipse and MC Forge 1.7.2 to your desktop
4: open CMDFOR WINDOWS
4A: Start Menu->Seearch Bar->Type "cmd" (w/out quotes) and hit enterFOR MAC
4B: Open terminal in the Application/Utilities folder
5: type in terminal(or CMD) "cd (drag the forge folder into the terminal window)" (w/out quotes) and hit enter
6: type "gradlew setupDecompWorkspace" (EXACTLY AS SPELLED AND W/OUT QUOTES) and hit enter
7: wait for it to finish
8: when it's done type "gradlew eclipse" (w/out quotes) and hit enter
9: Wait for it to finish
10: Open up eclipse
11: When it asks for a workspace navigate to Desktop/forge(or whatever your "forge" folder is called)/eclipse
12: When it starts up you should see a Minecraft folder in the "Package Explorer"
13: IF you don't, go through the steps again and see if you skipped over one by accident
14: IF it still doesn't work, PM me whats wrong and i'll try and help as best as i can
15: If all is well, your officially setup to mod MC 1.7.2!!! HOORAY!!!
STEP 2: SETTING UP YOUR MAIN MOD FILE
FIRST!!
0: Delete the package inside the src/main/java SRC folder
1: Create a new Package in the src/main/java folder in eclipse and call it gmail(or other mail provider).whateveryouremailaddressIs.com so that your mod package name wont clash with other mod package names
2: create a new Class and call it "Main" w/out qoutes
CODE:
package gmail.whateveryouremailaddressIs.com;
@Mod(modid="YourModsID", version="YourModsVersion")
public class Main
{
public static String MODID = "modid";
public static String VERSION = "version";
@EventHandler
public void preInit(FMLPreInitializationEvent e)
{
}
@EventHandler
public void init(FMLInitializationEvent e)
{
}
@EventHandler
public void postInit(FMLPostInitializationEvent e)
{
}
}
Press Shift+CTRL+O for windows and SHIFT+Apple Key+O to import all imports
YOUR MAIN MOD FILE IS NOW SETUP!!!!!!
STEP 3: en_US.lang file THIS IS TO NAME EVERYTHING
1: create a new package in src/main/java and name it "assets.YOURMODSID.lang" w/out quotes
2: create a new file in the new package you just created and name it "en_US.lang" again...w/out quotes
tile.yourBlock.name=Whatever You Want To Name Your Block (this is for blocks)
item.yourItem.name=Whatever You Want To Name Your Item (this is for items)
itemGroup.tabName=Whatever You Want To Name Your Creative Tab (this is for Creative Tabs)
THIS FILE IS VERY IMPORTANT...DO NOT DELETE
STEP 4: the mcmod.info file
FIRST: Delete everything in the src/main/resources SRC folder
SECOND: Create a new mcmod.info file in that SRC folder
FIRST: Create a new class in gmail.YOUREMAIL.com and call it DropHandler
DropHandler.java
package gmail.YOUREMAIL.com;
import java.util.Random;
import net.minecraft.entity.passive.EntityCow;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public class DropHandler
{
public static Random random;
public static int dropped;
@SubscribeEvent
public void onEntityDrop(LivingDropsEvent event)
{
random = new Random();
dropped = random.nextInt(2) + 1; //DO NOT CHANGE THIS
if(event.entityLiving instanceof EntityCow)
{
event.entityLiving.entityDropItem(new ItemStack(Items.apple), dropped);
}
}
}
EXPLANATION
if(event.entityLiving instanceof EntityCow /*This can be any mob in the game*/)
{
event.entityLiving.entityDropItem(new ItemStack(Item.apple /*This can be any item or block in the game*/), dropped);
}
SECOND: Add this to your public void init constructor
FIRST: create a new package in src/main/java and call it gmail.whateveryouremailis.tools
Main.java
package gmail.email.com;
@Mod(modid="YourModID", version="YourModVersion")
public class Main
{
public static String MODID = "YourModID";
public static String VERSION = "YourModVersion";
public static CreativeTabs tabName = new CreativeTabs("tabName")
{
public Item getTabIconItem()
{
return Items.arrow;
}
};
public static final Item.ToolMaterial TUTORIALMATERIAL = EnumHelper.addToolMaterial("TUTORIALMATERIAL", 2, 192, 5.0F, 1.5F, 12);
/*You can call the Material whatever you want.
The first number in the brakets is the harvest level.
Level 0 (gold and wood) can't mine iron ore...
Level 1 (stone) can't mine gold ore...
Level 2 (iron) can't mine obsidian.
Level 3 (diamond) can mine every breakable block.
The second number of uses of the Material.
wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32
The third number is the strength against blocks.
wood = 2.0F, stone = 4.0F, iron = 6.0F, diamond = 8.0F, gold 12.0F
The fourth number is the damage against entities.
wood = 0.0F, stone = 1.0F, iron = 2.0F, diamond = 3.0F, gold 0.0F
The last number is enchantability factor of the Material.
wood = 15, stone = 5, iron = 14, diamond = 10, gold 22*/
public static Item tutAxe;
public static Item tutPickaxe;
public static Item tutShovel;
public static Item tutSword;
public static Item tutHoe; //Hoes are useless...a wooden one will work just as good, but you can add it if you like
@EventHandler
public void preInit(FMLPreInitializationEvent e)
{
tutAxe = new TutorialAxe(TUTORIALMATERIAL).setUnlocalizedName("tutAxe").setCreativeTab(tabName).setTextureName(MODID + ":" + "tutAxe.png");
GameRegistry.registerItem(tutAxe, "tutAxe");
/*Do the same thing for the rest of them, i.e., tutPickaxe, tutShovel, tutSword, and tutHoe*/
}
@EventHandler
public void init(FMLInitializationEvent e)
{
}
@EventHandler
public void postInit(FMLPostInitializationEvent e)
{
}
}
Create these next classes in the tools package
TutorialAxe.java
package gmail.email.tools;
import net.minecraft.item.ItemAxe * /*And This*/;
public class TutorialAxe * /*Change to TutorialSword, TutorialShovel, etc. Respectively*/ extends ItemAxe * /*this too*/
{
public TutorialAxe * /*And This*/(ToolMaterial material)
{
super(material);
}
}
Now do the SAME THING with all of the other classes, TutorialSword, TutorialShovel, etc.
The * shows you where you need to change things according to their respected classes...
Custom Creative Tab
package gmail.email.com;
@Mod(modid="YourModID", version="YourModVersion")
public class Main
{
public static String MODID = "YourModID";
public static String VERSION = "YourModVersion";
public static CreativeTabs tabName = new CreativeTabs("tabName")
{
public Item getTabIconItem()
{
return Items.arrow;
}
};
@EventHandler
public void preInit(FMLPreInitializationEvent e)
{
}
@EventHandler
public void init(FMLInitializationEvent e)
{
}
@EventHandler
public void postInit(FMLPostInitializationEvent e)
{
}
}
EXPLANATION
public static CreativeTabs tabName = new CreativeTabs("tabName")
{
public Item getTabIconItem()
{
return Items.arrow;
}
}
This creates the tab with the tab ID of tabName and sets the icon of the tab to an arrow
Textures
Textures are different
to texture something you need to...
FIRST: create a new package in src/main/java called assets.YOURMODID.textures.blocks(or items, or armor, etc..depending on what you want to texture)
SECOND: create a texture for your object using GIMP or MSPaint(in my opinion MSPaint sucks)
THIRD: export the texture to "the forge folder on your desktop/src/main/java/assets/YOURMODID/textures/blocks(or items, or armor, etc...you get the idea)"
Fourth: put these lines of code when you type in your blocks/items/etc.. contructor, for example
FOR BLOCKS
yourBlock = new YourBlock(Material.rock).setCreativeTab(tabName).setBlockName("canBeAnything")
put after that(you may already know from seeing my block tut), .setBlockTextureName(MODID + ":" + "THENAMEOFTHETEXTUREYOUCREATED.png");
package gmail.email.com;
@Mod(modid="YourModID", version="YourModVersion")
public class Main
{
public static String MODID = "YourModID";
public static String VERSION = "YourModVersion";
public static CreativeTabs tabName = new CreativeTabs("tabName")
{
public Item getTabIconItem()
{
return Items.arrow;
}
};
//Items (This is called a comment, they're optional)
public static Item yourItem
@EventHandler
public void preInit(FMLPreInitializationEvent e)
{
}
@EventHandler
public void init(FMLInitializationEvent e)
{
yourItem = new YourItem().setCreativeTab(tabName).setUnlocalizedName("thisCanBeAnything").setTextureName(MODID + ":" + "yourItem.png");
GameRegistry.registerBlock(yourItem, "thisCanBeAnything");
}
@EventHandler
public void postInit(FMLPostInitializationEvent e)
{
}
}
Create a new package in your src/main/java folder called gmail.YOUREMAILADDRESS.items
Create a new class in that package called YourItem(whatever you called it after the yourItem = new YourItem in your main mod file)
YourItem.java
package gmail.YOUREMAILADDRESS.items;
public class YourItem extends Item
{
public void YourItem()
{
super();
}
}
Custom Block
package gmail.email.com;
@Mod(modid="YourModID", version="YourModVersion")
public class Main
{
public static String MODID = "YourModID";
public static String VERSION = "YourModVersion";
public static CreativeTabs tabName = new CreativeTabs("tabName")
{
public Item getTabIconItem()
{
return Items.arrow;
}
};
//Blocks (This is called a comment, they're optional)
public static Block yourBlock;
@EventHandler
public void preInit(FMLPreInitializationEvent e)
{
}
@EventHandler
public void init(FMLInitializationEvent e)
{
yourBlock = new YourBlock(Material.whatevermaterialyouchoose).setCreativeTab(tabName).setBlockName("thisCanBeAnything").setBlockTextureName(MODID + ":" + "yourBlock.png");
GameRegistry.registerBlock(yourBlock, "thisCanBeAnything");
}
@EventHandler
public void postInit(FMLPostInitializationEvent e)
{
}
}
EXPLANATION
public static Block yourBlock;
This Creates an instance for your block that can be used by any class(as long as it has the static modifier)
yourBlock = new YourBlock(Material.whatevermaterialyouchoose).setCreativeTab(tabName).setBlockName("thisCanBeAnything").setBlockTextureName(MODID + ":" + "yourBlock.png");
GameRegistry.registerBlock(yourBlock, "thisCanBeAnything");
This creates parameters for your block, i.e. the name etc...and registers it in game
Create a new package in your src/main/java folder called gmail.YOUREMAILADDRESS.blocks
Create a new class in that package called YourBlock(whatever you called it after the yourBlock = new YourBlock in your main mod file)
YourBlock
package gmail.YOUREMAILADDRESS.blocks;
public class YourBlock extends Block
{
public void YourBlock(Material material)
{
super(material);
}
}
I think that this is self explanatory
LOOK AT THE TEXTURE TUTORIAL TO FIND OUT HOW TO TEXTURE BLOCKS/ITEMS/TOOLS/ARMOR
Custom Ores!
Pre-FIRST! Goto your Main.java and add this in under your public static Block block; //Or whatever you called it
public static IWorldGenerator gen = new NewWorldGenerator();
After-Pre-First! put this in your public init constructor!
GameRegistry.registerWorldGen(gen, 1 /*This is the importance at which to generate the contents of the file, leave it at 1*/);
FIRST! Create a block like you normally would!
SECOND! Create a package in src/main/java and call it gmail.YOUREMAIL.com.generation
THIRD! Create a new class in that package and call it NewWorldGenerator.
package gmail.email.generation;
import java.util.Random;
import net.minecraft.src.BiomeGenBase;
import net.minecraft.src.IChunkProvider;
import net.minecraft.src.World;
import cpw.mods.fml.common.IWorldGenerator;
public class NewWorldGenerator implements IWorldGenerator
{
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
switch(world.provider.dimensionId)
{
case -1:
generateInNether(world, random, chunkX * 16, chunkZ * 16);
break;
case 0:
generateInOverworld(world, random, chunkX * 16, chunkZ * 16);
break;
case 1:
generateInEnd(world, random, chunkX * 16, chunkZ * 16);
break;
}
}
private void generateInNether(World world, Random random, int chunkX, int chunkZ)
{
//You can do the same here
}
private void generateInOverworld(World world, Random random, int chunkX, int chunkZ)
{
if(i = 0; i < 10; i++) //This is the rarity, so, it has a one out of ten chances of spawn in a given chunk
{
int x = chunkX + random.nextInt(16); //DO NOT CHANGE THIS NUMBER
int y = random.nextInt(64); //ONLY CHANGE THIS ONE, IT SETS THE MAX HEIGHT AT WHICH IT GENERATES
int z = random.nextInt(16); //DO NOT CHANGE THIS NUMBER
(new NewWorldGenerator(Main.whatYouCalledYourOreIn public static Block yourOre /*I.E. rubyOre*/, 10 /*This is the amount of ores in a given vein*/)).generate(world, random, chunkX, chunkY, chunkZ);
}
}
private void generateInEnd(World world, Random random, int chunkX, int chunkZ)
{
//Or here, if you want
}
Advanced Tutorials
Custom Generated INSTANT Structures
Prerequisites:
You NEED to know how to make a block, if you don't, look at my tutorial on making custom block
FIRST:
Create a new class in your blocks package called BlockInstantStructure(or whatever you called your block in the public init constructor)
CODE:
Main.java
package gmail.email.com;
@Mod(modid="YourModID", version="YourModVersion")
public class Main
{
public static String MODID = "YourModID";
public static String VERSION = "YourModVersion";
public static CreativeTabs tabName = new CreativeTabs("tabName")
{
public Item getTabIconItem()
{
return Items.arrow;
}
};
//Blocks (This is called a comment, they're optional)
public static Block blockInstantStructure;
@EventHandler
public void preInit(FMLPreInitializationEvent e)
{
}
@EventHandler
public void init(FMLInitializationEvent e)
{
blockInstantStructure = new BlockInstantStructure(Material.whatevermaterialyouchoose).setCreativeTab(tabName).setBlockName("thisCanBeAnything").setBlockTextureName(MODID + ":" + "blockInstantStructure.png");
GameRegistry.registerBlock(blockInstantStructure, "thisCanBeAnything");
}
@EventHandler
public void postInit(FMLPostInitializationEvent e)
{
}
}
BlockInstantStructure.java
package gmail.email.com;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class BlockInstantStructure extends Block
{
Blocks b;
public BlockInstantStructure(Material material)
{
super(material);
}
public void onBlockPlacedBy(World world, Random random, int x, int y, int z, EntityLivingBase entity, ItemStack itemstack)
{
//Super
super.onBlockPlacedBy(world, x, y, z, entity, itemstack);
//Sets the block to air on the x, y, and z coords from where you placed the block
world.setBlockToAir(x, y, z);
//Sets the block on the x, y, and z coords starting from where you placed the block
world.setBlock(x, y, z, b.cobblestone);
//Sets the block(with set metadata) on the x, y, and z coords from where you placed the block
world.setBlock(x, y, z, b.planks, 2, 2); //This is for birch planks, if you want other planks, search 'Minecraft Block Metadata' in google or find it on the MinecraftWiki
}
}
EXPLANATION
The onBlockPlacedBy generates a new structure when the block is placed by an Entity
The world.setBlock sets the block according to the coords that you predefined
DISCLAIMER: It can get VERY messy, like, super messy, so be sure that you know where your placing the block in the world
I.E. to make the block be placed UP, one, you must set it to setBlock(x, y+1, z, b.cobblestone); and to make it go LEFT, one, set the x factor to x+1, same to make it go DEEPER, one, set z to z+1, and y-1 will make it go one block down, and x-1 will make it go RIGHT, one, and z-1 will make it go FORWARD, one, and it can be any number, i.e., x+2, x+3, x+4, etc., z+2, z+3, z+4, etc., y+2, y+3, y+4, etc., same for the minus's
MAKE SURE THAT YOU PUT THE world.setBlockToAir(x, y, z); FIRST, OR IT'LL MAKE THE BLOCK THAT YOU REPLACED THE INSTANT STRUCTURE BLOCK WITH DISAPPEAR
Custom World Gen
First things first, in your main mod file, ad this code:
[left]
public static YourWorldGenerator worldGen = new YourWorldGenerator(); // This is your world generation file.
public void init(FMLInitializationEvent e)
{
GameRegistry.registerWorldGenerator(worldGen); // Add this in your @Init method.
}[/left]
Second, create a new package in src/main/java and call it generation
Third, create a new class in the generation package and call it YourWorldGenerator(or whatever you called it), and put this in it
[left]
package gmail.email.generation;
import java.util.Random;
import net.minecraft.src.BiomeGenBase;
import net.minecraft.src.IChunkProvider;
import net.minecraft.src.World;
import cpw.mods.fml.common.IWorldGenerator;
public class TestWorldGenerator implements IWorldGenerator
{
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
switch(world.provider.dimensionId)
{
case -1:
generateInNether(world, random, chunkX * 16, chunkZ * 16);
break;
case 0:
generateInOverworld(world, random, chunkX * 16, chunkZ * 16);
break;
case 1:
generateInEnd(world, random, chunkX * 16, chunkZ * 16);
break;
}
}
private void generateInNether(World world, Random random, int chunkX, int chunkZ)
{
//You can do the same here
}
private void generateInOverworld(World world, Random random, int chunkX, int chunkZ)
{
if(i = 0; i < 10; i++)
{
int x = chunkX + random.nextInt(16); //DO NOT CHANGE THIS NUMBER
int y = random.nextInt(64); //ONLY CHANGE THIS ONE, IT SETS THE MAX HEIGHT AT WHICH IT GENERATES
int z = random.nextInt(16); //DO NOT CHANGE THIS NUMBER
new WorldGenTut().generate(world, random, chunkX, chunkY, chunkZ);
}
}
private void generateInEnd(World world, Random random, int chunkX, int chunkZ)
{
//Or here, if you want
}[/left]
Fourth, create, in the generation package, a new class and call it WorldGenTut
package gmail.email.generation;
import java.util.Random;
import net.minecraft.src.BiomeGenBase;
import net.minecraft.src.IChunkProvider;
import net.minecraft.src.World;
import cpw.mods.fml.common.IWorldGenerator;
public class WorldGenTut implements IWorldGenerator
{
public void generate(World world, Random random, int x, int y, int z)
{
//Look at my Custom Instant structure generation tutorial to learn how to generate structures
}
}
You should let gradle add your mod version and Minecraft target version to mcmod.info
"version": "$version","mcversion": "$mcversion",
Put that in mcmod.info instead of hand editing in the version, that way you only maintain the version number in one place.Note that this means during testing (i.e. when run from within Eclipse), mcmod.info may not be created properly. Guaranteed that when you do a final 'gradlew build', the resulting jar file will have a correct mcmod.info and your mod will be ready for release.
Thank you! i was wondering why it said that in the example mod file because im used to just entering in my verion and mcversion. I'll edit the tut right away.
BTW, I'm SUPER glad that people are checking out my tuts, I've never been able to keep a successful topic running. I'm pouring my all into this one!!!!!
@EventHandler
public preInit(FMLPreInitializationEvent e)
{
}
@EventHandler
public init(FMLInitializationEvent e)
{
}
@EventHandler
public postInit(FMLPostInitializationEvent e)
I keep getting this : Return type for the method is missing. Help?
Yes, sorry about that, i recently changed my main mod file tut myself. Just add "@EventHandler" above all those constructors(w/out quotes) like i did in your quote
The Meaning of Life, the Universe, and Everything.
Join Date:
10/22/2012
Posts:
43
Minecraft:
JoeyBaboeyMan
Xbox:
Joey The Baboey
Member Details
I was wondering, should I leave the en_US.lang file as it is? Also, my Creative tab won't come up, does it need an item to work, or is this because I left the en_US.lang file alone?
so i was trying out the instant structure tutorial, now, it doesnt give any errors, but it doesnt do anything either
what is it suposed to do? it sounds interresting, but i cant seem to figure out what it needs to do
thanks
Prerequisites:
You NEED to know how to make a block, if you don't, look at my tutorial on making custom blocks
I was wondering, should I leave the en_US.lang file as it is? Also, my Creative tab won't come up, does it need an item to work, or is this because I left the en_US.lang file alone?
yes, when you create the en_US.lang, you add certain lines of text into it so that you can name the stuff that you put in your mod, for instance, in the blank en_US.lang file, add:
tile.yourBlock.name=Whatever You Want To Name Your Block (this is for blocks)
item.yourItem.name=Whatever You Want To Name Your Item (this is for items)
itemGroup.tabName=Whatever You Want To Name Your Creative Tab (this is for Creative Tabs)
Before 1.7 came out, forge used a language registry system that was a little complicated and cluttered up your main mod file in my opinion, then they switched to the lang file to make it easier
so i was trying out the instant structure tutorial, now, it doesnt give any errors, but it doesnt do anything either
what is it suposed to do? it sounds interresting, but i cant seem to figure out what it needs to do
thanks
Another thing, if it still doesn't work, send me a pic of your main mod file and your BlockStructureGen(or whatever you named it) file
it gets the block, it just doesnt do anything after i placed it, though i understood that it should create a structure. in the tutorial case something with cobble and planks and it looks the same as yours(copied everything over)
I think i may know what your problem is...
If you copied it over, make sure that you put the world.setBlockToAir(x, y, z); as the first thing in the constructor, otherwise, if you dont, it'll set the block to air after it replaces the block that you placed down with the block that you specified
public BlockStructure(Material p_i45394_1_) {
super(p_i45394_1_);
}
public void OnBlockPlacedBy(World world, Random random, int x, int y, int z
, EntityLivingBase entity, ItemStack itemstack){
world.setBlockToAir(x, y, z);
world.setBlock(x, y, z, b.cobblestone);
world.setBlock(x, y, z, b.planks, 2, 2);
}
}
edit: an idea for another tutorial, how to do custom keybinds (:
I think it may be because in that constructor, you set to air, then to cobblestone, then to birch planks, try placeing your block in the world and right clicking or something, your problem is confuzzling me, i'm tring to wrap my mind around it and see what's up
mmm right clicking does nothing, and i also cleared the set to air, and the others to see if that would work, but it doesnt seem to do anything right now
Hmmmmmmmm, interesting, i'm still confused, anyway you could send me a screenshot of your classes?
There are A LOT of different modding tutorials out there for 1.7.2...
BUT...
They sometimes don't get updated don't have more advanced tutorials for more experienced coders and don't keep things organized(well, most do, but some don't)
THEN I THOUGHT...
Why not make my own modding tutorials for New Coders AND Experienced Coders...
WELL HERE IT IS...
IANTHESLIME'S
MINECRAFT FORGE
MODDING TUTORIALS FOR
MINECRAFT 1.7.2
(Sorry for the long intro...)
ALWAYS IMPORT
Windows: Shift+Ctrl+O
Mac: Shift+COMMAND+O
STEP 1: SETTING UP YOUR WORKSPACE
1: Download Eclipse
2: Download Minecraft Forge SRC 1.7.2 RECOMMENDED (UNDER THE FILES TAB NEAR TOP OF PAGE)
2A: YOU MUST HAVE THE LATEST JAVA JRE FROM ORACLE!!!!!!!!!!!! OR THIS WONT WORK!!!!!!
3: Unzip Eclipse and MC Forge 1.7.2 to your desktop
4: open CMDFOR WINDOWS
4A: Start Menu->Seearch Bar->Type "cmd" (w/out quotes) and hit enterFOR MAC
4B: Open terminal in the Application/Utilities folder
5: type in terminal(or CMD) "cd (drag the forge folder into the terminal window)" (w/out quotes) and hit enter
6: type "gradlew setupDecompWorkspace" (EXACTLY AS SPELLED AND W/OUT QUOTES) and hit enter
7: wait for it to finish
8: when it's done type "gradlew eclipse" (w/out quotes) and hit enter
9: Wait for it to finish
10: Open up eclipse
11: When it asks for a workspace navigate to Desktop/forge(or whatever your "forge" folder is called)/eclipse
12: When it starts up you should see a Minecraft folder in the "Package Explorer"
13: IF you don't, go through the steps again and see if you skipped over one by accident
14: IF it still doesn't work, PM me whats wrong and i'll try and help as best as i can
15: If all is well, your officially setup to mod MC 1.7.2!!! HOORAY!!!
FIRST!!
0: Delete the package inside the src/main/java SRC folder
1: Create a new Package in the src/main/java folder in eclipse and call it gmail(or other mail provider).whateveryouremailaddressIs.com so that your mod package name wont clash with other mod package names
2: create a new Class and call it "Main" w/out qoutes
CODE:
Press Shift+CTRL+O for windows and SHIFT+Apple Key+O to import all imports
YOUR MAIN MOD FILE IS NOW SETUP!!!!!!
1: create a new package in src/main/java and name it "assets.YOURMODSID.lang" w/out quotes
2: create a new file in the new package you just created and name it "en_US.lang" again...w/out quotes
THIS FILE IS VERY IMPORTANT...DO NOT DELETE
FIRST: Delete everything in the src/main/resources SRC folder
SECOND: Create a new mcmod.info file in that SRC folder
mcmod.info
Begginer Tutorials
Custom Mob Drops!!!
FIRST: Create a new class in gmail.YOUREMAIL.com and call it DropHandler
DropHandler.java
EXPLANATION
SECOND: Add this to your public void init constructor
FIRST: create a new package in src/main/java and call it gmail.whateveryouremailis.tools
Main.java
Create these next classes in the tools package
TutorialAxe.java
Now do the SAME THING with all of the other classes, TutorialSword, TutorialShovel, etc.
The * shows you where you need to change things according to their respected classes...
EXPLANATION
This creates the tab with the tab ID of tabName and sets the icon of the tab to an arrow
Textures are different
to texture something you need to...
FIRST: create a new package in src/main/java called assets.YOURMODID.textures.blocks(or items, or armor, etc..depending on what you want to texture)
SECOND: create a texture for your object using GIMP or MSPaint(in my opinion MSPaint sucks)
THIRD: export the texture to "the forge folder on your desktop/src/main/java/assets/YOURMODID/textures/blocks(or items, or armor, etc...you get the idea)"
Fourth: put these lines of code when you type in your blocks/items/etc.. contructor, for example
FOR BLOCKS
IT'S THE SAME THING FOR ITEMS AND EVERYTHING ELSE
Create a new package in your src/main/java folder called gmail.YOUREMAILADDRESS.items
Create a new class in that package called YourItem(whatever you called it after the yourItem = new YourItem in your main mod file)
YourItem.java
EXPLANATION
This Creates an instance for your block that can be used by any class(as long as it has the static modifier)
This creates parameters for your block, i.e. the name etc...and registers it in game
Create a new package in your src/main/java folder called gmail.YOUREMAILADDRESS.blocks
Create a new class in that package called YourBlock(whatever you called it after the yourBlock = new YourBlock in your main mod file)
YourBlock
I think that this is self explanatory
LOOK AT THE TEXTURE TUTORIAL TO FIND OUT HOW TO TEXTURE BLOCKS/ITEMS/TOOLS/ARMOR
Pre-FIRST! Goto your Main.java and add this in under your public static Block block; //Or whatever you called it
After-Pre-First! put this in your public init constructor!
FIRST! Create a block like you normally would!
SECOND! Create a package in src/main/java and call it gmail.YOUREMAIL.com.generation
THIRD! Create a new class in that package and call it NewWorldGenerator.
Advanced Tutorials
Custom Generated INSTANT Structures
Prerequisites:
You NEED to know how to make a block, if you don't, look at my tutorial on making custom block
FIRST:
Create a new class in your blocks package called BlockInstantStructure(or whatever you called your block in the public init constructor)
CODE:
Main.java
BlockInstantStructure.java
EXPLANATION
The onBlockPlacedBy generates a new structure when the block is placed by an Entity
The world.setBlock sets the block according to the coords that you predefined
DISCLAIMER: It can get VERY messy, like, super messy, so be sure that you know where your placing the block in the world
I.E. to make the block be placed UP, one, you must set it to setBlock(x, y+1, z, b.cobblestone); and to make it go LEFT, one, set the x factor to x+1, same to make it go DEEPER, one, set z to z+1, and y-1 will make it go one block down, and x-1 will make it go RIGHT, one, and z-1 will make it go FORWARD, one, and it can be any number, i.e., x+2, x+3, x+4, etc., z+2, z+3, z+4, etc., y+2, y+3, y+4, etc., same for the minus's
MAKE SURE THAT YOU PUT THE world.setBlockToAir(x, y, z); FIRST, OR IT'LL MAKE THE BLOCK THAT YOU REPLACED THE INSTANT STRUCTURE BLOCK WITH DISAPPEAR
Custom World Gen
First things first, in your main mod file, ad this code:
Second, create a new package in src/main/java and call it generation
Third, create a new class in the generation package and call it YourWorldGenerator(or whatever you called it), and put this in it
Fourth, create, in the generation package, a new class and call it WorldGenTut
PLANNED TUTORIALS
BEGGINER
Custom Tools -
Custom Armor -
Custom Tree -
ADVANCED
Custom Tree -
Custom Dimension -
Custom Mob -
Custom Furnace -
Custom Chest -
Custom Crafting Table -
HOW MY PACKAGES ARE SETUP IN ECLIPSE
IM WORKING ON A NEW MOD
It's called SoSAO, i.e., Swords of Sword Art Online, it'll have some of the various swords from the anime in it, i hope to expound upon it later...
IK, IK, im so very busy, sorry...im putting it up as im posting this
Image Removed
Yes, sorry about that, i recently changed my main mod file tut myself. Just add "@EventHandler" above all those constructors(w/out quotes) like i did in your quote
public preInit(FMLPreInitializationEvent e)
public init(FMLInitializationEvent e)
and the
public postInit(FMLPostInitializationEvent
areas, even with the @EventHandler, do I need to make a file, change something, or what?
IMAGE
EDIT: Nevermind, it still works *FACEPALM*
Image Removed
put void before preInit, init, and postInit, if that still won't work, show me the error and i'll see what i can do
Image Removed
yes, when you create the en_US.lang, you add certain lines of text into it so that you can name the stuff that you put in your mod, for instance, in the blank en_US.lang file, add:
tile.yourBlock.name=Whatever You Want To Name Your Block (this is for blocks)
item.yourItem.name=Whatever You Want To Name Your Item (this is for items)
itemGroup.tabName=Whatever You Want To Name Your Creative Tab (this is for Creative Tabs)
Before 1.7 came out, forge used a language registry system that was a little complicated and cluttered up your main mod file in my opinion, then they switched to the lang file to make it easier
Another thing, if it still doesn't work, send me a pic of your main mod file and your BlockStructureGen(or whatever you named it) file
I think i may know what your problem is...
If you copied it over, make sure that you put the world.setBlockToAir(x, y, z); as the first thing in the constructor, otherwise, if you dont, it'll set the block to air after it replaces the block that you placed down with the block that you specified
Image Removed
I would be able to help a lot more if i could see screenshots of your class files
Image Removed
Not at all
I think it may be because in that constructor, you set to air, then to cobblestone, then to birch planks, try placeing your block in the world and right clicking or something, your problem is confuzzling me, i'm tring to wrap my mind around it and see what's up
Hmmmmmmmm, interesting, i'm still confused, anyway you could send me a screenshot of your classes?