Welcome, my username is SCMowns (if you didn't already know) and I'm going to be showing you some very basic steps in order to start modding. My coding series has started on 1.2.5 so you're not to late to join in! and with my simple tutorials you'll be making mods fast and simple! Soon were gonna be going into some Minecraft forge coding and doing some advance tutorials. So how about it! Begin modding!
To see where am at, check out my YouTube playlist!
This thread will be updated a lot! With new tutorials / coding videos / SRC code downloads!
Videos and SRC codes!
If in version 1.5.1 of Minecraft coding from episodes 1-27 MIGHT not work for you!
1. Setting up MCP( Minecraft Coder Pack) Modloader ( 1.2.5 / 1.3.2 / 1.4.x / 1.5.1/ 1.5.2 )
[media][media][/media[/media]]
In the video I show you how to set up MCP. To get the downloads click on the links below (pick your version)
Minecraft 1.2.5
Minecraft 1.3.2
Minecraft 1.4.2
Minecraft 1.4.4
Minecraft 1.4.5
Minecraft 1.4.6
Minecraft 1.5.1
Minecraft 1.5.2
[media][media][/media[/media]]
You need a software that can allow you to make transparent pictures, like Paint.net
Mod_NAME
package net.minecraft.src; import java.util.Random; public class mod_NAME extends BaseMod { public static final Item NAMEhere = new ItemNAME(2085).setItemName("NAME"); public void load() { NAMEhere.iconIndex = ModLoader.addOverride("/gui/items.png" , "/items/pic.png"); ModLoader.addName(NAMEhere, "Ingame -Name"); } public String getVersion() { return "3.14159265"; } }
To understand this code is quite simple, public class final Item is telling Minecraft that you are making a new item, the (2085) is the Item ID, and the .setItemName("NAME"); is required, but dosn't need a fancy name! in the public void load() section, you will tell modloader where your items is located at, what is needed in order to craft it, and what the name is. My tutorial mentions all this.
ItemNAME:
package net.minecraft.src; import java.util.Random; public class ItemNAME extends Item { public ItemNAME(int i) { super(i); maxStackSize = 64; } public String Version() { return "3.14159265"; } }
Here is another separate class you will need to make. This will define the Item of how much it can stack and to make it an official item registered onto Minecraft
My picture that I used in this tutorial can be downloaded here! (16x16)
[media][media][/media[/media]]
public static final Item NAMESword = new ItemSword(3077, EnumToolMaterial.GOLD).setItemName("AnythingHere");
In my tutorial i might have mentioned to edit a BASE class, don't do it! in this code of line you will need to make a new sword and later define it in your public void load. replace NAME with the name of your sword.
paste this in your public void load()
NAMESword.iconIndex = ModLoader.addOverride("/gui/items.png" , "/items/sword.png"); ModLoader.addName(NAMESword, "NAME Sword"); ModLoader.addRecipe(new ItemStack(NAMESword, 1), new Object[] { " * ", " * ", " X ", 'X', Item.stick, '*', Block.dirt });
The first line of code is telling modloader to override minecraft item's picture with your new sword sprite. The second line is adding in a name for your sword. In the "NAME Sword" call your sword what ever you like. The tutorial goes over everything.
The picture of the sword that I used can be downloaded here! (16x16)
[media][/media]
In your static section paste this:
public static final Item NAMEPick = new ItemPickaxe(2102, EnumToolMaterial.GOLD).setItemName("Whatever");
replace the NAME with a name of your choice. EnumToolMaterial.GOLD is the tool material, so it's set as gold (defualt). Paste this line of code in your public void load():
NAMEPick.iconIndex = ModLoader.addOverride("/gui/items.png" , "/items/pic.png"); ModLoader.addName(NAMEPick, "NAME Pickaxe"); ModLoader.addRecipe(new ItemStack(NAMEPick, 1), new Object[] { "***", " X ", " X ", 'X', Item.stick, '*', Block.dirt });
The green Pickaxe picture that was used can be downloaded here! (16x16)
[media][media][/media[/media]]
In your static section paste this:
public static final Item NAMEAxe = new ItemAxe(2096, EnumToolMaterial.GOLD).setItemName("whatever");
Paste these lines of code in your public void load():
NAMEAxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/items/pic.png"); ModLoader.addName(NAMEAxe, "NAME Axe"); ModLoader.addRecipe(new ItemStack(NAMEAxe, 1), new Object[] { "** ", "*X ", " X ", 'X', Item.stick, '*', Block.dirt });
Watch the video for infomation!
The green Axe picture that was used can be downloaded here! (16x16)
[media][media][/media[/media]]
In your static section paste this:
public static final Item NAMEHoe = new ItemHoe(2107, EnumToolMaterial.GOLD).setItemName("Whatever");
Paste these lines of code in your public void load():
NAMEHoe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/items/pic.png"); ModLoader.addName(NAMEHoe, "NAME Hoe"); ModLoader.addRecipe(new ItemStack(NAMEHoe, 1), new Object[] { "** ", " X ", " X ", 'X', Item.stick, '*', Block.dirt });
Watch the video for infomation!
The green Hoe picture that was used can be downloaded here! (16x16)
[media][media][/media[/media]]
In your static section paste this:
public static final Item NAMESpade = new ItemSpade(2099, EnumToolMaterial.GOLD).setItemName("Whatever");
Paste these lines of code in your public void load():
NAMESpade.iconIndex = ModLoader.addOverride("/gui/items.png" , "/items/pic.png"); ModLoader.addName(NAMESpade, "NAME Shovel"); ModLoader.addRecipe(new ItemStack(NAMESpade, 1), new Object[] { " * ", " X ", " X ", 'X', Item.stick, '*', Block.dirt });
Watch the video for information of these lines of code!
The green Shovel picture that was used can be downloaded here! (16x16)
[media][media][/media[/media]]
pase this line of code in your public static section:
public static final Block NAMEBlock = new BlockNAME(151, 0).setHardness(6F).setResistance(7.0F).setBlockName("whatever");
Create a new class ( for your BlockNAME, and copy nnd paste this code in:
package net.minecraft.src; import java.util.Random; public class BlockNAME extends Block { protected BlockNAME(int i, int j) { super(i, j, Material.iron); } public int idDropped(int par1, Random par2Random, int par3) { return mod_NAME.ITEM.shiftedIndex; } public int quantityDropped(Random random) { return 1; } public String Version() { return "3.14159265"; } }
follow the video tutorial if you get stuck or confused. Now paste these lines of code in you Public void load():
ModLoader.registerBlock(NAMEBlock); NAMEBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png" , "/items/pic.png"); ModLoader.addName(NAMEBlock, "In Game Name Ore");
once you have paste that line of code, be sure to change any (NAME) with your block name, now under your static final section, not your public void load. You paste these lines of code:
public void generateSurface(World world, Random random, int chunkX, int chunkZ) { Random randomGenerator = random; for (int i = 0; i < 10; i++) { int randPosX = chunkX + randomGenerator.nextInt(20); int randPosY = random.nextInt(40); int randPosZ = chunkZ + randomGenerator.nextInt(20); (new WorldGenMinable(NAMEBlock.blockID, 4)).generate(world, random, randPosX, randPosY, randPosZ); } }
This line of code deals with your actual ore generation in chunks. If you would like to generate more ore everywhere then mess with this line of code: for (int i = 0; i < 10; i++) - Change 10 to 30 and see the difference. If you know Minecraft's XYZ's coordence then you can easly chnage where ore will spawn underground. I cover a lot of lines in my video. So check it out!
The green Ore picture that was used can be downloaded here! (16x16)
[media][media][/media[/media]]
Make a new class, and paste this in your mod_NAMEARMOR:
package net.minecraft.src; import net.minecraft.client.Minecraft; public class mod_NAME extends BaseMod { public void load() { } public String Version() { return "1.4.2"; } public String getVersion() { return "3.14159265"; } }
This is the Basic Modloader coding format. You will use this like a normal mod_file you have made. In your Static final body paste these lines of code:
public static final Item NAMEBody = (new ItemArmor(2200, EnumArmorMaterial.GOLD ,5,1 ).setItemName("Whatever")); public static final Item NAMEHelmet = (new ItemArmor(2201,EnumArmorMaterial.GOLD ,5,0 ).setItemName("Whatever")); public static final Item NAMEPants = (new ItemArmor(2202,EnumArmorMaterial.GOLD ,5,2 ).setItemName("Whatever")); public static final Item NAMEBoots = (new ItemArmor(2203,EnumArmorMaterial.GOLD, 5, 3 ).setItemName("Whatever"));
We are defining the items that you will use to place on your armor slots. Keep in mind this line of code (5,0) The 5 is the new armor number you have added. Since Minecraft has 4 armor sets you are adding in the 5th set. ( If you add in more armor be sure to increase that number to 6) - Now the 0 is where the item will be placed on the armor slots. 0 = HELMET, 1 = BODY, 2 = PANTS, and 3 = BOOTS.
Now paste these lines of code in your Public void load():
NAMEBody.iconIndex = ModLoader.addOverride("/gui/items.png", "/items/pic.png"); ModLoader.addName(NAMEBody, "In-Game-NAME Chestplate"); ModLoader.addRecipe(new ItemStack(NAMEBody,1), new Object[]{ "* *", "***", "***", Character.valueOf('*'), Block.dirt}); // Helmet Armor NAMEHelmet.iconIndex = ModLoader.addOverride("/gui/items.png", "/items/pic.png"); ModLoader.addName(NAMEHelmet, "In-Game-Name Helmet"); ModLoader.addRecipe(new ItemStack(NAMEHelmet,1), new Object[]{ "***", "* *", Character.valueOf('*'), Block.dirt}); // Pants Armor NAMEPants.iconIndex = ModLoader.addOverride("/gui/items.png", "/items/pic.png"); ModLoader.addName(NAMEPants, "In-game-Name Leggings"); ModLoader.addRecipe(new ItemStack(NAMEPants,1), new Object[]{ "***", "* *", "* *", Character.valueOf('*'), Block.dirt}); // Boots Armor NAMEBoots.iconIndex = ModLoader.addOverride("/gui/items.png", "/items/pic.png"); ModLoader.addName(NAMEBoots, "In-Game-Name Boots"); ModLoader.addRecipe(new ItemStack(NAMEBoots,1), new Object[]{ "* *", "* *", Character.valueOf('*'), Block.dirt}); ModLoader.addArmor("Name-Of-Armor");
Watch my video for more details.
Pictures! ( used in video )
Download the bundle! (16x16)
[media][media][/media[/media]]
It's very simple. Just follow my tutorial xD
[media][media][/media[/media]]
*This video and code only work for Minecraft 1.2.5 MCP coding!* Updated code is located down below!
Paste this line of code in your public void load():
ModLoader.addSmelting(BLOCK.blockID, new ItemStack(ITEM, 1));
Watch the video for information!
Download my "Shiny Gem" Here! (16x16)
[media][media][/media[/media]]
The same Idea as in making a block, but a few changes.
Copy and paste this line of code in your "public static final section"
public static final Block NAMEBlock = new BlockNAME(160, 0).setBlockName("whatever").setHardness(5F).setResistance(6F).setStepSound(Sound);
You will need to follow my video for a great description of this line and the following lines.
Copy and paste these lines in your public void load:
/terrain.png", "/items/pic.png");
ModLoader.registerBlock(NAMEblock);
ModLoader.addName(Rubyblock, "In-Game-Name Block");
ModLoader.addRecipe(new ItemStack(NAMEblock, 1), new Object [] {"###", "###", "###", Character.valueOf('#'), ITEM});; padding:10px; margin-bottom:10px;">NAMEblock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/items/pic.png");
ModLoader.registerBlock(NAMEblock);
ModLoader.addName(Rubyblock, "In-Game-Name Block");
ModLoader.addRecipe(new ItemStack(NAMEblock, 1), new Object [] {"###", "###", "###", Character.valueOf('#'), ITEM});
And for your BlockNAME you will need to create a new class to define it, make a new class and paste in this code:ModLoader.registerBlock(NAMEblock);
ModLoader.addName(Rubyblock, "In-Game-Name Block");
ModLoader.addRecipe(new ItemStack(NAMEblock, 1), new Object [] {"###", "###", "###", Character.valueOf('#'), ITEM});; padding:10px; margin-bottom:10px;">NAMEblock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/items/pic.png");
ModLoader.registerBlock(NAMEblock);
ModLoader.addName(Rubyblock, "In-Game-Name Block");
ModLoader.addRecipe(new ItemStack(NAMEblock, 1), new Object [] {"###", "###", "###", Character.valueOf('#'), ITEM});
in your BlockNAME:
package net.minecraft.src; import java.util.Random; public class BlockNAME extends Block { public BlockNAME(int i, int j) { super(i, j, Material.wood); } public int idDropped(int i, Random random, int j) { return mod_NAME.BLOCK.blockID; } public int quantityDropped(Random random) { return 1; }}
Download my Block that I used in my tutorial Here!
[media][media][/media[/media]]
STEPS:
- Download Modloader 1.3
- Download the new MCP V1.7 ( for Minecraft 1.3 )
- Get a fresh Minecraft.jar
- (Optional) Get a Minecraft_Server.jar 1.3
- Copy and paste your "Bin" and "resources" folders in your "jars" folder.(make sure you have modded minecraft.jar with modloader
- Decompile
- Move over Old src to New Src
*How to Move Over*
- Either look for your class files in your old src and move over
- Or, Highlight ALL, *copy* and paste in new src, But DON'T REPLACE
- Recompile
- Look for errors. ( you might get 1 )
- Move over pictures / items to new location.
- Open eclipse, and look for your mod_NAME
- Run Minecraft, and enjoy your mod!
Get the New MCP for Minecraft 1.3 and downloads Here!
[media][media][/media[/media]]
What to do!
- Update your version of MCP to 1.3.2
- Copy your old src (source) to your new moddings folder (you can get mine)
- Copy your pictures as well
- Fix errors. If any (look for red lines)
[media][/media]
Paste this line of code in your public static final section:
public static final Item nameHere = new ItemFood(5000, 6, 1F, true).setItemName("anyNameHere");
It's just like making an Item, but this time you make sure it extends ItemFood.
The 1F means how many 1/2 hunger bar is your food going to fill up, so 2 = 1 bar, 3 = 2 1/2, and so on.
The 6 is how long till you get hungy again, 5 is normal, and 3 is very low where you will starve again! The true statement is if you can feed it to a wolf. true = yes, and false = No.
Now paste this line of code in your public void load():
foodNameHere.iconIndex = ModLoader.addOverride("/gui/items.png", "/items/image.png"); ModLoader.addName(foodNameHere, "My Food"); ModLoader.addRecipe(new ItemStack(Food01, 5), new Object[] { "***", "* *", "***", '*', Item.sugar });
Download my Food item here! ( Doughnut )
[media][media][/media[/media]]
//IF SMELTING ITEM TO ITEM ModLoader.addSmelting(yourItem.shiftedIndex, new ItemStack(yourSmeltedItem, 1), 1.0F); //IF SMELTING BLOCKS TO BLOCKS ModLoader.addSmelting(yourBlock.blockID, new ItemStack(yourSmeltedBlock, 1), 1.0F);
The 1.0F is how much exp you'll recieve with smelting successfully. The rest is explained in my tutorial.
[media][media][/media[/media]]
//For a Item: YourItem.setTabToDisplayOn(CreativeTabs.tabMaterials); //For a Block this.setCreativeTab(CreativeTabs.tabBlock);
If you have a sword, then remove the (CreativeTabs.tabMaterials) and spell in " (CreativeTabs. " if you put that point "." you should have a list of the tabs available, like the Materials Tab, Combat, Misc, Food, Tools, etc.
19. Mobs Part 1 - Modeling with Techne! - ( 1.3.2 / 1.4.x )
[media][/media[/media]]
Link Removed
Download my Mob save here!
You will need Internet Explorer to right-click the "Download/Website" link on Techne's forum to save it as an application.
( Watch my Video )
19. Mobs Part 3 - Coding Mob ( 1.3.2 / 1.4.x )
[media][media][/media[/media]]
mod_NAME.java:
package net.minecraft.src; import java.awt.Color; import java.util.Map; public class mod_NAME extends BaseMod { public String getVersion() { return "1.4.2"; } public void load() { ModLoader.registerEntityID(EntityNAME.class, "NAME", 30);//registers the mobs name and id ModLoader.addSpawn("NAME", 15, -5, 1, EnumCreatureType.monster);//makes the mob spawn in game ModLoader.addLocalization("entity.NAME.name", "NAME");//adds Mob name on the spawn egg EntityList.entityEggs.put(Integer.valueOf(30), new EntityEggInfo(30, 894731, (new Color(21, 15, 6)).getRGB()));//creates the spawn egg, and chnages color of egg } public void addRenderer(Map var1) { var1.put(EntityNAME.class, new RenderLiving(new ModelNAME(),.5f)); } }
First off make yourself a new class, replace all the NAME with the actualy name that you have chosen. In the public void load() Modloader registers the mob/entity that you are creating. I have left side notes on most of the line of code for you to understand what they mean.
EntityNAME:
package net.minecraft.src; public class EntityNAME extends EntityMob//extend this to make mob hostile { public EntityNAME(World par1World) { super(par1World); this.texture = "/mob/NAME.png";//Set Mob texture this.moveSpeed = 0.4f;//sets how fast this mob moves isImmuneToFire = false; //below this is all the ai tasks that specify how the mob will behave mess around with it to see what happens this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIAttackOnCollide(this, EntityPlayer.class, this.moveSpeed, false)); this.tasks.addTask(2, new EntityAIMoveTwardsRestriction(this, this.moveSpeed)); this.tasks.addTask(3, new EntityAIWander(this, this.moveSpeed)); this.tasks.addTask(4, new EntityAILookIdle(this)); this.targetTasks.addTask(0, new EntityAIHurtByTarget(this, false)); this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 25.0F, 0, true)); } public int func_82193_c(Entity par1Entity) //the amount of damage { return 4; } protected void fall(float par1) {} public int getMaxHealth() // Mob health { return 10; } protected String getLivingSound() { return "mob.pig.say"; } protected String getHurtSound() { return "mob.pig.say"; } protected String getDeathSound() { return "mob.pig.death"; } protected int getDropItemId() { return Item.stick.shiftedIndex; } protected boolean canDespawn() { return true; } protected boolean isAIEnabled()//Allow your AI task to work? { return true; } }
Each line is pretty much self explanatory, watch my video and read the side notes to understand the code.
Here is my ModelGreenMonster
package net.minecraft.src; public class ModelGreenMonster extends ModelBase { //fields ModelRenderer Leg2; ModelRenderer Leg1; ModelRenderer Body; ModelRenderer Arm1; ModelRenderer Arm2; ModelRenderer Head; public ModelGreenMonster() { textureWidth = 64; textureHeight = 128; Leg2 = new ModelRenderer(this, 48, 49); Leg2.addBox(-2F, 0F, -2F, 4, 11, 4); Leg2.setRotationPoint(-4F, 13F, 0F); Leg2.setTextureSize(64, 128); Leg2.mirror = true; setRotation(Leg2, 0F, 0F, 0F); Leg1 = new ModelRenderer(this, 31, 49); Leg1.addBox(-2F, 0F, -2F, 4, 11, 4); Leg1.setRotationPoint(2F, 13F, 0F); Leg1.setTextureSize(64, 128); Leg1.mirror = true; setRotation(Leg1, 0F, 0F, 0F); Body = new ModelRenderer(this, 0, 68); Body.addBox(0F, 0F, 0F, 12, 7, 7); Body.setRotationPoint(-7F, 7F, -3F); Body.setTextureSize(64, 128); Body.mirror = true; setRotation(Body, 0F, 0F, 0F); Arm1 = new ModelRenderer(this, 0, 34); Arm1.addBox(0F, -1F, -9F, 4, 3, 12); Arm1.setRotationPoint(5F, 8F, -3F); Arm1.setTextureSize(64, 128); Arm1.mirror = true; setRotation(Arm1, 0F, 0F, 0F); Arm2 = new ModelRenderer(this, 0, 19); Arm2.addBox(-4F, -1F, -10F, 4, 3, 12); Arm2.setRotationPoint(-7F, 8F, -3F); Arm2.setTextureSize(64, 128); Arm2.mirror = true; setRotation(Arm2, 0F, 0F, 0F); Head = new ModelRenderer(this, 0, 0); Head.addBox(-3F, -6F, -2F, 8, 6, 5); Head.setRotationPoint(-2F, 7F, 0F); Head.setTextureSize(64, 128); Head.mirror = true; setRotation(Head, 0F, 0F, 0F); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5); Leg2.render(f5); Leg1.render(f5); Body.render(f5); Arm1.render(f5); Arm2.render(f5); Head.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) { // super.setRotationAngles(f, f1, f2, f3, f4, f5); } }
Check out Notepad++
Download my Mob Texture!
[media] [/media]
You will need to paste these body of code in your modelNAME.java file! Mess with the #'s to get random rotation results!
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) { super.setRotationAngles(f, f1, f2, f3, f4, f5, null); leg.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.0F * f1; leg2.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 1.0F * f1; arm.rotateAngleZ = MathHelper.cos(f * 0.6662F) * 1.0F * f1; arm2.rotateAngleZ = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 1.0F * f1; }
[media] [/media]
For Minecraft 1.4.4
Download the newest Modloader here! (1.4.4)
Download MCP Version 7.19 for 1.4.4 here!
For Minecraft 1.4.5
Download the files here!
[media] [/media]
The enchantment effect code is here:
public boolean hasEffect(ItemStack par1ItemStack){ return true; }
Leave the return to true in order to get the enchantment effect on the item!
[media] [/media]
Here is the code that was used in this video!:
public String getItemDisplayName(ItemStack par1ItemStack) { String var2 = ("\u00a7E" + StringTranslate.getInstance().translateNamedKey(this.getLocalItemName(par1ItemStack))).trim(); return var2; }
Pay attention to \u00a7E that E is the placement for a color code. In order to see the color codes link is right here:
Color codes webpage!
Change the E to 1 or 2 or 4, you will get a different color, this method does not work on blocks. I will look into that later on
[media] [/media]
Code:
public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1) { entityliving.setFire(5); return true; }
To turn off the fire aspect, put return false; The 5 is the amount of ticks the fire will remain on the entity. Raise it higher if you wish the mod will remain on fire for a very long time.
[media] [/media]
public int addFuel(int par1, int par2) { if(par1 == ITEM.shiftedIndex)//200 ticks is normal,1600 ticks is coal { return 200; } if(par1 == BLOCK.blockID) { return 200; } return 0; }
Watch the video for some additional information!
[media][/media]
These line of codes were used in my video, I have explained what they mean. Paste these lines of code in your "public class" section
public static final Achievement achievementFood = new Achievement(5400, "achievementFood", 10, 9, Item.sugar, null).setSpecial().setIndependent().registerAchievement(); public static final Achievement achievementGem = new Achievement(5401, "achievementGem", 10, 12, Item.bone, achievementFood).registerAchievement();
Paste these lines of code in your "public void load()"
ModLoader.addAchievementDesc(achievementFood, "Yummy!", "Craft a Donut!!"); ModLoader.addAchievementDesc(achievementGem, "Green GEM!", "Pick Up a Green Gem!");
paste these lines of code underneath the public void load, make sure you do not paste them in public void load():
public void takenFromCrafting(EntityPlayer entityplayer, ItemStack itemstack, IInventory iinventory) { if(itemstack.itemID == mod_minecraft.Food01.shiftedIndex) { entityplayer.addStat(achievementFood, 1); } } public void onItemPickup(EntityPlayer entityplayer, ItemStack itemstack) { if(itemstack.itemID == mod_minecraft.greengem.shiftedIndex) { entityplayer.addStat(achievementGem, 2); } }
Follow the video tutorial for more information.
[media][/media]
Follow the tutorial on making a new WorldGenNether class by copying the src code from WorldGenMinable.
Here is the code that you will place in your mod_mod:
public void generateNether(World var1, Random var2, int var3, int var4) { int var5; int var6; int var7; int var8; int veinsize=8;//Size of the vein int rarity=12;//the rarity of the ore for (var5 = 0; var5 < rarity; ++var5) { var6 = var3 + var2.nextInt(16); var7 = var2.nextInt(128); var8 = var4 + var2.nextInt(16); new WorldGenNether(Block.dirt.blockID, veinsize).generate(var1, var2, var6, var7, var8);//replace dirt with your custom ore } }
I left some side notes, explaining the obvious. But anyways! Hope this helps!
[media][/media]
For the gravitational block you'll need to follow along with my tutorial,
to make your block unbreackable add in this line of code to your "pubic static final"
.setBlockUnbreakable()
Now to make your block have a light value, you'll add this line of code to your "public static final"
.setLightValue(5)
Increase or decrease the number 5 to lower or increase the light radius.
Last thing to say!
Thank you for support!
Get our Banner below!
[represent]
1
2