Can you please tell me how to make some text appear when I join a MP game or when i load up a SP game?? that just like an MOTD on a server but only i can see it. i would really appreciate it thank you!
Wow. You're the first person on these forums I've seen that knows his modding and actually takes the time to teach us newbies how to do some of the more advanced stuff that no one else seems to want to touch. I thank you very much!
I've been trying to create a block with it's own GUI, like the workbench or the furnace has, and I can't find any tutorials on how to do it and I can't figure it out on my own. So, I was wondering, at some point, is it possible for you to create a tutorial on how to add custom GUIs and apply them to block (assuming you know how, that is)?
For some reason, my Eclipse isn't working properly. It says "A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse. No Java Virtual Machine was found after searching the following locations: C:\Program Files\Eclipse\eclipse\jre\bin\javaw.exe javaw.exe in your current PATH" i know this means that my path is incorrect, but i did everything you told me too. My path in the environmental variables place, and its all correct, but for some reason, eclipse is not searching using that path. thanks for the help
Ok sorry for double post, but i got it too work, but now im getting an error opening up minecraft using eclipse. its giving me this error
java.lang.NullPointerException
at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(Unknown Source)
at sun.reflect.UnsafeIntegerFieldAccessorImpl.set(Unknown Source)
at java.lang.reflect.Field.set(Unknown Source)
at Start.main(Start.java:17)
I don't know why my thing is breaking but here is the error report and below that I'll post snippets of code from places it shows:
java.lang.Error: Unresolved compilation problem:
Unreachable code
at net.minecraft.src.BlockOre.idDropped(BlockOre.java:37)
at net.minecraft.src.Block.dropBlockAsItemWithChance(Block.java:300)
at net.minecraft.src.Block.dropBlockAsItem(Block.java:284)
at net.minecraft.src.Block.harvestBlock(Block.java:526)
at net.minecraft.src.PlayerControllerSP.sendBlockRemoved(PlayerControllerSP.java:52)
at net.minecraft.src.PlayerControllerSP.sendBlockRemoving(PlayerControllerSP.java:100)
at net.minecraft.client.Minecraft.func_6254_a(Minecraft.java:775)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1155)
at net.minecraft.client.Minecraft.run(Minecraft.java:480)
at java.lang.Thread.run(Thread.java:662)
--- END ERROR REPORT 23ef2354 ----------
========================================== Generating a new ore.
==========================================
Right, we'll here we go. Start by opening up "ChunkProviderGenerate.java". Scroll down until about 2/3's of the way and find:
for(int i4 = 0; i4 < 1; i4++)
{
int j7 = k + rand.nextInt(16);
int k10 = rand.nextInt(16);
int i15 = l + rand.nextInt(16);
(new WorldGenMinable(Block.oreDiamond.blockID, 7)).generate(worldObj, rand, j7, k10, i15);
}
for(int j4 = 0; j4 < 1; j4++)
{
int k7 = k + rand.nextInt(16);
int l10 = rand.nextInt(16) + rand.nextInt(16);
int j15 = l + rand.nextInt(16);
(new WorldGenMinable(Block.oreLapis.blockID, 6)).generate(worldObj, rand, k7, l10, j15);
}
OK. So I'll explain all in just a second but for now, add this:
for(int i4 = 0; i4 < 1; i4++)
{
int j7 = k + rand.nextInt(16);
int k10 = rand.nextInt(16);
int i15 = l + rand.nextInt(16);
(new WorldGenMinable(Block.oreDiamond.blockID, 7)).generate(worldObj, rand, j7, k10, i15);
}
for(int j4 = 0; j4 < 1; j4++)
{
int k7 = k + rand.nextInt(16);
int l10 = rand.nextInt(16) + rand.nextInt(16);
int j15 = l + rand.nextInt(16);
(new WorldGenMinable(Block.oreLapis.blockID, 6)).generate(worldObj, rand, k7, l10, j15);
}
for(int k4 = 0; k4 < 1; jk++)
{
int l7 = k + rand.nextInt(16);
int i11 = rand.nextInt(48);
int k15 = l + rand.nextInt(16);
(new WorldGenMinable(Block.oreExample.blockID, 10)).generate(worldObj, rand, l7, i11, k15);
}
Here we go. "k4", "l7", "i11" and "k15" are unique ID numbers. These can be changed from the numbers "1-15" combined with the any letter of this: "ijkl". So, these values are only allowed to be "j1, l15, k12, i13" so on so forth.
"10" is the max that can generate in an area. The number's "16" and "16" detail the space allocated to each chunk. A chunk is 64x64 in width so with this, it would generate in an area 16x16 wide. That's only in width so how do we get depth? "48" is the answer.
Chunk dimensions are as follows: 128x64x64. The entire chunk is "128" blocks tall. So, if you wanted your block to generate anywhere in depth then you could set it to "128" which is "0" (bedrock) to "128" (height limit). Here I put it so that it requires you to go underground at "48" blocks. So. Anywhere in any chunk, in a space that is "16" by "16" wide, underground "48" blocks to "0" (bedrock) you can find oreExample.
Its Actually
for(int k4 = 0; k4 < 1; k4++)
{
int l7 = k + rand.nextInt(16);
int i11 = rand.nextInt(48);
int k15 = l + rand.nextInt(16);
(new WorldGenMinable(Block.oreExample.blockID, 10)).generate(worldObj, rand, l7,
instead of
for(int k4 = 0; k4 < 1; jk++)
{
int l7 = k + rand.nextInt(16);
int i11 = rand.nextInt(48);
int k15 = l + rand.nextInt(16);
(new WorldGenMinable(Block.oreExample.blockID, 10)).generate(worldObj, rand, l7,
Dont want anybody messing up like i did :sad.gif:
AMAZING Minecraft modding tutorial!! Of all the tutorials I've seen I'd have to say this one is the best. Not only because it's brief with enough info for noobs, but also because it's actually COMPLETE! Thank you very very much!! Here's many diamonds to you, good sir.
========================================== Adding a new furnace recipe.
==========================================
Alright, so let's jump straight in. Open up FurnaceRecipies. Here you will see:
addSmelting(Block.oreIron.blockID, new ItemStack(Item.ingotIron));
addSmelting(Block.oreTopaz.blockID, new ItemStack(Item.topaz));
addSmelting(Block.oreGold.blockID, new ItemStack(Item.ingotGold));
addSmelting(Block.oreDiamond.blockID, new ItemStack(Item.diamond));
addSmelting(Block.sand.blockID, new ItemStack(Block.glass));
addSmelting(Item.porkRaw.shiftedIndex, new ItemStack(Item.porkCooked));
addSmelting(Item.fishRaw.shiftedIndex, new ItemStack(Item.fishCooked));
addSmelting(Block.cobblestone.blockID, new ItemStack(Block.stone));
addSmelting(Item.clay.shiftedIndex, new ItemStack(Item.brick));
addSmelting(Block.cactus.blockID, new ItemStack(Item.dyePowder, 1, 2));
addSmelting(Block.wood.blockID, new ItemStack(Item.coal, 1, 1));
This looks harsh but really is harmless. Copy the bottom line and then add your own to the mixture.
addSmelting(Block.cobblestone.blockID, new ItemStack(Block.stone));
addSmelting(Item.clay.shiftedIndex, new ItemStack(Item.brick));
addSmelting(Block.cactus.blockID, new ItemStack(Item.dyePowder, 1, 2));
addSmelting(Block.wood.blockID, new ItemStack(Item.coal, 1, 1));
addSmelting(Item.stick.shiftedIndex, new ItemStack(Item.example, 4, 0));
Ok. So I've now made it so that when I burn a stick, it will give me "4" of "Item.example". Easy to explain. If you have multiples of one item, they are called the damage value. If the damage value is equal to "0" then it is just a single, unique item. If you see above, if you burn a cactus, it willl give you a damage value of "2" and a quantity of "1". With ours, it will give a damage value of "0" and a quantity of "4". The "shiftedIndex" just means it has to be the item specified but it can be any amount that is being burnt.
How do you code it so that you can 'burn'/boil a bucket of water in the furnace? I couldn't seem to find the item.??? of a bucket of water.. this is what I tried:
addSmelting(Item.bucketWater.shiftedIndex, new ItemStack(Item.example, 4, 0));
(I saw Item.bucketWater somewhere but can't find it in src)
========================================== Adding a new block.
==========================================
Simple as cake. We open up "Block.java" and "Material.java" under net.minecraft.src. In "Block.java", add a new line underneath the last one:
portal = (BlockPortal)(new BlockPortal(90, 14)).setHardness(-1F).setStepSound(soundGlassFootstep).setLightValue(0.75F).setBlockName("portal");
pumpkinLantern = (new BlockPumpkin(91, 102, true)).setHardness(1.0F).setStepSound(soundWoodFootstep).setLightValue(1.0F).setBlockName("litpumpkin");
cake = (new BlockCake(92, 121)).setHardness(0.5F).setStepSound(soundClothFootstep).setBlockName("cake").func_27032_l();
redstoneRepeaterIdle = (new BlockRedstoneRepeater(93, false)).setHardness(0.0F).setStepSound(soundWoodFootstep).setBlockName("diode").func_27032_l();
exampleBlock = (new Block Example(2)).setHardness(1F).setResistance(5F).setStepSound(soundGrassFootstep).setBlockName("exampleBlock");
Here we see some new things. We know that the end code sets the block name. The "setStepSound" is the sound you make when you are walking across the block. The available names instead of grass are Powder, Wood, Gravel, Grass, Stone, Metal, Glass, Cloth and Sand. The "setResistance" sets it so that it tells the game the resistance to a creeper's or tnt's explosion. Obsidian 2000F and normal blocks are set to 5F.
"setHardness" simply means that when you try destroying the block, how long it takes to give the desired outcome. The "2" in this equation is the icon index which is grass. Instead of using columns and rows, it uses it so that it will count horizontally and then when it reaches the end, it will go down to the next row and keep adding. So, it would count 0-15 then go to the row underneath and count 16-34 and so on.
"BlockExample" is the class file that we are just about to add. Right click net.minecraft.src and create a new class and call it "BlockExample". When your screen appears, type in this:
package net.minecraft.src;
public class BlockExample extends Block
{
protected BlockExample(int i, int j)
{
super(i, j, Material.rock);
}
}
Now, it specifies that the material is rock. Now, that everything is setup, we can make it so that tools are effective against it. Open the item class that best fits what tool would be most effective against your new block. I'm going to say an axe is the best tool to use. Open "ItemAxe" and you'll see this:
Right. We need a name for our block. It should be called "Example". So open "en_US.lang" under lang and go to the bottom and add:
tile.example.name=Example
tile.example.desc=
This is seriously all you need for a block to be a block but to generate, it's way different. Remember, if you want to test your block, just make it craftable in "CraftingManager.java" just for the time being.
Also, you can add your own material by extending the lines underneath "Material.java"
public static final Material portal = new Material();
public static final Material cakeMaterial = new Material();
public static final Material exampleMaterial= new Material();
Simply put, this is just as to organise material's neatly. You can add properties such as:
public static final Material portal = new Material();
public static final Material cakeMaterial = new Material();
public static final Material exampleMaterial= (new Material()).setBurning();
Which allows the block to catch fire or:
public static final Material portal = new Material();
public static final Material cakeMaterial = new Material();
public static final Material exampleMaterial= new MaterialTransparent();
I keep getting the cannot find symbol error from a block I created..
the block is called BlockSalt.java
In BlockSalt.java:
package net.minecraft.src;
public class BlockSalt extends Block
{
protected BlockSalt(int i, int j)
{
super(i, j, Material.rock);
}
}
In Block.java:
public static final Block lockedChest;
public static final Block salt;
and this..
lockedChest = (new BlockLockedChest(95)).setHardness(0.0F).setLightValue(1.0F).setStepSound(soundWoodFootstep).setBlockName("lockedchest").setTickOnLoad(true);
saltBlock = (new BlockSalt(167)).setHardness(0.5F).setStepSound(soundPowderFootstep).setBlockName("salt").
The error I get is:
*** Minecraft Coder Pack Version 2.12 ***
MCP 2.12 running in I:\Ian, click me!\PARTY AND PARTY AND YEAH!\MineCraft\[MPDT] Minecraft Plugin Dev Tools\MCP
Compiling Minecraft
sources\minecraft\net\minecraft\src\Block.java:767: cannot find symbol
symbol : variable saltBlock
location: class net.minecraft.src.Block
saltBlock = (new BlockSalt(167)).setHardness(0.5F).setStepSound(soundSandFootstep).setBlockName("salt").
^
sources\minecraft\net\minecraft\src\Block.java:767: cannot find symbol
symbol : constructor BlockSalt(int)
location: class net.minecraft.src.BlockSalt
saltBlock = (new BlockSalt(167)).setHardness(0.5F).setStepSound(soundSandFootstep).setBlockName("salt").
^
2 errors
I also tried renaming the saltBlock into salt and it gives me this:
*** Minecraft Coder Pack Version 2.12 ***
MCP 2.12 running in I:\Ian, click me!\PARTY AND PARTY AND YEAH!\MineCraft\[MPDT] Minecraft Plugin Dev Tools\MCP
Compiling Minecraft
sources\minecraft\net\minecraft\src\Block.java:767: cannot find symbol
symbol : constructor BlockSalt(int)
location: class net.minecraft.src.BlockSalt
salt = (new BlockSalt(167)).setHardness(0.5F).setStepSound(soundSandFootstep).setBlockName("salt").
^
1 error
What am I doing wrong? Thanks again for the tutorial, and the great help! Many s to you
Your not responding to my PM and your not updating your tutorials.
^The Portal Song!^
http://www.youtube.com/watch?v=b6Q_koTHB54
^Taste the cake song!^
The cake is NOT a lie!
I've been trying to create a block with it's own GUI, like the workbench or the furnace has, and I can't find any tutorials on how to do it and I can't figure it out on my own. So, I was wondering, at some point, is it possible for you to create a tutorial on how to add custom GUIs and apply them to block (assuming you know how, that is)?
java.lang.NullPointerException
at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(Unknown Source)
at sun.reflect.UnsafeIntegerFieldAccessorImpl.set(Unknown Source)
at java.lang.reflect.Field.set(Unknown Source)
at Start.main(Start.java:17)
http://tinypic.com/r/5y6naa/7
Can someone help?
is this the right place to even ask this?
net.minecraft.src is under your src folder in mcp then under minecraft then net then minecraft then finally src is where it is.
To me it seems like you don't have an ItemExample class. Post whatevers inside it here.
^The Portal Song!^
http://www.youtube.com/watch?v=b6Q_koTHB54
^Taste the cake song!^
The cake is NOT a lie!
BlockOre:
Its Actually
for(int k4 = 0; k4 < 1; k4++)
{
int l7 = k + rand.nextInt(16);
int i11 = rand.nextInt(48);
int k15 = l + rand.nextInt(16);
(new WorldGenMinable(Block.oreExample.blockID, 10)).generate(worldObj, rand, l7,
instead of
for(int k4 = 0; k4 < 1; jk++)
{
int l7 = k + rand.nextInt(16);
int i11 = rand.nextInt(48);
int k15 = l + rand.nextInt(16);
(new WorldGenMinable(Block.oreExample.blockID, 10)).generate(worldObj, rand, l7,
Dont want anybody messing up like i did :sad.gif:
approves of this, :smile.gif:
How do you code it so that you can 'burn'/boil a bucket of water in the furnace? I couldn't seem to find the item.??? of a bucket of water.. this is what I tried:
(I saw Item.bucketWater somewhere but can't find it in src)
this is the topic I go to whenever i need help with my mods!!
to you!
I keep getting the cannot find symbol error from a block I created..
the block is called BlockSalt.java
In BlockSalt.java:
In Block.java:
and this..
The error I get is:
I also tried renaming the saltBlock into salt and it gives me this:
What am I doing wrong? Thanks again for the tutorial, and the great help! Many s to you