1
Mod Help!
Please help!
So I have been trying to get my mod to drop a piece of cake when you break it, but it just drops the block, not the cake
Here is my mod_Sapphire.java:
package net.minecraft.src;
public class mod_Sapphire extends BaseMod
{
public mod_Sapphire()
{
ModLoader.registerBlock( SapphireOre );
ModLoader.addName(SapphireOre, "Sapphire Ore");
}
public String getVersion()
{
return ("1.4.7");
}
public void load()
{
}
public static final Block SapphireOre;
static
{
SapphireOre = new BlockSapphire(221, 0).setHardness(1.3F).setResistance(5.0F).setLightValue(0F).setBlockName("SapphireOre").setCreativeTab(CreativeTabs.tabBlock);
and here is my BlockSapphire.java:
package net.minecraft.src;
import java.util.Random;
public class BlockSapphire extends Block
{
protected BlockSapphire(int i,int j)
{
super(i,j,Material.ground);
}
public int idDropped(int i,Random random)
{
return Item.cake.itemID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
PLEASE HELP I NEED THIS FIXED ASAP!
Anything will help, if you fix it i will love you forever and subscribe!
Dingo
So I have been trying to get my mod to drop a piece of cake when you break it, but it just drops the block, not the cake
Here is my mod_Sapphire.java:
package net.minecraft.src;
public class mod_Sapphire extends BaseMod
{
public mod_Sapphire()
{
ModLoader.registerBlock( SapphireOre );
ModLoader.addName(SapphireOre, "Sapphire Ore");
}
public String getVersion()
{
return ("1.4.7");
}
public void load()
{
}
public static final Block SapphireOre;
static
{
SapphireOre = new BlockSapphire(221, 0).setHardness(1.3F).setResistance(5.0F).setLightValue(0F).setBlockName("SapphireOre").setCreativeTab(CreativeTabs.tabBlock);
and here is my BlockSapphire.java:
package net.minecraft.src;
import java.util.Random;
public class BlockSapphire extends Block
{
protected BlockSapphire(int i,int j)
{
super(i,j,Material.ground);
}
public int idDropped(int i,Random random)
{
return Item.cake.itemID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
PLEASE HELP I NEED THIS FIXED ASAP!
Anything will help, if you fix it i will love you forever and subscribe!
Dingo
4
it says that SapphireBlock (int,int) is undefined
ok ill try
if i remeber good but i didn't code for some time here is you wrong change the:
protected BlockSapphire(int i,int j)
{
super(i,j,Material.ground);
}
To:
protected BlockSapphire(int i,int j, int x)
{
super(i,j,x,Material.ground);
}
Because it need 3 variables.
protected BlockSapphire(int i,int j)
{
super(i,j,Material.ground);
}
To:
protected BlockSapphire(int i,int j, int x)
{
super(i,j,x,Material.ground);
}
Because it need 3 variables.
no it doesnt work
