Hey I'm simply testing out a mod by making a block and when I had finished with the code and tried recompiling I had 9errors. Can you tell me what I did wrong with it?
mod_TravisBlock.java
package net.minecraft.src;
import java.util.Random;
public class mod_TravisBlock extends BaseMod
{
public static final Block TravisBlock = new Block_Travis(97.0).sethardness 0.3F.setResistance(0.6F).setblockName("Travis").setlightvalue(0.2F);
public mod_TravisBlock()
{
ModLoader.RegisterBlock(TravisBlock);
TravisBlock.BlockindexInTexture = ModLoader.addOverride("/terrain.png", "/ehhh.png")
ModLoader.addName(TravisBlock, ("ZOMG I MADE A MOD");
ModLoader.addRecipe(new ItemStack(TravisBlock, 10), new Object []{
"**", Charecter.valueof('*'), Block.Furnace
});
}
public String Version()
{
return "3.14159265";
}
}
Block_Travis.java
package net.minecraft.src;
import java.util.Random;
public class Block_Travis extends block;
{
protected Block_Travis ( int i, int j)
{
super(i.j.Material.stone);
}
public int idDropped int i. Random random;
{
return Item.IngotIron.shiftedIndex;
}
public int quantityDropped(Random random)
{
return 64;
}
}
Hey I'm simply testing out a mod by making a block and when I had finished with the code and tried recompiling I had 9errors. Can you tell me what I did wrong with it?
mod_TravisBlock.java
package net.minecraft.src;
import java.util.Random;
public class mod_TravisBlock extends BaseMod
{
public static final Block TravisBlock = new Block_Travis(97.0).sethardness 0.3F.setResistance(0.6F).setblockName("Travis").setlightvalue(0.2F);
public mod_TravisBlock()
{
ModLoader.RegisterBlock(TravisBlock);
TravisBlock.BlockindexInTexture = ModLoader.addOverride("/terrain.png", "/ehhh.png")
ModLoader.addName(TravisBlock, ("ZOMG I MADE A MOD");
ModLoader.addRecipe(new ItemStack(TravisBlock, 10), new Object []{
"**", Charecter.valueof('*'), Block.Furnace
});
}
public String Version()
{
return "3.14159265";
}
}
Block_Travis.java
package net.minecraft.src;
import java.util.Random;
public class Block_Travis extends block;
{
protected Block_Travis ( int i, int j)
{
super(i.j.Material.stone);
}
public int idDropped int i. Random random;
{
return Item.IngotIron.shiftedIndex;
}
public int quantityDropped(Random random)
{
return 64;
}
}
This is sad. Read a book man. Making a block is not a mod.
I'm too tired to point all of them but the most noticeable one is this
ModLoader.addName(TravisBlock, ("ZOMG I MADE A MOD");
Pretty much everything. JAVA IS CASE SENSITIVE. Every expression must be closed with a ; If you dont know the name of a block., go look at it in block.java. Add int j, to the idDropped method of your blocks file. But, before you do any of this, go and learn the language.
package net.minecraft.src;
public class mod_TravisBlock extends BaseMod
{
public static final Block TravisBlock = new BlockTravis(97.0).setHardness(0.3F).setResistance(0.6F).setblockName("Travis").setlightvalue(0.2F);
public void load()
{
ModLoader.RegisterBlock(TravisBlock);
TravisBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/ehhh.png");
ModLoader.AddName(TravisBlock, "ZOMG I MADE A MOD");
ModLoader.AddRecipe(new ItemStack(TravisBlock, 10), new Object []{
"**", Character.valueOf('*'), Block.stoneOvenIdle
});
}
public String getVersion()
{
return "minecraft version here";
}
}
I've left 3 errors in this code. I'm not going to show or tell you where they are. I'm going to let you find them. So you can at least learn, a little bit.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
you NEED to post all the info including error logs. makes debugging your code less of a chore. Just be thankful this is short and easy to skim.
You are missing
public void load(){
}
And then what in the world is a Block_Travis? the new extension means you're implementing a variation of something that already exists- keep the two equivelent since there is no Block_Travis to base this off of
Block TravisBlock = new Block_Travis
should be just
mod_TravisBlock.java
Block_Travis.java
This is sad. Read a book man. Making a block is not a mod.
I'm too tired to point all of them but the most noticeable one is this
and
I've left 3 errors in this code. I'm not going to show or tell you where they are. I'm going to let you find them. So you can at least learn, a little bit.
together they are powerful beyond imagination."
You are missing
And then what in the world is a Block_Travis? the new extension means you're implementing a variation of something that already exists- keep the two equivelent since there is no Block_Travis to base this off of
Block TravisBlock = new Block_Travis
should be just
congratulations here is your block, delete your BLOCK_Travis and learn how to code ...
A modification is a modification, and does not depend on quality or the amount of modification done.
Sorry for posting this small a content... but... I think you may be in my favourite moderator's list. That line is SO true.
Author of the Clarity, Serenity, Sapphire & Halcyon shader packs for Minecraft: Java Edition.
My Github page.
The entire Minecraft shader development community now has its own Discord server! Feel free to join and chat with all the developers!
You are trying to find the variable j in i, and so forth. What you want to do is pass the arguments:
That is how to properly inherit that method and return the value you want it to.