I do like chalenges. but i have no idea what it is (and im feeling lazy today) so can u tell me it pls?
Well, I gave you the wrong method anyways, although that one might work as well. Here is an example:
@Override
public int quantityDropped(Random random)
{
return 4; //this will drop for of the item defined in the getItemDropped method.
//You can make this randomized like this:
//return 2 + random.getNextInt(2);
//This line will guarantee 2 items to drop, yet there is a chance for 1, or 2 more items to be dropped as well.
}
@Override
public Item getItemDropped(int metadata, Random random, int fortune)
{
return ModItems.vexalIngot; //return your item here.
}
Anyways, that should work. I may have messed up something, but I think that looks good.
Ok great. now where do i put this? do i put it in the "public BlockBaconOre" with all the parameters of the block? or do i put it outside that but in the main class, "public class BlockBaconOre extends Block"? and in what order do i put these in? and last, do i need to put two @overrides?
Edit: Ok i figured it out. I had to rearrang it a bunch of times, but now it works!
Heres wat i came up with:
public class BlockBaconOre extends Block
{
public BlockBaconOre()
{
super(Material.rock);
setBlockName("baconOre");
setBlockTextureName(Reference.MODID + ":" + getUnlocalizedName().substring(5));
setCreativeTab(ModTabs.tabPigTastik);
setStepSound(soundTypeStone);
setHardness(2.5F);
setResistance(10.0F);
setHarvestLevel("pickaxe", 0);
}
@Override
public Item getItemDropped(int metadata, Random random, int fortune)
Ok great. now where do i put this? do i put it in the "public BlockBaconOre" with all the parameters of the block? or do i put it outside that but in the main class, "public class BlockBaconOre extends Block"? and in what order do i put these in? and last, do i need to put two @overrides?
Edit: Ok i figured it out. I had to rearrang it a bunch of times, but now it works!
Heres wat i came up with:
public class BlockBaconOre extends Block
{
public BlockBaconOre()
{
super(Material.rock);
setBlockName("baconOre");
setBlockTextureName(Reference.MODID + ":" + getUnlocalizedName().substring(5));
setCreativeTab(ModTabs.tabPigTastik);
setStepSound(soundTypeStone);
setHardness(2.5F);
setResistance(10.0F);
setHarvestLevel("pickaxe", 0);
}
@Override
public Item getItemDropped(int metadata, Random random, int fortune)
{
return ModItems.baconBits
}
public int quantityDropped(Random random)
{
return 4;
}
}
minus the imports*
Yup, that's where it is supposed to go. Also, the purpose of the @Override annotation is to essentially override the existing method, so that your code actually gets called.
I've never had that error before, so I can't provide a lot of help, but I did notice this:
[08:42:23] [main/INFO] [FML]: Forge Mod Loader version 7.2.211.1121 for Minecraft 1.7.2 loading
I would assume you are loading up a 1.7.2 environment, correct?
Yes, I was going to work in 1.7.2 - but I think after researching, I can't use JDK 8 with it, I have to downgrade to JDK 7, but every time I try and downgrade, my eclipse crashes on start up. Maybe I'll start over and get the 1.8 Forge.
That might change it but some things in this tutorial might not work either. You cant run JDK 8 with forge 1.7.2. Do you have forge installed for your minecraft acount?
Yes, using 1.8 Forge will render some of these tutorials useless, mainly when it comes to assigning textures to your items/blocks. I would see about upgrading to a 1.7.10 version, just to see if you can get things setup properly there. Forge and Java 8 have caused issues lately, but I have no clue whether or not those errors have been fixed, as I still use Java 6.
I have another Question. where do i put this line of code? I think it was a typo.
Before we finish up, we need to register the world generator we created, so go to your main class file, and below the our instance, we will write this:
I have another Question. where do i put this line of code? I think it was a typo.
Before we finish up, we need to register the world generator we created, so go to your main class file, and below the our instance, we will write this:
Would you be at all interested if, once I figured out a tutorial section, if I did an upbeat, narrated, screen capture video of it, and posted it to YouTube? Then if you like it, incorporating the link in your tutorials - and if you don't like it, I can do a revision, take down the video, and try again. I'd be totally willing to do it, I'm a college student studying software development, computer science, and video games, and I have the resources. I think it would help me learn the material a little bit better teaching it to someone, and it would possibly help get you more traffic on this thread. Want to try it out? See how you like it?
Would you be at all interested if, once I figured out a tutorial section, if I did an upbeat, narrated, screen capture video of it, and posted it to YouTube? Then if you like it, incorporating the link in your tutorials - and if you don't like it, I can do a revision, take down the video, and try again. I'd be totally willing to do it, I'm a college student studying software development, computer science, and video games, and I have the resources. I think it would help me learn the material a little bit better teaching it to someone, and it would possibly help get you more traffic on this thread. Want to try it out? See how you like it?
I'm not sure to be honest. I think it would be better to just keep these text tutorials. But I appreciate the offer, though, and I am glad that they have inspired you to some degree.
Thanks so much! It worked perfectly! Now I can keep on workin on my PigTastik mod!
PS do you have an eta for when the next tutorial will come out?
Keep being AWEESOOOOME!!!
Sometime soon :). I'll probably do one every 2 or 3 days from here on out. I have some free time coming up next week, so I'll try and work on some tutorials then, and maybe release a batch of say 5. I've just been extremely busy with my current project I'm working on, alongside school and work.
So how do i make special blocks? like fences, liquids, trees, stairs, slabs?
As for a tutorial, it may be a ways away. I want cover some more subjects that will give you a better knowledge of Java first, but I would love to do tutorials on them in the future. In the meantime, my only suggestion is to look up Minecraft code and source code to other mods.
Ok. Ive done quite a bit of stuff in eclipse, just not modding. I did enjoy looking at your mod Ascension's code. What exactly is it about? I noticed some more entities like a banche and a mummy and a sphinx model thing. Sounds cool though.
Ok. Ive done quite a bit of stuff in eclipse, just not modding. I did enjoy looking at your mod Ascension's code. What exactly is it about? I noticed some more entities like a banche and a mummy and a sphinx model thing. Sounds cool though.
If you want to know more about it, you can browse through this google document or the wiki.
If I'm following your tutorials correctly, blocks get their own classes but all items are created in one class, right?
EDIT:
Scratch that. Still understanding the the concepts of coding.
Well, I personally like to find the most efficient way to code, in which, creating one class for all your items to reference is pretty efficient. The reason you can't do it with blocks is because of the extra methods and variety you can have, for example, the Block#setHarvestLevel method. There are also some cases where it would better for each item to have its own class, like if you wanted to add "lore" or a "description" to your item. Of course, you don't need to have a general item class, you can just create different classes for each item, or you could mix between them like I typically do.
Hopefully that will shed some light on some things.
Well, I gave you the wrong method anyways, although that one might work as well. Here is an example:
Anyways, that should work. I may have messed up something, but I think that looks good.
Edit: Ok i figured it out. I had to rearrang it a bunch of times, but now it works!
Heres wat i came up with:
public class BlockBaconOre extends Block
{
public BlockBaconOre()
{
super(Material.rock);
setBlockName("baconOre");
setBlockTextureName(Reference.MODID + ":" + getUnlocalizedName().substring(5));
setCreativeTab(ModTabs.tabPigTastik);
setStepSound(soundTypeStone);
setHardness(2.5F);
setResistance(10.0F);
setHarvestLevel("pickaxe", 0);
}
@Override
public Item getItemDropped(int metadata, Random random, int fortune)
{
return ModItems.baconBits
}
public int quantityDropped(Random random)
{
return 4;
}
}
Yup, that's where it is supposed to go. Also, the purpose of the @Override annotation is to essentially override the existing method, so that your code actually gets called.
Yes, I was going to work in 1.7.2 - but I think after researching, I can't use JDK 8 with it, I have to downgrade to JDK 7, but every time I try and downgrade, my eclipse crashes on start up. Maybe I'll start over and get the 1.8 Forge.
~Summon Your Cheeky Creations~
Before we finish up, we need to register the world generator we created, so go to your main class file, and below the our instance, we will write this:
AscensionWorldGeneration eventWorldGen =newAscensionWorldGeneration();
This basically creates a variable for our class called “evenWorldGen”.
In the preInit constructor, we will then want to register the generator:
GameRegistry.registerWorldGenerator(this.eventWorldGen,0);
In your main class file, outside of all methods since it is a variable.
after the imports?
No. Here, look at my main class as an example, and you can see where I put mine.
~Summon Your Cheeky Creations~
PS do you have an eta for when the next tutorial will come out?
Keep being AWEESOOOOME!!!
two thank you from putting them out and foryour help to the modding
community
three im on the crafting i have no errors but how do i make a crafting recipe give out more that one item.
who ever answers this thank you very much
leo_valdes
lizzerdtroll
I'm not sure to be honest. I think it would be better to just keep these text tutorials. But I appreciate the offer, though, and I am glad that they have inspired you to some degree.
Sometime soon :). I'll probably do one every 2 or 3 days from here on out. I have some free time coming up next week, so I'll try and work on some tutorials then, and maybe release a batch of say 5. I've just been extremely busy with my current project I'm working on, alongside school and work.
Glad you are enjoying the tutorials! As for making more than one item "craft", just look at this code:
This should craft 2 Steel Ingots instead of one. Hopefully that will help you :).
As for a tutorial, it may be a ways away. I want cover some more subjects that will give you a better knowledge of Java first, but I would love to do tutorials on them in the future. In the meantime, my only suggestion is to look up Minecraft code and source code to other mods.
EDIT:
Scratch that. Still understanding the the concepts of coding.
If you want to know more about it, you can browse through this google document or the wiki.
Well, I personally like to find the most efficient way to code, in which, creating one class for all your items to reference is pretty efficient. The reason you can't do it with blocks is because of the extra methods and variety you can have, for example, the Block#setHarvestLevel method. There are also some cases where it would better for each item to have its own class, like if you wanted to add "lore" or a "description" to your item. Of course, you don't need to have a general item class, you can just create different classes for each item, or you could mix between them like I typically do.
Hopefully that will shed some light on some things.