Can you help me? I'm making a food and i cant seem to find whats making the error!
This is my source-code:
package net.minecraft.src;
public abstract class mod_Bacon extends BaseMod {
public mod_Bacon(){
Bacon.iconIndex = ModLoader.addOverride("/gui/items.png", "/food/bacon.png");
ModLoader.addName(Bacon, "Bacon");
ModLoader.addRecipe(new ItemStack(Bacon, 3), new Object[]{
"P", "P", "G", Character.valueOf('P'), Item.porkCooked, Character.valueOf('G'), Item.appleGold
});
}
public void load()
{
}
public static final Item Bacon = new ItemFood(2266, 4, true).setItemName("Bacon");
public String Version(){
return "1.4.6";
}
}
And this is my error:
27 achievements
210 recipes
Setting user: Player213, -
Client asked for parameter: server
LWJGL Version: 2.4.2
ModLoader 1.4.7 Initializing...
Failed to load mod from "mod_Bacon.class"
PLEASE HELP!
It cannot be an abstract class. Please use code tags when posting source.
Alright, in the mod_class, in the line of the:
public static final Item Butter = new ItemButter(5010, 10, false),
when I add 1F as the food saturation, error happens. Do I need to add or not? Thanks again btw.
Remeber to always post the error you receive and the code that relates to it. On this occasion, the ItemButter class is required as well as the declaration which you have already posted.
Sorry to ask again, I really don't get the idea in the food.
Here:
(Potion.blindness.id, 10 * 20, 6)
1. 10 = 10 is what? I left it 10 because I really don't get the idea of that.
(Potion.blindness.id, 10 * 20, 6)
2. 20 = the seconds of the effect of the food? I wrote there 60 for 1 minute, is it right?
(Potion.blindness.id, 10 * 20, 6)
3. 6 = I wrote 0 there as what you've said because it's just an amplifier
The 10 is the amount of ticks it lasts for. You use 20 as a multiplier which makes the first to equal to that amount of seconds. Don't change the 20, only change the 10. 1 second is equal to 20 ticks. Eg.
(Potion.blindness.id, 10 * 20, 6)
Would last for 10 seconds.
(Potion.blindness.id, 5 * 20, 6)
Would last for 5 seconds.
(Potion.blindness.id, 14 * 20, 6)
Would last for 14 seconds. So on and etc.
I could never seem to get anything to change when I messed around with the amplifier.
I always get a syntax error on the [b]bolded text:[/b]
package net.minecraft.src;
public class mod_bluegem extends BaseMod
{
public static final Item Camera = new Item(3450).setItemName("Camera");
public static final Item BlueGem = new ItemBlueGem(3450).setItemName("bluegem").setCreativeTab(CreativeTabs.tabMaterials);
public static final Block BlockOfBlueGem = new BlockBlockOfBlueGem (140, 0).setBlockName("bluegemblock").setHardness(3F).setResistance(4F).setLightValue(1F).setCreativeTab(CreativeTabs.tabBlock).setStepSound(Block.soundStoneFootstep);
public void load()
{
BlueGem.iconIndex = ModLoader.addOverride("/gui/items.png", "/bluegem/bluegem.png");
ModLoader.addName(BlueGem, "Blue Gem");
ModLoader.addRecipe(new ItemStack(BlueGem, 64), new Object [] {"#", Character.valueOf('#'), Block.dirt});
BlockOfBlueGem.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/bluegem/bluegemblock.png");
ModLoader.registerBlock(BlockOfBlueGem);
ModLoader.addName(BlockOfBlueGem, "Block of Blue Gem");
ModLoader.addRecipe(new ItemStack(BlockOfBlueGem, 64), new Object [] {"###", "###", "###", Character.valueOf('#'), Block.stone});
}
public String getVersion()
{
return "1.4.7";
}
}
BlockBlockOfBlueGem[/b]']
package net.minecraft.src;
import java.util.Random;
public class BlockBlockOfBlueGem extends Block
{
public BlockBlockOfBlueGem(int i, int j)
{
super(i, j, Material.rock);
}
public int id3451(int i, Random random, int j)
{
return mod_bluegem.BlockOfBlueGem.[b]140[/b];
}
public int quantity1(Random random)
{
return 1;
}
}
What should I put in the blockID?
Block ID - 140?
or
Block ID - 3451?
I also don't what's the data value. Should I put 140?
Also, can you check if I got any mistakes.. Thanks!
You don't put an actual id there. You use blockID.
As you know I am unfamiliar with the Minecraft code structure, but when approaching such problems the best solution is always to read into what you want to do.
Notch's NBT format is quite interesting actually; really worth looking into
I've looked at all the vanilla blocks that do this. My code is the same but doesn't seem to work.
Hello! Modding on a Macintosh does not differ alot from Windows. Where tutorials say run this and this .bat file, do that, but instead select the file with an .sh extension.
In Terminal you set the current directory to the mcp folder like this
cp path/to/mcp
Note that you can actually drag the folder onto the Terminal
sh decompile.sh
If you are new to Java or programming in general, take a look at these (official Oracle informative pages):
ItemStack stack = new ItemStack(Item.swordDiamond, 1);
stack.addEnchantment(Enchantment.fireAspect, 1);
CraftingManagerEssInfuser.getInstance().getRecipeList().add(new ShapedOreRecipe(stack, true, new Object[]{
" X ",
" X ",
" X ",
Character.valueOf('X'), mod_mCrops.InfusedDiamond}));
Put it in your mod class. I'd say it is crashing with a null pointer because you are trying to access the CraftingManagerEssInfuser object but it is still being created.
0
It cannot be an abstract class. Please use code tags when posting source.
0
If your face side of the block isn't where you want it to be then just change the side it renders on in the getBlockTextureFromSideAndMetadata method.
0
1
It is indeed pointless.
0
You are spelling Dimension wrong.
0
Remeber to always post the error you receive and the code that relates to it. On this occasion, the ItemButter class is required as well as the declaration which you have already posted.
0
The 10 is the amount of ticks it lasts for. You use 20 as a multiplier which makes the first to equal to that amount of seconds. Don't change the 20, only change the 10. 1 second is equal to 20 ticks. Eg.
Would last for 10 seconds.
Would last for 5 seconds.
Would last for 14 seconds. So on and etc.
I could never seem to get anything to change when I messed around with the amplifier.
0
0
You don't put an actual id there. You use blockID.
0
0
I've looked at all the vanilla blocks that do this. My code is the same but doesn't seem to work.
0
What error/s are you getting? I'll help you fix those but I won't update the tutorial.
0
Nope, sorry. Read the rant I just added to the top of the first OP.
0
I'm fairly sure that
is used for changing directories?
is used for copying files in Terminal.
I could be wrong. I don't have a Mac to test stuff on
0
Put it in your mod class. I'd say it is crashing with a null pointer because you are trying to access the CraftingManagerEssInfuser object but it is still being created.