My block does not cast light... and I placed it in the middle of a field with nothing above the bock, and it still crashed. If it helps, here are the source codes:
BlockDigitBlock.java:
package net.minecraft.src;
public class BlockDigitBlock extends Block
{
protected BlockDigitBlock(int i, int j)
{
super(i, j, Material.wood);
}
public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
{
entityplayer.inventory.addItemStackToInventory(new ItemStack(Block.blockGold));
return true;
}
}
mod_DigitMod.java:
package net.minecraft.src;
public class mod_DigitMod extends BaseMod
{
public static final Block DigitBlock;
static
{
DigitBlock = (new Block(100, ModLoader.addOverride("/terrain.png", "/minerman4/digitblock.png"), Material.rock)).setHardness(5F).setLightValue(5F).setStepSound(Block.soundWoodFootstep).setBlockName("DigitBlock");
}
public mod_DigitMod()
{
ModLoader.AddName(DigitBlock, "Digit Block");
When I Run "decompile" It Says "IOError: [Errno 2] No such file or directory: 'temp/minecraft_exc.jar
Press any key to continue...
What Do I Do??!!
You have to move the .bat file to a folder, otherwise it won't work.
Move all the files in the MCP.rar into an ordinary folder! Winrar can't run .bat files!
OMG! thank you SO SO SO MUCH!!! I have 5 more questions.
-When I break the block i dont see any floating cube, what do i need to do so I can see it when i break it?
-How do I change the texture of it?
-When i make the block(in minecraft)and when I put my mouse on it it has no name, what do I need to do to see its name?
-I would like to make a JumpBlock ( a block that makes you jump super high ), what do I need to do?
-What do I need to do so I can stack it?
Sorry for asking so many questions
First, you need to make an item for this block. Not the normal kind of item!
Terriain folder. is where textures lie.
Hmmmmmm, you need to create it in a blocklisting java file and name it much like an item.
Now, one question, how do I upload mods?
If anyone has trouble making NPCs try these files
Make a
Entity Example,
Model Example(if youre a biginer try using original models),
Render Example
Edit these
Render mananger
Spawner animals
If you want a mod example here's some programin I made one with
Kingzombie
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
public class EntityZombieKing extends EntityMob ------What General(family) class the Entity extends
{
public EntityZombieKing(World world) ------Makes the entity public to the world.
{
super(world);
texture = "/mob/zombieKing.png"; ------Skin
moveSpeed = 1F; --------movement speed
attackStrength = 10; -----I don't need to say this!
isImmuneToFire = true;
}
public void onLivingUpdate()
{
if(worldObj.isDaytime())
{
float f = getEntityBrightness(1.0F);
if(f > 0.5F && worldObj.canBlockSeeTheSky(MathHelper.floor_double(posX), MathHelper.floor_double(posY), MathHelper.floor_double(posZ)) && rand.nextFloat() * 30F < (f - 0.4F) * 2.0F)
{
fire = 300; ---burns the NPC in sunlight
}
}
super.onLivingUpdate();
}
Insult me all you want, but an ungodly amount of Derp happened when I tried making my very first mod. I'm trying to create a new block similar to diamond. I have the Block and the BlockAwesomite as class files. What now?
Insult me all you want, but an ungodly amount of Derp happened when I tried making my very first mod. I'm trying to create a new block similar to diamond. I have the Block and the BlockAwesomite as class files. What now?
I recommend you start here. It really goes into detail and makes it really simple. Plus there are tutorials for modding with ModLoader when your finished with regular.
Could you help me?
I'm stuck making an item. I think I may need a template of a created item that does nothing.
Futhermore, when I run reobfuscate I'm stuck! The mod doesn't work in official minecraft!
I'v tried rearranging a couple ways but i couldnt get it to work heres what i have:
public class mod_BlockBus extends BaseMod{
int x;
int y;
int z;
int id;
String dir;
//World world;
public mod_BlockBus(int i, int j){
//super.(i, j, Material.rock);
int x;
int y;
int z;
int id;
String dir = new String();
boolean exists;
BusManager.addBusSegment(this);
setDirection();
ModLoader.AddName(bus, "Redstone Bus");
ModLoader.addRecipe(new ItemStack(Block.bus, 1), new Object[] {
"#R#", "R#R", "#R#", Character.valueOf('#'), Block.cobblestone,
Character.valueOf('R'), Item.redstone});
}
public String Version(){
return "1.7.3";
}
//public void AddRecipe(CraftingManager recipes){
//}
public static final Block bus;
// = new Block(251).setItemName("bus");
static{
mod_BlockBus = (new BlockBus(251, ModLoader.addOverride("terrian.png",
"/gui/bus.png", 0))).setBlockName("Redstone Bus").setHardness(1.5F).setResistance
(10F).setStepSound(Block.soundStoneFootstep);
}
this snipet should be enough but if you need more just say so
I'v tried rearranging a couple ways but i couldnt get it to work heres what i have:
public class mod_BlockBus extends BaseMod{
int x;
int y;
int z;
int id;
String dir;
//World world;
public mod_BlockBus(int i, int j){
//super.(i, j, Material.rock);
int x;
int y;
int z;
int id;
String dir = new String();
boolean exists;
BusManager.addBusSegment(this);
setDirection();
ModLoader.AddName(bus, "Redstone Bus");
ModLoader.addRecipe(new ItemStack(Block.bus, 1), new Object[] {
"#R#", "R#R", "#R#", Character.valueOf('#'), Block.cobblestone,
Character.valueOf('R'), Item.redstone});
}
public String Version(){
return "1.7.3";
}
//public void AddRecipe(CraftingManager recipes){
//}
public static final Block bus;
// = new Block(251).setItemName("bus");
static{
mod_BlockBus = (new BlockBus(251, ModLoader.addOverride("terrian.png",
"/gui/bus.png", 0))).setBlockName("Redstone Bus").setHardness(1.5F).setResistance
(10F).setStepSound(Block.soundStoneFootstep);
}
this snipet should be enough but if you need more just say so
IDK if there is anything wrong with ints and all but I know that .setStepSound doesn't work in mod_ files, you need to add it into the actual block file.
I am searching through the src folder I dont seem to find any water, lava, plants,etc .java files are they some special blocks?? and where can I find them??
Anyone know what the issue may be?
I tried the pigzombie code:
public ItemStack getHeldItem()
{
return defaultHeldItem;
}
private int angerLevel;
private int randomSoundDelay;
private static final ItemStack defaultHeldItem;
static
{
defaultHeldItem = new ItemStack(Item.swordGold, 1);
}
You have to move the .bat file to a folder, otherwise it won't work.
Move all the files in the MCP.rar into an ordinary folder! Winrar can't run .bat files!
First, you need to make an item for this block. Not the normal kind of item!
Terriain folder. is where textures lie.
Hmmmmmm, you need to create it in a blocklisting java file and name it much like an item.
Now, one question, how do I upload mods?
Make a
Entity Example,
Model Example(if youre a biginer try using original models),
Render Example
Edit these
Render mananger
Spawner animals
If you want a mod example here's some programin I made one with
Kingzombie
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
package net.minecraft.src;
import java.util.Random;
// Referenced classes of package net.minecraft.src:
// EntityMob, World, MathHelper, Item
public class EntityZombieKing extends EntityMob ------What General(family) class the Entity extends
{
public EntityZombieKing(World world) ------Makes the entity public to the world.
{
super(world);
texture = "/mob/zombieKing.png"; ------Skin
moveSpeed = 1F; --------movement speed
attackStrength = 10; -----I don't need to say this!
isImmuneToFire = true;
}
public void onLivingUpdate()
{
if(worldObj.isDaytime())
{
float f = getEntityBrightness(1.0F);
if(f > 0.5F && worldObj.canBlockSeeTheSky(MathHelper.floor_double(posX), MathHelper.floor_double(posY), MathHelper.floor_double(posZ)) && rand.nextFloat() * 30F < (f - 0.4F) * 2.0F)
{
fire = 300; ---burns the NPC in sunlight
}
}
super.onLivingUpdate();
}
protected String getLivingSound() -----sounds
{
return "mob.zombie";
}
protected String getHurtSound()
{
return "mob.zombiehurt";
}
protected String getDeathSound()
{
return "mob.zombiedeath";
}
protected int getDropItemId()
{
return Item.ingotGold.shiftedIndex; --------item it drops
Note: this will not generate an entity in the world
}
}
I recommend you start here. It really goes into detail and makes it really simple. Plus there are tutorials for modding with ModLoader when your finished with regular.
I'm stuck making an item. I think I may need a template of a created item that does nothing.
Futhermore, when I run reobfuscate I'm stuck! The mod doesn't work in official minecraft!
this snipet should be enough but if you need more just say so
IDK if there is anything wrong with ints and all but I know that .setStepSound doesn't work in mod_ files, you need to add it into the actual block file.
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_SoupItem.java:3: error: '{' expected
public class mod_SoupItem extends BaseMod
^
src\minecraft\net\minecraft\src\mod_SoupItem.java:27: error: reached end of file
while parsing
}
^
2 errors
mod_SoupItem.java :
package net.minecraft.src;
public class mod_SoupItem extends BaseMod
public mod_SoupItem()
{
ModLoader.AddName(soupItem, "Soup");
}
public static final Item soupItem;
static
{
soupItem = (new ItemSoup(4001, 11)).setIconIndex(ModLoader.addOverride("/gui/items.png", "Soup.png")).setItemName("soupItem");
}
public String Version()
{
return "1";
}
public void AddRecipes(CraftingManager craftingmanager)
{
craftingmanager.addRecipe(new ItemStack(soupItem), new Object[]{
" ### ", "###", Character.valueOf('#'), Block.dirt
});
}
ItemSoup.java :
package net.minecraft.src;
public class ItemSoup extends Item
{
private int healAmount;
public ItemSoup (int i, int j)
{
super(i);
healAmount = j;
maxStackSize = 1;
}
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
{
itemstack.stackSize--;
entityplayer.heal(healAmount);
return itemstack;
}
}
Look at the code of a block that already does that >.>
Like what??? water?
Water, lava, plants, torches, redstone torches, redstone wire, the list goes on...
Like a fair third of the things in MC have no collision :tongue.gif:
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_SoupItem.java:3: error: '{' expected
public class mod_SoupItem extends BaseMod
^
src\minecraft\net\minecraft\src\mod_SoupItem.java:27: error: reached end of file
while parsing
}
^
2 errors
mod_SoupItem.java :
package net.minecraft.src;
public class mod_SoupItem extends BaseMod
public mod_SoupItem()
{
ModLoader.AddName(soupItem, "Soup");
}
public static final Item soupItem;
static
{
soupItem = (new ItemSoup(4001, 11)).setIconIndex(ModLoader.addOverride("/gui/items.png", "Soup.png")).setItemName("soupItem");
}
public String Version()
{
return "1";
}
public void AddRecipes(CraftingManager craftingmanager)
{
craftingmanager.addRecipe(new ItemStack(soupItem), new Object[]{
" ### ", "###", Character.valueOf('#'), Block.dirt
});
}
ItemSoup.java :
package net.minecraft.src;
public class ItemSoup extends Item
{
private int healAmount;
public ItemSoup (int i, int j)
{
super(i);
healAmount = j;
maxStackSize = 1;
}
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
{
itemstack.stackSize--;
entityplayer.heal(healAmount);
return itemstack;
}
}