Hello! I am trying to create a new block but It is not appearing in the creative tab. Here's the code.
package net.minecraft.src;
public class GemsGalore extends BaseMod{
public static final Block OnyxOre = new OnyxOre(165, 0).setHardness(1.0F).setResistance(5F).setUnlocalizedName("stone");
public void load(){
ModLoader.registerBlock(OnyxOre);
}
public String getVersion(){
return "1.5.2";
}
}
package net.minecraft.src;
import java.util.Random;
public class OnyxOre extends Block {
public OnyxOre(int par1, int i){
super(par1, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
}
public int quantityDropped(int par1){
return (1);
}
public int idDropped(int par1, Random par2Random, int par3)
{
return GemsGalore.OnyxOre.blockID;
}
}
Thanks about metadata, I have another question...i had created a lot of throwable tiems, but i need to know how to add potion effects on impact to a entity.
For example if i throw a snowball to a pig, it get slowness... how I can do it?
is the potion effect. The first number is the potion ID, the second is how long (number of seconds * 20) and the third is the amplifier, so this would give me mining haste II for 60 seconds
I have checked your code and i dont find that where is it. Maybe you think that I am refering to dyes tutorial that you can to make a metadata in crafting recipe, I want to add 2 blocks with for example Id = 235 but the second block in game appear as 235:1 like planks or wool.
I hope I had explained well
Edit: If my asnwer is already in your tutorials, please tell me in which
It's the last one (at the very bottom) called Adding Block Metadata (sub-blocks)
Thanks Scholesy46 for helping me. I've got another problem: I'm trying to get my ore to spawn in the world but I'm having trouble with the last line of code:
package net.minecraft.src;
import java.util.Random;
public class BlockMithrilOre extends Block{
public BlockMithrilOre(int par1, int i){
super(par1, Material.iron);
}
public int quantityDropped(int par1){
return (1);
}
public int idDropped(int par1, Random par2Random, int par3){
return mod_ExpandedArmory.oreMithril.blockID;
}public void generateSurface(World world, Random random, int i, int j){
for(int k = 0; k < 7; k++){
int randPosX = i + random.nextInt(16);
int randPosY = random.nextInt(48);
int randPosZ = j + random.nextInt(16);
(new WorldGenMinable(oreMithril.blockID, 7)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
}
The error is the "oreMithril.blockID" on the last linbe of code
It can't be resolved to a variable
Plz help!
That code should be in your mod_YourModNameHere file, not your BlockYourOre file
Hello! I am trying to create a new block but It is not appearing in the creative tab. Here's the code.
package net.minecraft.src;
public class GemsGalore extends BaseMod{
public static final Block OnyxOre = new OnyxOre(165, 0).setHardness(1.0F).setResistance(5F).setUnlocalizedName("stone");
public void load(){
ModLoader.registerBlock(OnyxOre);
}
public String getVersion(){
return "1.5.2";
}
}
package net.minecraft.src;
import java.util.Random;
public class OnyxOre extends Block {
public OnyxOre(int par1, int i){
super(par1, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
}
public int quantityDropped(int par1){
return (1);
}
public int idDropped(int par1, Random par2Random, int par3)
{
return GemsGalore.OnyxOre.blockID;
}
}
According to my research using .setUnlocalizedName("stone") will give it the stone texture AND the name, so technically it's a clone of stone so it won't put it in the creative tab. Change "stone" to a custom texture.
Hi! I have tried several tutorials on metadata, but they were all outdated, and never worked for me, so when I saw that you posted the metadata tutorial I instantly tried it, but keep having the same problem than with the other tutorials: When I place a block with a metadata value, it doesn't actually place with that value, it gets placed with the first one. And, obviously when I destroy one of those blocks, it drops with the first metadata value. (i.e.: I got normal, red, and blue, when I place red or blue, the block that appears is normal, and when I destroy red or blue, I get normal.) I have the ItemBlock class too, but apparently it doesn't make it work.
Here are my codes for the block and the ItemBlock:
Hi there i'm relatively new to modding and after reading many tutorials i have successfully made a new ore block and gem it smelts into and a sword to craft with it. I did this all with modloader but now i want to make the mod able to be used on me and my friends multiplayer server we run. I have been looking around for tutorials and anything ive found either is not for what i'm looking for or outdated. Can anyone in this thread point me in the right direction? It would be greatly appreciated!
Hello Again. Thanks for the help, I managed to fix it.
I have a way more complicated question this time.
Could you perhaps do a tutorial on making a new "furnace" with different slots and such.
I am working on making a new machine that will, for example, take a bucket of water and separate it into two different items, Fresh Water and Salt. Now I have a stunning lack of knowledge in the Container.class and the tileentity.class and I can't seem to find any tutorials or help. I am thinking it would work something like the brewing stand in reverse, Instead of putting 3 ingredients in and getting potion, you put the "potion" in and get the 3 ingredients. Any ideas on how to go about doing this?
Hey, could you make a tutorial on how to make something like InstaHouse where you craft a block, place it, click it, and a structure generates. I really need that, thanks.
I was trying to make more than one ore generate but I don't know the code for it! I got one of my ores to generate in the world, but I don't how I make my second one too!
Isn't there supposed to code to tell where the texture for an Item is? I'm used to modding for 1.4.7 so this is throwing me off...
.setUnlocalizedName sets the name for the texture file (example: "block" for block.png), which will be found either on textures/blocks or textures/items
Hi! I have tried several tutorials on metadata, but they were all outdated, and never worked for me, so when I saw that you posted the metadata tutorial I instantly tried it, but keep having the same problem than with the other tutorials: When I place a block with a metadata value, it doesn't actually place with that value, it gets placed with the first one. And, obviously when I destroy one of those blocks, it drops with the first metadata value. (i.e.: I got normal, red, and blue, when I place red or blue, the block that appears is normal, and when I destroy red or blue, I get normal.) I have the ItemBlock class too, but apparently it doesn't make it work.
Here are my codes for the block and the ItemBlock:
Hi there i'm relatively new to modding and after reading many tutorials i have successfully made a new ore block and gem it smelts into and a sword to craft with it. I did this all with modloader but now i want to make the mod able to be used on me and my friends multiplayer server we run. I have been looking around for tutorials and anything ive found either is not for what i'm looking for or outdated. Can anyone in this thread point me in the right direction? It would be greatly appreciated!
You would need to edit the Server > src > net.minecraft.src files instead of the Client > src > net.minecraft.src ones. Also make sure you have a copy of MinecraftServer.jar in your jars folder
Hello Again. Thanks for the help, I managed to fix it.
I have a way more complicated question this time.
Could you perhaps do a tutorial on making a new "furnace" with different slots and such.
I am working on making a new machine that will, for example, take a bucket of water and separate it into two different items, Fresh Water and Salt. Now I have a stunning lack of knowledge in the Container.class and the tileentity.class and I can't seem to find any tutorials or help. I am thinking it would work something like the brewing stand in reverse, Instead of putting 3 ingredients in and getting potion, you put the "potion" in and get the 3 ingredients. Any ideas on how to go about doing this?
I had tried the furnace before but it has currently been unsuccessful.
Hey, could you make a tutorial on how to make something like InstaHouse where you craft a block, place it, click it, and a structure generates. I really need that, thanks.
I was trying to make more than one ore generate but I don't know the code for it! I got one of my ores to generate in the world, but I don't how I make my second one too!
Just make a copy of the for statement and everything inside of it in GenerateSurface()
Hey, could you make a tutorial on how to make something like InstaHouse where you craft a block, place it, click it, and a structure generates. I really need that, thanks.
Thanks for posting the tutorial on the insta-house part but i'm stuck on the part on where you tell it how your structure is going to look like. Could you please explain how that part works? I'm going to make a lot of different structures so I need to know how I make them look like how I want them to look like. Thanks :3
Thanks for posting the tutorial on the insta-house part but i'm stuck on the part on where you tell it how your structure is going to look like. Could you please explain how that part works? I'm going to make a lot of different structures so I need to know how I make them look like how I want them to look like. Thanks :3
Basicly each line tells the structure to add a block according to the position of the structure spawning block, par2 is north/south, par3 is up and down and par4 is east/west. The first line says add a block where the insta-house block is, the second one says add one to par2 (add one to the north side), the third one says subtract one from par2 (add one to the south side) and so on. So with these three lines you would end up with a line pointing from north to south. I will add a video tutorial later to make it easier to understand
I am looking for a way, I'll let you know when it's ready
I haven't found a way that works to do this, I'll let you know when I find out
You can do this by making different copies of the code, just change the ID and what you want each grenade to do.
Posted in my tutorials.
Here's the code:
Place this in your entity class:
This line right here:
is the potion effect. The first number is the potion ID, the second is how long (number of seconds * 20) and the third is the amplifier, so this would give me mining haste II for 60 seconds
It's the last one (at the very bottom) called Adding Block Metadata (sub-blocks)
That code should be in your mod_YourModNameHere file, not your BlockYourOre file
According to my research using .setUnlocalizedName("stone") will give it the stone texture AND the name, so technically it's a clone of stone so it won't put it in the creative tab. Change "stone" to a custom texture.
Here are my codes for the block and the ItemBlock:
I have a way more complicated question this time.
Could you perhaps do a tutorial on making a new "furnace" with different slots and such.
I am working on making a new machine that will, for example, take a bucket of water and separate it into two different items, Fresh Water and Salt. Now I have a stunning lack of knowledge in the Container.class and the tileentity.class and I can't seem to find any tutorials or help. I am thinking it would work something like the brewing stand in reverse, Instead of putting 3 ingredients in and getting potion, you put the "potion" in and get the 3 ingredients. Any ideas on how to go about doing this?
.setUnlocalizedName sets the name for the texture file (example: "block" for block.png), which will be found either on textures/blocks or textures/items
Currently working on that. I can make it spawn in the nether currently (i'll post the code soon)
I haven't found a solution to the mob tutorial, it doesn't work for me but I don't know about the rest of you
It doesn't want to work properly for me either, maybe it's a bug
You would need to edit the Server > src > net.minecraft.src files instead of the Client > src > net.minecraft.src ones. Also make sure you have a copy of MinecraftServer.jar in your jars folder
I had tried the furnace before but it has currently been unsuccessful.
I'll post the tutorial soon
Just make a copy of the for statement and everything inside of it in GenerateSurface()
It's in your textures/items folder inside the minecraft.jar in jars or in your eclipse/bin/ folder
Posted in tutorials.
I managed to make a tutorial to spawn in the nether but I can't make an end tutorial.
errors / code?
Basicly each line tells the structure to add a block according to the position of the structure spawning block, par2 is north/south, par3 is up and down and par4 is east/west. The first line says add a block where the insta-house block is, the second one says add one to par2 (add one to the north side), the third one says subtract one from par2 (add one to the south side) and so on. So with these three lines you would end up with a line pointing from north to south. I will add a video tutorial later to make it easier to understand
No you don't need that it's just to render the EntityPlayer.