Block
BlockNamehere
package net.minecraft.src; import java.util.Random; public class BlockNamehere extends Block { public BlockNamehere(int i, int j) { super(i, j, Material.ground); } public int idDropped(int i, Random random) { return mod_Namehere.Namehere.blockID; } public int quantityDropped(Random random) { return 3; } }
mod_Namehere
package net.minecraft.src; public class mod_Namehere extends BaseMod { public static Block Namehere = new BlockNamehere(190, 0).setHardness(1.0F).setResistance(6000.0F).setLightValue(1.0F).setBlockName("Namehere"); public String Version() { return "1.8.1"; } public mod_Namehere() { ModLoader.RegisterBlock(Namehere); Namehere.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Namehere.png"); ModLoader.AddName(Namehere, "Namehere"); ModLoader.AddRecipe(new ItemStack(Namehere, 1), new Object[] { "###", "###", "###", Character.valueOf('#'), Item.redstone }); } }
Help: BlockNamehere
- Firstly, if you want to use some functions for your block, then have a look in "Block.java".
1. The line with this:
super(i, j, Material.ground);. All you need to focus on is the "Material.ground" part. It can be any of the following:
//FOR MORE STATS ON THESE MATERIALS, LOOK AT THE BOTTOM OF "Material.java". Material air; //You probably shouldn't use this one. Material grass; //Pretty much the same as ground. Material ground; //The block can be harvested when broken using this one. Material wood; //It can be set on fire. Material rock; // It can only be harvested with a pickaxe. Material iron; // Can only be harvested with an iron pick or better. Material water; //You probably shouldn't use this one. Material lava; //You probably shouldn't use this one. Material leaves; //It can burn. Material plants; //You probably shouldn't use this one. Material vine; //It can burn. Material sponge; //You probably shouldn't use this one. Material cloth; //It can burn. Material fire; //You probably shouldn't use this one. Material sand; //You probably shouldn't use this one. Material circuits; //You probably shouldn't use this one. Material glass; //You probably shouldn't use this one. Material tnt; //You probably shouldn't use this one. Material unused; //You probably shouldn't use this one. Material ice; //You probably shouldn't use this one. Material snow; //You probably shouldn't use this one. Material craftedSnow; //You probably shouldn't use this one. Material cactus; //You probably shouldn't use this one. Material clay; //You probably shouldn't use this one. Material pumpkin; //You probably shouldn't use this one. Material portal; //You probably shouldn't use this one. Material cakeMaterial; //You probably shouldn't use this one. Material web; //You probably shouldn't use this one. Means it isn't solid. Material piston; //You probably shouldn't use this one.
The main ones you need should use are the ground, rock and iron ones.
2. At this part:
return mod_Namehere.Namehere.blockID;. If you leave it as it is now, it will drop the block you are making. If you want it to drop an item that is already part of the game, make it something like this:
return Item.redstone.shiftedIndex;. For a block:
return Block.dirt.blockID;
3. For the bit like this:
return 3;. You can make it drop more than one just by changing the "3" to whatever you want.
4. Navigate to this sort of path: "MCP\src\minecraft\net\minecraft\src" and save a copy of your file in there with the ".java" extension.
Help: mod_Namehere
1. This bit:
new BlockNamehere(190,The 190 is the "ID" of your block. Block ID's can only go up to 255! Change it to an ID that isn't above 255 and isn't taken already by a block in the game.
2.
.setHardness(1.0F)Is how hard it is to mine. For reference, dirt is 0.5F and stone is 1.5F.
3.
.setResistance(6000.0F)Is how resistant to TNT the block is. For reference, all of the ores are 5.0F and obsidian is 2000.0F.
4.
.setLightValue(1.0F)Is how much light you want it to give off (NOTE: The highest it can go is 1.0F!). For reference, torches are 0.9375F and redstone torches are 0.5F.
5.
.setBlockName("Namehere")Is the name that it will look for in your code as the "code name".
6. At this part:
return "1.8.1";in the version method, you can make that whatever you want in-between the " marks. It will show up in the modloader error log so people know what version it's made for.
7.
ModLoader.RegisterBlock(Namehere);Is telling modloader to well, register the block.
8.
Namehere.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Namehere.png");Is where your texture is found and what it is called. Change the "/Namehere.png" to what it's called. If you wanted to be able to find it in a folder of the minecraft.jar, make it something like this: "/My Folder!/Namehere.png".
9.
ModLoader.AddName(Namehere, "Nameingamehere");Is what it is called in-game. Make the first "Namehere" what you called the block in the ".setBlockName("Namehere")" part. The second "Namehere" is what it's called in-game.
10. To explain the "ModLoader.AddRecipe" part. The "Namehere" word is what you get from crafting it, and the 1 is how many of it you get. Each set of "###" bits are 3 spaces across in the crafting grid. Then it's saying that "If the character is the # symbol, make it equal to redstone for when crafting".
6
You get tons of comments saying "No pix no clix".
You begin to get worried of getting alot of hate...
And now you end up here!
So first, take screenshots of your mod!
To do this press F2 for the in-game screenshot tool(fn+F2 for Macs)!
Or use a screenshot tool!
Next, open up imgur.com.
Hit the computer button and locate your .minecraft(C:/Users/YOURUSERNAME/%Appdata%/Roaming/.minecraft folder or wherever you saved the pictures in and select the pictures(ctrl-click for windows, command-click for macs).
Hit done and Hit upload!
Now, once the pictures are done uploading, copy and paste the forum BBCode wherever you want it to be in your post!
Thanks for reading, and if i helped, press the + at the bottom-right of this post!
1
1
Use that tutorial. Even though its for 1.8.1, it works fine. And you have to make the textures yourself!
Remember to hit the +1 in the bottom right of this post if i helped!
1
[size="5"]I vote that Mojang and the creators of MC-Edit should come together and implement the MCEdit program within Minecraft.[/size]
[size="6"]Current Ideas:
-Make the button in the main menu so that users won't experience crashing problems if entering Edit Mode directly from within the game.
-No lite versions. This means that it has to include all the features directly and not release updates. WE WAIT or NOT AT ALL!
-Implement new features like say being able to directly place mobs and introduce a live editing system so that we can edit the world while it works such as creative mode but we can duplicate and other tools like that.
-NO EXTRA DOWNLOADS! If a user were to update to the MC-Edit Minecraft, they would not need to first get some external programs. INCLUDE IT WITHIN THE UPDATES!
[/size]
[size="5"]If you support this, please hit the + on the bottom right of this post or use the signature(s) below![/size]
Banners:
Code:
1