if any one is wondering how to make there mob fly this is what you do
public class EntityGhast extends EntityFlying implements IMob
if any one noes how to make your mob tamable i would realy wont to now i have studied the Entitywolf but i just cant get it and how do you make your mob rideable and controlable
I have to figure it out myself first. I know Flan has a tutorial on it, but it probably isn't updated. Once I've successfully ported the mod I'm coding to SMP, then I might make a tutorial
For example, if you wanted to get the adventure achievement but you need the poison achievement first, you would just change the null to the name you gave the it.
public static final Achievement adventure = new Achievement(4561, "adventure", 7, 9, mod_DeathDesert.DeathSand, getpoison).registerAchievement();
Something like that should work.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Hey, i've used your tutorial, but i tried to fix the error myself, so the code is not exact yours. If you cold help it would be great! Thanks!
Cornyfisch
You know what I would do, I would just make two pngs that are exactly the same and just name them different things (I would do this because I had problems in 1.1, and these problems were caused by me trying to link two textures to the same png)
Hey, i've used your tutorial, but i tried to fix the error myself, so the code is not exact yours. If you cold help it would be great! Thanks!
Cornyfisch
You obviously didn't use my tutorials for multi-textured blocks because my tutorial does not mention casesanywhere. If you think adding cases like you did would work for what you were trying to do, you obviously need to learn Java.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
For example, if you wanted to get the adventure achievement but you need the poison achievement first, you would just change the null to the name you gave the it.
public static final Achievement adventure = new Achievement(4561, "adventure", 7, 9, mod_DeathDesert.DeathSand, getpoison).registerAchievement();
Something like that should work.
It somewhat works. The example you gave me works, but when I set up the other achievements it gives me an error.
Error:
== ERRORS FOUND ==
warning: [options] bootstrap class path not set in conjunction with -source 1.6
src\minecraft\net\minecraft\src\mod_DeathDesert.java:18: error: illegal forward
reference
public static final Achievement getpoison = new Achievement(4560, "getpoison"
, 8, 5, mod_DeathDesert.Poison, minedeathcactus).registerAchievement();
^
1 error
1 warning
==================
mod_DeathDesert:
package net.minecraft.src;
import java.util.Map;
import net.minecraft.client.Minecraft;
import java.util.Random;
import java.util.List;
{
//Blocks
public static final Block DeathSand = new BlockDeathSand(130, 0).setHardness(0.5F).setStepSound(Block.soundSandFootstep).setBlockName("DeathSand");
public static final Block DeathCactus = new BlockDeathCactus(131, 0).setHardness(0.4F).setStepSound(Block.soundClothFootstep).setBlockName("DeathCactus");
//public static final Block DeathSandstone = new BlockDeathSandstone(132,0).setStepSound(Block.soundStoneFootstep).setHardness(0.8F).setBlockName("DeathSandstone");
//Items
public static final Item Poison = new Item(415).setItemName("Poison");
//Achievements
public static final Achievement getpoison = new Achievement(4560, "getpoison", 8, 5, mod_DeathDesert.Poison, minedeathcactus).registerAchievement();
public static final Achievement adventure = new Achievement(4561, "adventure", 7, 9, mod_DeathDesert.DeathSand, null).registerAchievement();
public static final Achievement minedeathcactus = new Achievement(4562, "minedeathcactus", 9, 7, mod_DeathDesert.DeathCactus, adventure).registerAchievement();
public static final Achievement killmummy = new Achievement(4563, "killmummy", 10, 10, Item.diamond, adventure).registerAchievement();
/** Textures for multi textured blocks */
//Death Cactus Texture
public static int DeathCactusSide;
public static int DeathCactusTop;
public static int DeathCactusBottom;
//Death Sandstone Texture
public static int DeathSandstoneSide;
public static int DeathSandstoneTop;
public static int DeathSandstoneBottom;
public String getVersion()
{
return "1.2.3";
}
public void load()
{
ModLoader.setInGUIHook(this, true, false);
//Block Base
//ModLoader.addName(RedstoneBlock, "Redstone of Block");
//ModLoader.registerBlock(RedstoneBlock);
//RedstoneBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/RainbowLuigi281FirstMod/Blocks/OreBlocks/RedstoneBlock.png");
/** Blocks */
//Death Cactus
ModLoader.addName(DeathCactus, "Death Cactus");
ModLoader.registerBlock(DeathCactus);
DeathCactusTop = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathCactus/DeathCactusTop.png");
DeathCactusBottom = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathCactus/DeathCactusBottom.png");
DeathCactusSide = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathCactus/DeathCactusSide.png");
ModLoader.addRecipe(new ItemStack(mod_DeathDesert.DeathCactus, 1), new Object[] {
"##", Character.valueOf('#'), Block.dirt
});
//Death Sand
ModLoader.addName(DeathSand, "Death Sand");
ModLoader.registerBlock(DeathSand);
DeathSand.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathSand.png");
ModLoader.addRecipe(new ItemStack(mod_DeathDesert.DeathSand, 1), new Object[] {
"#", Character.valueOf('#'), Block.dirt
});
//Death Sandstone
//ModLoader.addName(DeathSandstone, "Death Sandstone");
//ModLoader.registerBlock(DeathSandstone);
//DeathSandstoneTop = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathSandstone/DeathSandstoneTop.png");
//DeathSandstoneBottom = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathSandstone/DeathSandstoneBottom.png");
//DeathSandstoneSide = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathSandstone/DeathSandstoneSide.png");
//ModLoader.addRecipe(new ItemStack(mod_DeathDesert.DeathSandstone, 1), new Object[] {
//"###", Character.valueOf('#'), Block.dirt
//});
/** Items */
//Poison
ModLoader.addName(Poison, "Poison");
Poison.iconIndex = ModLoader.addOverride("/gui/items.png", "/DeathDesert/Items/Misc/Poison.png");
ModLoader.addSmelting(mod_DeathDesert.DeathCactus.blockID, new ItemStack(mod_DeathDesert.Poison, 1));
/** Achievements */
ModLoader.addAchievementDesc(getpoison, "Deadly Poison", "Cook a death cactus in a furnace to receive its poison.");
ModLoader.addAchievementDesc(adventure, "It's time for adventure!", "Step foot into a death desert biome.");
ModLoader.addAchievementDesc(minedeathcactus, "Punching Cacti", "Harvest a death cactus.");
ModLoader.addAchievementDesc(killmummy, "Mummy Murderer", "Kill a mummy.");
//Item Base
//ModLoader.addName(PeanutShell, "Peanut");
//PeanutShell.iconIndex = ModLoader.addOverride("/gui/items.png", "/RainbowLuigi281FirstMod/Items/Food/PeanutShell.png");
//Crafting Base
//ModLoader.addRecipe(new ItemStack(Item.saddle, 1), new Object[] {
//"###", " D ", " F ", Character.valueOf('#'), Item.leather, Character.valueOf('D'), Item.silk, Character.valueOf('F'), Item.ingotIron
//});
//Smelting Base
//ModLoader.addSmelting(mod_RainbowLuigi281FirstMod.DarkRottenFlesh.shiftedIndex, new ItemStack(mod_RainbowLuigi281FirstMod.DarkLeather, 1));
}
/** How you get Achievements */
public void takenFromFurnace(EntityPlayer entityplayer, ItemStack itemstack)
{
if(itemstack.itemID == mod_DeathDesert.Poison.shiftedIndex)
{
entityplayer.addStat(getpoison, 1);
}
}
/** How blocks show up in the creative inventory */
boolean addedToGui;
public boolean OnTickInGUI(float f, Minecraft minecraft, GuiScreen guiscreen)
{
if ((guiscreen instanceof GuiContainerCreative))
{
if (!addedToGui)
{
Container container = ((GuiContainer)guiscreen).inventorySlots;
List list = ((ContainerCreative)container).itemList;
list.add(new ItemStack(DeathSand, 1));
list.add(new ItemStack(DeathCactus, 1));
addedToGui = true;
}
}
else addedToGui = false;
return true;
}
}
public class mod_DeathDesert extends BaseModMp
I also have an error when I made a sandstone block. If you want to help me fix you can.
Hey everyone,
I certainly need help with my first mod. Made a new plant which drops an item, but neither is the plant generated automatically nor does it grow in stages :/
BlockKartoffelpflanze.java :
package net.minecraft.src;
import java.util.Random;
public class BlockKartoffelpflanze extends BlockCrops
{
protected BlockKartoffelpflanze(int i, int j)
{
super(i, j);
setTickRandomly(true);
float f = 0.5F;
setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f);
}
protected boolean canThisPlantGrowOnThisBlockID(int i)
{
return i == Block.tilledField.blockID;
}
public void updateTick(World world, int i, int j, int k, Random random)
{
super.updateTick(world, i, j, k, random);
if(world.getBlockLightValue(i, j + 1, k) >= 9)
{
int l = world.getBlockMetadata(i, j, k);
if(l < 7)
{
float f = getGrowthRate(world, i, j, k);
if(random.nextInt((int)(25F / f) + 1) == 0)
{
l++;
world.setBlockMetadataWithNotify(i, j, k, l);
}
}
}
}
public void fertilize(World world, int i, int j, int k)
{
world.setBlockMetadataWithNotify(i, j, k, 7);
}
private float getGrowthRate(World world, int i, int j, int k)
{
float f = 1.0F;
int l = world.getBlockId(i, j, k - 1);
int i1 = world.getBlockId(i, j, k + 1);
int j1 = world.getBlockId(i - 1, j, k);
int k1 = world.getBlockId(i + 1, j, k);
int l1 = world.getBlockId(i - 1, j, k - 1);
int i2 = world.getBlockId(i + 1, j, k - 1);
int j2 = world.getBlockId(i + 1, j, k + 1);
int k2 = world.getBlockId(i - 1, j, k + 1);
boolean flag = j1 == blockID || k1 == blockID;
boolean flag1 = l == blockID || i1 == blockID;
boolean flag2 = l1 == blockID || i2 == blockID || j2 == blockID || k2 == blockID;
for(int l2 = i - 1; l2 <= i + 1; l2++)
{
for(int i3 = k - 1; i3 <= k + 1; i3++)
{
int j3 = world.getBlockId(l2, j - 1, i3);
float f1 = 0.0F;
if(j3 == Block.tilledField.blockID)
{
f1 = 1.0F;
if(world.getBlockMetadata(l2, j - 1, i3) > 0)
{
f1 = 3F;
}
}
if(l2 != i || i3 != k)
{
f1 /= 4F;
}
f += f1;
}
}
if(flag2 || flag && flag1)
{
f /= 2.0F;
}
return f;
}
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
if(j == 0)
{
return blockIndexInTexture;
}
if(j == 1)
{
return mod_kartoffel.kartoffelpfl1;
}
if(j == 2)
{
return mod_kartoffel.kartoffelpfl1;
}
if(j == 3)
{
return mod_kartoffel.kartoffelpfl1;
}
if(j == 4)
{
return mod_kartoffel.kartoffelpfl1;
}
if(j == 5)
{
return mod_kartoffel.kartoffelpfl1;
}
if(j == 6)
{
return mod_kartoffel.kartoffelpfl2;
}
if(j == 7)
{
return mod_kartoffel.kartoffelpfl2;
}
return -1;
}
public int getRenderType()
{
return 1;
}
public void dropBlockAsItemWithChance(World world, int i, int j, int k, int l, float f, int i1)
{
super.dropBlockAsItemWithChance(world, i, j, k, l, f, 0);
if(world.isRemote)
{
return;
}
int j1 = 3 + i1;
for(int k1 = 0; k1 < j1; k1++)
{
if(world.rand.nextInt(15) <= l)
{
float f1 = 0.7F;
float f2 = world.rand.nextFloat() * f1 + (1.0F - f1) * 0.5F;
float f3 = world.rand.nextFloat() * f1 + (1.0F - f1) * 0.5F;
float f4 = world.rand.nextFloat() * f1 + (1.0F - f1) * 0.5F;
EntityItem entityitem = new EntityItem(world, (float)i + f2, (float)j + f3, (float)k + f4, new ItemStack(mod_kartoffel.kartoffel));
entityitem.delayBeforeCanPickup = 10;
world.spawnEntityInWorld(entityitem);
}
}
}
public int idDropped(int i, Random random, int j)
{
if(i == 7)
{
return mod_kartoffel.kartoffel.shiftedIndex;
} else
{
return -1;
}
}
public int quantityDropped(Random random)
{
return 2;
}
}
WorldGenKartoffel.java:
package net.minecraft.src;
import java.util.Random;
public class WorldGenKartoffel extends WorldGenerator
{
public WorldGenKartoffel()
{}
public boolean generate(World world, Random random, int randPosX, int randPosY, int randPosZ)
{
int KP = mod_kartoffel.kartoffelpflanze.blockID;
world.setBlockWithNotify(randPosX, randPosY, randPosZ, KP);
world.setBlockAndMetadataWithNotify(randPosX, randPosY + 1, randPosZ, KP, 1);
return true;
}
}
mod_kartoffel.java:
package net.minecraft.src;
import java.util.Random;
public class mod_kartoffel extends BaseModMp
{
public static final Item kartoffel = new ItemKartoffelroh(386, 1, false).setPotionEffect(Potion.hunger.id, 4, 1, 0.3F).setItemName("kartoffel");
public static final Item ofenkartoffel = new ItemOfenkartoffel(387, 5, false).setItemName("ofenkartoffel");
public static final Item kartoffelbrei = new ItemKartoffelbrei(388, 5, false).setItemName("kartoffelbrei");
public static final Block kartoffelpflanze = new BlockKartoffelpflanze(181, 0).setHardness(0.3F).setBlockName("kartoffelpflanze");
public static final Item kartoffelkeim = (new ItemReed(389, kartoffelpflanze)).setIconCoord(0, 0).setItemName("kartoffelkeim");
public static int kartoffelpfl1 = ModLoader.addOverride("/terrain.png", "/potatoe/kartoffelpfl1.png");
public static int kartoffelpfl2 = ModLoader.addOverride("/terrain.png", "/potatoe/kartoffelpfl2.png");
public void load()
{
kartoffel.iconIndex = ModLoader.addOverride("/gui/items.png", "/potatoe/kartoffelroh.png");
ofenkartoffel.iconIndex = ModLoader.addOverride("/gui/items.png", "/potatoe/ofenkartoffel.png");
kartoffelbrei.iconIndex = ModLoader.addOverride("/gui/items.png", "/potatoe/kartoffelbrei.png");
kartoffelkeim.iconIndex = ModLoader.addOverride("/gui/items.png", "/potatoe/kartoffelkeim.png");
ModLoader.registerBlock(kartoffelpflanze);
kartoffelpflanze.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/potatoe/kartoffelpfl0.png");
kartoffelpfl1 = ModLoader.addOverride("/terrain.png", "/potatoe/kartoffelpfl1.png");
kartoffelpfl2 = ModLoader.addOverride("/terrain.png", "/potatoe/kartoffelpfl2.png");
ModLoader.addName(kartoffelkeim, "Gekeimte Kartoffel");
ModLoader.addName(kartoffel, "Kartoffel");
ModLoader.addName(ofenkartoffel, "Ofenkartoffel");
ModLoader.addName(kartoffelbrei, "Kartoffelbrei");
ModLoader.addSmelting(kartoffel.shiftedIndex, new ItemStack(ofenkartoffel, 1));
ModLoader.addRecipe(new ItemStack(kartoffelbrei, 1), new Object[] {" X", " #", Character.valueOf('X'), kartoffel, Character.valueOf('#'), Item.bowlEmpty});
}
public void generateSurface(World world, Random rand, int chunkX, int chunkZ) {
for(int i = 0; i < 20; i++) {
int randPosX = chunkX + rand.nextInt(4);
int randPosY = rand.nextInt(60+170);
int randPosZ = chunkZ + rand.nextInt(4);
(new WorldGenMinable(this.kartoffelpflanze.blockID, 16)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
public String getVersion()
{
return "0.3";
}
}
Thanks in advance,
Retrobyte
You have no idea how much this helped me, but thank you for posting your problem, sorry I don't know how to fix it, but thank you for posting it, as it got me thinking in the right direction, so that I could fix a moding problem I had -Thank You-
Can someone please tell me what's wrong in this code?
I tried to make a mana ore block which drops a mana crystal when broken.
Here's the code:
The Mod_ManaOre.java
package net.minecraft.src;
public class mod_ManaOre extends BaseMod
{
public static final Block ManaOre = new BlockManaOre(160, 0).setBlockName("Mana Ore").setHardness(7.5F).setResistance(15F).setLightValue(1F);
public void load()
{
ManaOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/MagikCraft/Mana Ore.png");
ModLoader.registerBlock(ManaOre);
ModLoader.addName(ManaOre, "Mana Ore");
}
public String getVersion()
{
return "1.2.3";
}
}
The BlockManaOre.java
package net.minecraft.src;
import java.util.Random;
public class BlockManaOre extends Block
{
public BlockManaOre(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random, int j)
{
return mod_ManaCrystal.ItemManaCrystal.shiftedIndex;
}
public int quantityDropped(Random random)
{
return 3;
}}
The mod_ManaCrystal.java:
package net.minecraft.src;
public class mod_ManaCrystal extends BaseMod
{
public static final Item ManaCrystal = new ItemManaCrystal(5000).setItemName("Mana Crystal");
public void load()
{
ManaCrystal.iconIndex = ModLoader.addOverride("/gui/items.png", "/MagikCraft/ManaCrystal.png");
ModLoader.addName(ManaCrystal, "Mana Crystal");
}
public String getVersion()
{
return "1.2.3";
}
}
The ItemManaCrystal.java
package net.minecraft.src;
public class ItemManaCrystal extends Item
{
public ItemManaCrystal(int i)
{
super(i);
maxStackSize = 64;
}
}
Here's the crash report from the recompile.bat:
== MCP 6.0 (data: 6.0, client: 1.2.3, server: 1.2.3) ==
# found jad, jad patches, ff patches, osx patches, srgs, name csvs, doc csvs, pa
ram csvs, astyle, astyle config
== Recompiling client ==
> Cleaning bin
> Recompiling
'"C:\Program Files\Java\jdk1.7.0_01\bin\javac" -g -source 1.6 -target 1.6 -class
path "lib;lib\*;jars\...' failed : 1
== ERRORS FOUND ==
warning: [options] bootstrap class path not set in conjunction with -source 1.6
src\minecraft\net\minecraft\src\BlockManaOre.java:14: error: cannot find symbol
return mod_ManaCrystal.ItemManaCrystal.shiftedIndex;
^
symbol: variable ItemManaCrystal
location: class mod_ManaCrystal
1 error
1 warning
==================
!! Can not find server sources, try decompiling !!
Please tell me what I did wrong!
Not sure what your problem is, but I would suggest that you combine "mod_ManaCrystal" with "mod_ManaOre" as there is no reason to have two mod_ files for the same mod. Example:
package net.minecraft.src;
public class mod_ManaCrystal extends BaseMod
{
public static final Item ManaCrystal = newItemManaCrystal(5000).setItemName("ManaCrystal"); public static final Block ManaOre = new BlockManaOre(160, 0).setBlockName("Mana Ore").setHardness(7.5F).setResistance(15F).setLightValue(1F);
public void load()
{
ManaCrystal.iconIndex = ModLoader.addOverride("/gui/items.png", "/MagikCraft/ManaCrystal.png");
ModLoader.addName(ManaCrystal, "Mana Crystal");
ManaOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/MagikCraft/Mana Ore.png");
ModLoader.registerBlock(ManaOre);
ModLoader.addName(ManaOre, "Mana Ore");
}
public String getVersion()
{
return "1.2.3";
}
}
It somewhat works. The example you gave me works, but when I set up the other achievements it gives me an error.
Error:
== ERRORS FOUND ==
warning: [options] bootstrap class path not set in conjunction with -source 1.6
src\minecraft\net\minecraft\src\mod_DeathDesert.java:18: error: illegal forward
reference
public static final Achievement getpoison = new Achievement(4560, "getpoison"
, 8, 5, mod_DeathDesert.Poison, minedeathcactus).registerAchievement();
^
1 error
1 warning
==================
mod_DeathDesert:
package net.minecraft.src;
import java.util.Map;
import net.minecraft.client.Minecraft;
import java.util.Random;
import java.util.List;
{
//Blocks
public static final Block DeathSand = new BlockDeathSand(130, 0).setHardness(0.5F).setStepSound(Block.soundSandFootstep).setBlockName("DeathSand");
public static final Block DeathCactus = new BlockDeathCactus(131, 0).setHardness(0.4F).setStepSound(Block.soundClothFootstep).setBlockName("DeathCactus");
//public static final Block DeathSandstone = new BlockDeathSandstone(132,0).setStepSound(Block.soundStoneFootstep).setHardness(0.8F).setBlockName("DeathSandstone");
//Items
public static final Item Poison = new Item(415).setItemName("Poison");
//Achievements
public static final Achievement getpoison = new Achievement(4560, "getpoison", 8, 5, mod_DeathDesert.Poison, minedeathcactus).registerAchievement();
public static final Achievement adventure = new Achievement(4561, "adventure", 7, 9, mod_DeathDesert.DeathSand, null).registerAchievement();
public static final Achievement minedeathcactus = new Achievement(4562, "minedeathcactus", 9, 7, mod_DeathDesert.DeathCactus, adventure).registerAchievement();
public static final Achievement killmummy = new Achievement(4563, "killmummy", 10, 10, Item.diamond, adventure).registerAchievement();
/** Textures for multi textured blocks */
//Death Cactus Texture
public static int DeathCactusSide;
public static int DeathCactusTop;
public static int DeathCactusBottom;
//Death Sandstone Texture
public static int DeathSandstoneSide;
public static int DeathSandstoneTop;
public static int DeathSandstoneBottom;
public String getVersion()
{
return "1.2.3";
}
public void load()
{
ModLoader.setInGUIHook(this, true, false);
//Block Base
//ModLoader.addName(RedstoneBlock, "Redstone of Block");
//ModLoader.registerBlock(RedstoneBlock);
//RedstoneBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/RainbowLuigi281FirstMod/Blocks/OreBlocks/RedstoneBlock.png");
/** Blocks */
//Death Cactus
ModLoader.addName(DeathCactus, "Death Cactus");
ModLoader.registerBlock(DeathCactus);
DeathCactusTop = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathCactus/DeathCactusTop.png");
DeathCactusBottom = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathCactus/DeathCactusBottom.png");
DeathCactusSide = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathCactus/DeathCactusSide.png");
ModLoader.addRecipe(new ItemStack(mod_DeathDesert.DeathCactus, 1), new Object[] {
"##", Character.valueOf('#'), Block.dirt
});
//Death Sand
ModLoader.addName(DeathSand, "Death Sand");
ModLoader.registerBlock(DeathSand);
DeathSand.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathSand.png");
ModLoader.addRecipe(new ItemStack(mod_DeathDesert.DeathSand, 1), new Object[] {
"#", Character.valueOf('#'), Block.dirt
});
//Death Sandstone
//ModLoader.addName(DeathSandstone, "Death Sandstone");
//ModLoader.registerBlock(DeathSandstone);
//DeathSandstoneTop = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathSandstone/DeathSandstoneTop.png");
//DeathSandstoneBottom = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathSandstone/DeathSandstoneBottom.png");
//DeathSandstoneSide = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathSandstone/DeathSandstoneSide.png");
//ModLoader.addRecipe(new ItemStack(mod_DeathDesert.DeathSandstone, 1), new Object[] {
//"###", Character.valueOf('#'), Block.dirt
//});
/** Items */
//Poison
ModLoader.addName(Poison, "Poison");
Poison.iconIndex = ModLoader.addOverride("/gui/items.png", "/DeathDesert/Items/Misc/Poison.png");
ModLoader.addSmelting(mod_DeathDesert.DeathCactus.blockID, new ItemStack(mod_DeathDesert.Poison, 1));
/** Achievements */
ModLoader.addAchievementDesc(getpoison, "Deadly Poison", "Cook a death cactus in a furnace to receive its poison.");
ModLoader.addAchievementDesc(adventure, "It's time for adventure!", "Step foot into a death desert biome.");
ModLoader.addAchievementDesc(minedeathcactus, "Punching Cacti", "Harvest a death cactus.");
ModLoader.addAchievementDesc(killmummy, "Mummy Murderer", "Kill a mummy.");
//Item Base
//ModLoader.addName(PeanutShell, "Peanut");
//PeanutShell.iconIndex = ModLoader.addOverride("/gui/items.png", "/RainbowLuigi281FirstMod/Items/Food/PeanutShell.png");
//Crafting Base
//ModLoader.addRecipe(new ItemStack(Item.saddle, 1), new Object[] {
//"###", " D ", " F ", Character.valueOf('#'), Item.leather, Character.valueOf('D'), Item.silk, Character.valueOf('F'), Item.ingotIron
//});
//Smelting Base
//ModLoader.addSmelting(mod_RainbowLuigi281FirstMod.DarkRottenFlesh.shiftedIndex, new ItemStack(mod_RainbowLuigi281FirstMod.DarkLeather, 1));
}
/** How you get Achievements */
public void takenFromFurnace(EntityPlayer entityplayer, ItemStack itemstack)
{
if(itemstack.itemID == mod_DeathDesert.Poison.shiftedIndex)
{
entityplayer.addStat(getpoison, 1);
}
}
/** How blocks show up in the creative inventory */
boolean addedToGui;
public boolean OnTickInGUI(float f, Minecraft minecraft, GuiScreen guiscreen)
{
if ((guiscreen instanceof GuiContainerCreative))
{
if (!addedToGui)
{
Container container = ((GuiContainer)guiscreen).inventorySlots;
List list = ((ContainerCreative)container).itemList;
list.add(new ItemStack(DeathSand, 1));
list.add(new ItemStack(DeathCactus, 1));
addedToGui = true;
}
}
else addedToGui = false;
return true;
}
}
public class mod_DeathDesert extends BaseModMp
I also have an error when I made a sandstone block. If you want to help me fix you can.
It is because you haven't yet initialized the instance called minedeathcactus. Putting that getpoison achievement after the minedeathcactus achievement line will solve that problem.
Also, the
OnTickInGame
method is now
onTickInGame
ModLoader's methods all changed to correctly follow "camel-case" is the 1.2.3 update.
Could you make a tutorial about this without changing any core files.
But I'd rather have a tutorial on potions first. (I know it's already in the to do list)
All of my tutorials are made to not edit base classes. If there is something that requires base class editing, I won't make a tutorial on it.
Hello My Friend! I have been trying to get the custom NPC to work but it will not spawn and i cannot get it to work in the game, i have no errors in my code and it still dosent seem to be working! Any Ideas?
Hey everyone,
I certainly need help with my first mod. Made a new plant which drops an item, but neither is the plant generated automatically nor does it grow in stages :/
BlockKartoffelpflanze.java :
package net.minecraft.src;
import java.util.Random;
public class BlockKartoffelpflanze extends BlockCrops
{
protected BlockKartoffelpflanze(int i, int j)
{
super(i, j);
setTickRandomly(true);
float f = 0.5F;
setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f);
}
protected boolean canThisPlantGrowOnThisBlockID(int i)
{
return i == Block.tilledField.blockID;
}
public void updateTick(World world, int i, int j, int k, Random random)
{
super.updateTick(world, i, j, k, random);
if(world.getBlockLightValue(i, j + 1, k) &--#62;= 9)
{
int l = world.getBlockMetadata(i, j, k);
if(l &--#60; 7)
{
float f = getGrowthRate(world, i, j, k);
if(random.nextInt((int)(25F / f) + 1) == 0)
{
l++;
world.setBlockMetadataWithNotify(i, j, k, l);
}
}
}
}
public void fertilize(World world, int i, int j, int k)
{
world.setBlockMetadataWithNotify(i, j, k, 7);
}
private float getGrowthRate(World world, int i, int j, int k)
{
float f = 1.0F;
int l = world.getBlockId(i, j, k - 1);
int i1 = world.getBlockId(i, j, k + 1);
int j1 = world.getBlockId(i - 1, j, k);
int k1 = world.getBlockId(i + 1, j, k);
int l1 = world.getBlockId(i - 1, j, k - 1);
int i2 = world.getBlockId(i + 1, j, k - 1);
int j2 = world.getBlockId(i + 1, j, k + 1);
int k2 = world.getBlockId(i - 1, j, k + 1);
boolean flag = j1 == blockID || k1 == blockID;
boolean flag1 = l == blockID || i1 == blockID;
boolean flag2 = l1 == blockID || i2 == blockID || j2 == blockID || k2 == blockID;
for(int l2 = i - 1; l2 &--#60;= i + 1; l2++)
{
for(int i3 = k - 1; i3 &--#60;= k + 1; i3++)
{
int j3 = world.getBlockId(l2, j - 1, i3);
float f1 = 0.0F;
if(j3 == Block.tilledField.blockID)
{
f1 = 1.0F;
if(world.getBlockMetadata(l2, j - 1, i3) &--#62; 0)
{
f1 = 3F;
}
}
if(l2 != i || i3 != k)
{
f1 /= 4F;
}
f += f1;
}
}
if(flag2 || flag && flag1)
{
f /= 2.0F;
}
return f;
}
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
if(j == 0)
{
return blockIndexInTexture;
}
if(j == 1)
{
return mod_kartoffel.kartoffelpfl1;
}
if(j == 2)
{
return mod_kartoffel.kartoffelpfl1;
}
if(j == 3)
{
return mod_kartoffel.kartoffelpfl1;
}
if(j == 4)
{
return mod_kartoffel.kartoffelpfl1;
}
if(j == 5)
{
return mod_kartoffel.kartoffelpfl1;
}
if(j == 6)
{
return mod_kartoffel.kartoffelpfl2;
}
if(j == 7)
{
return mod_kartoffel.kartoffelpfl2;
}
return -1;
}
public int getRenderType()
{
return 1;
}
public void dropBlockAsItemWithChance(World world, int i, int j, int k, int l, float f, int i1)
{
super.dropBlockAsItemWithChance(world, i, j, k, l, f, 0);
if(world.isRemote)
{
return;
}
int j1 = 3 + i1;
for(int k1 = 0; k1 &--#60; j1; k1++)
{
if(world.rand.nextInt(15) &--#60;= l)
{
float f1 = 0.7F;
float f2 = world.rand.nextFloat() * f1 + (1.0F - f1) * 0.5F;
float f3 = world.rand.nextFloat() * f1 + (1.0F - f1) * 0.5F;
float f4 = world.rand.nextFloat() * f1 + (1.0F - f1) * 0.5F;
EntityItem entityitem = new EntityItem(world, (float)i + f2, (float)j + f3, (float)k + f4, new ItemStack(mod_kartoffel.kartoffel));
entityitem.delayBeforeCanPickup = 10;
world.spawnEntityInWorld(entityitem);
}
}
}
public int idDropped(int i, Random random, int j)
{
if(i == 7)
{
return mod_kartoffel.kartoffel.shiftedIndex;
} else
{
return -1;
}
}
public int quantityDropped(Random random)
{
return 2;
}
}
WorldGenKartoffel.java:
package net.minecraft.src;
import java.util.Random;
public class WorldGenKartoffel extends WorldGenerator
{
public WorldGenKartoffel()
{}
public boolean generate(World world, Random random, int randPosX, int randPosY, int randPosZ)
{
int KP = mod_kartoffel.kartoffelpflanze.blockID;
world.setBlockWithNotify(randPosX, randPosY, randPosZ, KP);
world.setBlockAndMetadataWithNotify(randPosX, randPosY + 1, randPosZ, KP, 1);
return true;
}
}
mod_kartoffel.java:
package net.minecraft.src;
import java.util.Random;
public class mod_kartoffel extends BaseModMp
{
public static final Item kartoffel = new ItemKartoffelroh(386, 1, false).setPotionEffect(Potion.hunger.id, 4, 1, 0.3F).setItemName("kartoffel");
public static final Item ofenkartoffel = new ItemOfenkartoffel(387, 5, false).setItemName("ofenkartoffel");
public static final Item kartoffelbrei = new ItemKartoffelbrei(388, 5, false).setItemName("kartoffelbrei");
public static final Block kartoffelpflanze = new BlockKartoffelpflanze(181, 0).setHardness(0.3F).setBlockName("kartoffelpflanze");
public static final Item kartoffelkeim = (new ItemReed(389, kartoffelpflanze)).setIconCoord(0, 0).setItemName("kartoffelkeim");
public static int kartoffelpfl1 = ModLoader.addOverride("/terrain.png", "/potatoe/kartoffelpfl1.png");
public static int kartoffelpfl2 = ModLoader.addOverride("/terrain.png", "/potatoe/kartoffelpfl2.png");
public void load()
{
kartoffel.iconIndex = ModLoader.addOverride("/gui/items.png", "/potatoe/kartoffelroh.png");
ofenkartoffel.iconIndex = ModLoader.addOverride("/gui/items.png", "/potatoe/ofenkartoffel.png");
kartoffelbrei.iconIndex = ModLoader.addOverride("/gui/items.png", "/potatoe/kartoffelbrei.png");
kartoffelkeim.iconIndex = ModLoader.addOverride("/gui/items.png", "/potatoe/kartoffelkeim.png");
ModLoader.registerBlock(kartoffelpflanze);
kartoffelpflanze.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/potatoe/kartoffelpfl0.png");
kartoffelpfl1 = ModLoader.addOverride("/terrain.png", "/potatoe/kartoffelpfl1.png");
kartoffelpfl2 = ModLoader.addOverride("/terrain.png", "/potatoe/kartoffelpfl2.png");
ModLoader.addName(kartoffelkeim, "Gekeimte Kartoffel");
ModLoader.addName(kartoffel, "Kartoffel");
ModLoader.addName(ofenkartoffel, "Ofenkartoffel");
ModLoader.addName(kartoffelbrei, "Kartoffelbrei");
ModLoader.addSmelting(kartoffel.shiftedIndex, new ItemStack(ofenkartoffel, 1));
ModLoader.addRecipe(new ItemStack(kartoffelbrei, 1), new Object[] {" X", " #", Character.valueOf('X'), kartoffel, Character.valueOf('#'), Item.bowlEmpty});
}
public void generateSurface(World world, Random rand, int chunkX, int chunkZ) {
for(int i = 0; i &--#60; 20; i++) {
int randPosX = chunkX + rand.nextInt(4);
int randPosY = rand.nextInt(60+170);
int randPosZ = chunkZ + rand.nextInt(4);
(new WorldGenMinable(this.kartoffelpflanze.blockID, 16)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
public String getVersion()
{
return "0.3";
}
}
Thanks in advance,
Retrobyte
First of all, you can delete your WorldGenKartoffel class because it isn't needed and you aren't calling it anyway. I'll need a little more information on what you mean about it not growing in stages though. Does it skip a few and go straight to the last stage or something?
Can someone please tell me what's wrong in this code?
I tried to make a mana ore block which drops a mana crystal when broken.
Here's the code:
The Mod_ManaOre.java
package net.minecraft.src;
public class mod_ManaOre extends BaseMod
{
public static final Block ManaOre = new BlockManaOre(160, 0).setBlockName("Mana Ore").setHardness(7.5F).setResistance(15F).setLightValue(1F);
public void load()
{
ManaOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/MagikCraft/Mana Ore.png");
ModLoader.registerBlock(ManaOre);
ModLoader.addName(ManaOre, "Mana Ore");
}
public String getVersion()
{
return "1.2.3";
}
}
The BlockManaOre.java
package net.minecraft.src;
import java.util.Random;
public class BlockManaOre extends Block
{
public BlockManaOre(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random, int j)
{
return mod_ManaCrystal.ItemManaCrystal.shiftedIndex;
}
public int quantityDropped(Random random)
{
return 3;
}}
The mod_ManaCrystal.java:
package net.minecraft.src;
public class mod_ManaCrystal extends BaseMod
{
public static final Item ManaCrystal = new ItemManaCrystal(5000).setItemName("Mana Crystal");
public void load()
{
ManaCrystal.iconIndex = ModLoader.addOverride("/gui/items.png", "/MagikCraft/ManaCrystal.png");
ModLoader.addName(ManaCrystal, "Mana Crystal");
}
public String getVersion()
{
return "1.2.3";
}
}
The ItemManaCrystal.java
package net.minecraft.src;
public class ItemManaCrystal extends Item
{
public ItemManaCrystal(int i)
{
super(i);
maxStackSize = 64;
}
}
Here's the crash report from the recompile.bat:
== MCP 6.0 (data: 6.0, client: 1.2.3, server: 1.2.3) ==
# found jad, jad patches, ff patches, osx patches, srgs, name csvs, doc csvs, pa
ram csvs, astyle, astyle config
== Recompiling client ==
&--#62; Cleaning bin
&--#62; Recompiling
'"C:\Program Files\Java\jdk1.7.0_01\bin\javac" -g -source 1.6 -target 1.6 -class
path "lib;lib\*;jars\...' failed : 1
== ERRORS FOUND ==
warning: [options] bootstrap class path not set in conjunction with -source 1.6
src\minecraft\net\minecraft\src\BlockManaOre.java:14: error: cannot find symbol
return mod_ManaCrystal.ItemManaCrystal.shiftedIndex;
^
symbol: variable ItemManaCrystal
location: class mod_ManaCrystal
1 error
1 warning
==================
!! Can not find server sources, try decompiling !!
Please tell me what I did wrong!
As has been said, merge your mod_ classes. Then in your block class, change the return statement to this:
return mod_ManaCrystal.ManaCrystal.shiftedIndex;
The reason for you getting an error doing what you're doing is because you need to call the instance of the item in the mod_ class. How you were doing it, you were making it look in the mod_ class for something called ItemManaCrystal, but that instance doesn't exist. ItemManaCrystal is a class, not an instance created in the mod_ class.
package net.minecraft.src;
import java.util.Random;
public class mod_WorldGen extends BaseMod
{
public void load()
{
}
public void generateSurface(World world, Random random, int i, int j)
{
for(int k = 0; k &--#60; 10; k++)
{
int RandPosX = i + random.nextInt(5);
int RandPosY = random.nextInt(80);
int RandPosZ = j + random.nextInt(5);
(new WorldGenUndergroundBase()).generate(world, random, RandPosX, RandPosY, RandPosZ);
}
}
public String getVersion()
{
return "1.1";
}
}
I'm not sure what you are trying to do with that. Can you try and explain, other wise just use a basic one like RetroByte said.
i've put all the code in correctly and i've not got any error messages but i cannot find my human npc anywhere.
i have literally searched for hours. Do you have any suugestions?
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
First of all, thanks for your fast reply. And you´re right, when it grows, it grows straight to the last stage :/
I tried without this WorldGen first, but it didn´t spawn naturally either.
How soon do you need to have this block finished. I am going to make a tutorial on crops, but if you need it now I can make it within 1-2 days or so. A few other people want it as well.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
yes i did add
public boolean isAIEnabled()
{
return true;
}
but when ever i run minecaft it crases after like 2 minetues in to testing
i start single player and play then it just says saving chunks
plz help mabey its the single playercomands messing with it
Well, I´m trying this for a few days now and it would be cool to have it asap, but of course I´ll patiently wait
Would be nice if you added world generation of the plant, too.
I haven't been making any new tutorials lately, so I'm trying to add some new ones. Shouldn't be too long.
yes i did add
public boolean isAIEnabled()
{
return true;
}
but when ever i run minecaft it crases after like 2 minetues in to testing
i start single player and play then it just says saving chunks
plz help mabey its the single playercomands messing with it
Did you install SPC into your MCP jar?
For the crash, make sure you don't have your render distance on far, and that Advanced OpenGL is turned off. Even though I have a 64bit PC and Java, I can't use a far render distance and Advanced GL. I get a crash too.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
The method registerEntityID(Class<EntityNarwal>, String, int) is undefined
for the type ModLoader
and
Multiple markers at this line
- Line breakpoint:mod_Tuts [line: 12] - load()
- The method AddSpawn(Class, int, int, int, JsonNumberNode)
from the type ModLoader refers to the missing type JsonNumberNode
- The method addSpawn(Class<EntityNarwal>, int, int, int,
EnumCreatureType) is undefined for the type ModLoader
public class EntityGhast extends EntityFlying implements IMob
if any one noes how to make your mob tamable i would realy wont to now i have studied the Entitywolf but i just cant get it and how do you make your mob rideable and controlable
Actually, Flan's tutorial on SMP modding is Updated.
Here is the link: http://www.minecraftforum.net/topic/352121-smp-mods-modloadermp-modding-310511/
mod_DeathDesert:
package net.minecraft.src; import java.util.Map; import net.minecraft.client.Minecraft; import java.util.Random; import java.util.List; public class mod_DeathDesert extends BaseModMp { //Blocks public static final Block DeathSand = new BlockDeathSand(130, 0).setHardness(0.5F).setStepSound(Block.soundSandFootstep).setBlockName("DeathSand"); public static final Block DeathCactus = new BlockDeathCactus(131, 0).setHardness(0.4F).setStepSound(Block.soundClothFootstep).setBlockName("DeathCactus"); public static final Block DeathSandstone = new BlockDeathSandstone(132,0).setStepSound(Block.soundStoneFootstep).setHardness(0.8F).setBlockName("DeathSandstone"); //Items public static final Item Poison = new Item(415).setItemName("Poison"); //Achievements public static final Achievement getpoison = new Achievement(4560, "getpoison", 8, 5, mod_DeathDesert.Poison, null).registerAchievement(); public static final Achievement adventure = new Achievement(4561, "adventure", 7, 9, mod_DeathDesert.DeathSand, null).registerAchievement(); public static final Achievement minedeathcactus = new Achievement(4562, "minedeathcactus", 9, 7, mod_DeathDesert.DeathCactus, null).registerAchievement(); public static final Achievement killmummy = new Achievement(4563, "killmummy", 10, 10, Item.diamond, null).registerAchievement(); /** Textures for multi textured blocks */ //Death Cactus Texture public static int DeathCactusSide; public static int DeathCactusTop; public static int DeathCactusBottom; //Death Sandstone Texture public static int DeathSandstoneSide; public static int DeathSandstoneTop; public static int DeathSandstoneBottom; public String getVersion() { return "1.2.3"; } public void load() { ModLoader.setInGUIHook(this, true, false); //Block Base //ModLoader.addName(RedstoneBlock, "Redstone of Block"); //ModLoader.registerBlock(RedstoneBlock); //RedstoneBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/RainbowLuigi281FirstMod/Blocks/OreBlocks/RedstoneBlock.png"); /** Blocks */ //Death Cactus ModLoader.addName(DeathCactus, "Death Cactus"); ModLoader.registerBlock(DeathCactus); DeathCactusTop = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathCactus/DeathCactusTop.png"); DeathCactusBottom = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathCactus/DeathCactusBottom.png"); DeathCactusSide = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathCactus/DeathCactusSide.png"); ModLoader.addRecipe(new ItemStack(mod_DeathDesert.DeathCactus, 1), new Object[] { "##", Character.valueOf('#'), Block.dirt }); //Death Sand ModLoader.addName(DeathSand, "Death Sand"); ModLoader.registerBlock(DeathSand); DeathSand.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathSand.png"); ModLoader.addRecipe(new ItemStack(mod_DeathDesert.DeathSand, 1), new Object[] { "#", Character.valueOf('#'), Block.dirt }); //Death Sandstone ModLoader.addName(DeathSandstone, "Death Sandstone"); ModLoader.registerBlock(DeathSandstone); DeathSandstoneTop = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathSandstone/DeathSandstoneTop.png"); DeathSandstoneBottom = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathSandstone/DeathSandstoneBottom.png"); DeathSandstoneSide = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathSandstone/DeathSandstoneSide.png"); ModLoader.addRecipe(new ItemStack(mod_DeathDesert.DeathSandstone, 1), new Object[] { "###", Character.valueOf('#'), Block.dirt }); /** Items */ //Poison ModLoader.addName(Poison, "Poison"); Poison.iconIndex = ModLoader.addOverride("/gui/items.png", "/DeathDesert/Items/Misc/Poison.png"); ModLoader.addSmelting(mod_DeathDesert.DeathCactus.blockID, new ItemStack(mod_DeathDesert.Poison, 1)); /** Achievements */ ModLoader.addAchievementDesc(getpoison, "Deadly Poison", "Cook a death cactus in a furnace to receive its poison."); ModLoader.addAchievementDesc(adventure, "It's time for adventure!", "Step foot into a death desert biome."); ModLoader.addAchievementDesc(minedeathcactus, "Punching Cacti", "Harvest a death cactus."); ModLoader.addAchievementDesc(killmummy, "Mummy Murderer", "Kill a mummy."); //Item Base //ModLoader.addName(PeanutShell, "Peanut"); //PeanutShell.iconIndex = ModLoader.addOverride("/gui/items.png", "/RainbowLuigi281FirstMod/Items/Food/PeanutShell.png"); //Crafting Base //ModLoader.addRecipe(new ItemStack(Item.saddle, 1), new Object[] { //"###", " D ", " F ", Character.valueOf('#'), Item.leather, Character.valueOf('D'), Item.silk, Character.valueOf('F'), Item.ingotIron //}); //Smelting Base //ModLoader.addSmelting(mod_RainbowLuigi281FirstMod.DarkRottenFlesh.shiftedIndex, new ItemStack(mod_RainbowLuigi281FirstMod.DarkLeather, 1)); } /** How you get Achievements */ public void takenFromFurnace(EntityPlayer entityplayer, ItemStack itemstack) { if(itemstack.itemID == mod_DeathDesert.Poison.shiftedIndex) { entityplayer.addStat(getpoison, 1); } } /** How blocks show up in the creative inventory */ boolean addedToGui; public boolean OnTickInGUI(float f, Minecraft minecraft, GuiScreen guiscreen) { if ((guiscreen instanceof GuiContainerCreative)) { if (!addedToGui) { Container container = ((GuiContainer)guiscreen).inventorySlots; List list = ((ContainerCreative)container).itemList; list.add(new ItemStack(DeathSand, 1)); list.add(new ItemStack(DeathCactus, 1)); addedToGui = true; } } else addedToGui = false; return true; } }Something like that should work.
together they are powerful beyond imagination."
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumYou know what I would do, I would just make two pngs that are exactly the same and just name them different things (I would do this because I had problems in 1.1, and these problems were caused by me trying to link two textures to the same png)
You obviously didn't use my tutorials for multi-textured blocks because my tutorial does not mention casesanywhere. If you think adding cases like you did would work for what you were trying to do, you obviously need to learn Java.
together they are powerful beyond imagination."
It somewhat works. The example you gave me works, but when I set up the other achievements it gives me an error.
Error:
mod_DeathDesert:
package net.minecraft.src; import java.util.Map; import net.minecraft.client.Minecraft; import java.util.Random; import java.util.List; { //Blocks public static final Block DeathSand = new BlockDeathSand(130, 0).setHardness(0.5F).setStepSound(Block.soundSandFootstep).setBlockName("DeathSand"); public static final Block DeathCactus = new BlockDeathCactus(131, 0).setHardness(0.4F).setStepSound(Block.soundClothFootstep).setBlockName("DeathCactus"); //public static final Block DeathSandstone = new BlockDeathSandstone(132,0).setStepSound(Block.soundStoneFootstep).setHardness(0.8F).setBlockName("DeathSandstone"); //Items public static final Item Poison = new Item(415).setItemName("Poison"); //Achievements public static final Achievement getpoison = new Achievement(4560, "getpoison", 8, 5, mod_DeathDesert.Poison, minedeathcactus).registerAchievement(); public static final Achievement adventure = new Achievement(4561, "adventure", 7, 9, mod_DeathDesert.DeathSand, null).registerAchievement(); public static final Achievement minedeathcactus = new Achievement(4562, "minedeathcactus", 9, 7, mod_DeathDesert.DeathCactus, adventure).registerAchievement(); public static final Achievement killmummy = new Achievement(4563, "killmummy", 10, 10, Item.diamond, adventure).registerAchievement(); /** Textures for multi textured blocks */ //Death Cactus Texture public static int DeathCactusSide; public static int DeathCactusTop; public static int DeathCactusBottom; //Death Sandstone Texture public static int DeathSandstoneSide; public static int DeathSandstoneTop; public static int DeathSandstoneBottom; public String getVersion() { return "1.2.3"; } public void load() { ModLoader.setInGUIHook(this, true, false); //Block Base //ModLoader.addName(RedstoneBlock, "Redstone of Block"); //ModLoader.registerBlock(RedstoneBlock); //RedstoneBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/RainbowLuigi281FirstMod/Blocks/OreBlocks/RedstoneBlock.png"); /** Blocks */ //Death Cactus ModLoader.addName(DeathCactus, "Death Cactus"); ModLoader.registerBlock(DeathCactus); DeathCactusTop = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathCactus/DeathCactusTop.png"); DeathCactusBottom = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathCactus/DeathCactusBottom.png"); DeathCactusSide = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathCactus/DeathCactusSide.png"); ModLoader.addRecipe(new ItemStack(mod_DeathDesert.DeathCactus, 1), new Object[] { "##", Character.valueOf('#'), Block.dirt }); //Death Sand ModLoader.addName(DeathSand, "Death Sand"); ModLoader.registerBlock(DeathSand); DeathSand.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathSand.png"); ModLoader.addRecipe(new ItemStack(mod_DeathDesert.DeathSand, 1), new Object[] { "#", Character.valueOf('#'), Block.dirt }); //Death Sandstone //ModLoader.addName(DeathSandstone, "Death Sandstone"); //ModLoader.registerBlock(DeathSandstone); //DeathSandstoneTop = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathSandstone/DeathSandstoneTop.png"); //DeathSandstoneBottom = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathSandstone/DeathSandstoneBottom.png"); //DeathSandstoneSide = ModLoader.addOverride("/terrain.png", "/DeathDesert/Blocks/Nature/DeathSandstone/DeathSandstoneSide.png"); //ModLoader.addRecipe(new ItemStack(mod_DeathDesert.DeathSandstone, 1), new Object[] { //"###", Character.valueOf('#'), Block.dirt //}); /** Items */ //Poison ModLoader.addName(Poison, "Poison"); Poison.iconIndex = ModLoader.addOverride("/gui/items.png", "/DeathDesert/Items/Misc/Poison.png"); ModLoader.addSmelting(mod_DeathDesert.DeathCactus.blockID, new ItemStack(mod_DeathDesert.Poison, 1)); /** Achievements */ ModLoader.addAchievementDesc(getpoison, "Deadly Poison", "Cook a death cactus in a furnace to receive its poison."); ModLoader.addAchievementDesc(adventure, "It's time for adventure!", "Step foot into a death desert biome."); ModLoader.addAchievementDesc(minedeathcactus, "Punching Cacti", "Harvest a death cactus."); ModLoader.addAchievementDesc(killmummy, "Mummy Murderer", "Kill a mummy."); //Item Base //ModLoader.addName(PeanutShell, "Peanut"); //PeanutShell.iconIndex = ModLoader.addOverride("/gui/items.png", "/RainbowLuigi281FirstMod/Items/Food/PeanutShell.png"); //Crafting Base //ModLoader.addRecipe(new ItemStack(Item.saddle, 1), new Object[] { //"###", " D ", " F ", Character.valueOf('#'), Item.leather, Character.valueOf('D'), Item.silk, Character.valueOf('F'), Item.ingotIron //}); //Smelting Base //ModLoader.addSmelting(mod_RainbowLuigi281FirstMod.DarkRottenFlesh.shiftedIndex, new ItemStack(mod_RainbowLuigi281FirstMod.DarkLeather, 1)); } /** How you get Achievements */ public void takenFromFurnace(EntityPlayer entityplayer, ItemStack itemstack) { if(itemstack.itemID == mod_DeathDesert.Poison.shiftedIndex) { entityplayer.addStat(getpoison, 1); } } /** How blocks show up in the creative inventory */ boolean addedToGui; public boolean OnTickInGUI(float f, Minecraft minecraft, GuiScreen guiscreen) { if ((guiscreen instanceof GuiContainerCreative)) { if (!addedToGui) { Container container = ((GuiContainer)guiscreen).inventorySlots; List list = ((ContainerCreative)container).itemList; list.add(new ItemStack(DeathSand, 1)); list.add(new ItemStack(DeathCactus, 1)); addedToGui = true; } } else addedToGui = false; return true; } } public class mod_DeathDesert extends BaseModMpI also have an error when I made a sandstone block. If you want to help me fix you can.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumYou have no idea how much this helped me, but thank you for posting your problem, sorry I don't know how to fix it, but thank you for posting it, as it got me thinking in the right direction, so that I could fix a moding problem I had -Thank You-
change
to
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumNot sure what your problem is, but I would suggest that you combine "mod_ManaCrystal" with "mod_ManaOre" as there is no reason to have two mod_ files for the same mod. Example:
package net.minecraft.src; public class mod_ManaCrystal extends BaseMod { public static final Item ManaCrystal = newItemManaCrystal(5000).setItemName("ManaCrystal"); public static final Block ManaOre = new BlockManaOre(160, 0).setBlockName("Mana Ore").setHardness(7.5F).setResistance(15F).setLightValue(1F); public void load() { ManaCrystal.iconIndex = ModLoader.addOverride("/gui/items.png", "/MagikCraft/ManaCrystal.png"); ModLoader.addName(ManaCrystal, "Mana Crystal"); ManaOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/MagikCraft/Mana Ore.png"); ModLoader.registerBlock(ManaOre); ModLoader.addName(ManaOre, "Mana Ore"); } public String getVersion() { return "1.2.3"; } }-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI would suggest that you post all of your code from the file that it is having an error with.
triyed
getNavigator().func_48664_a(true);
float f = 0.25F;
tasks.addTask(3, new EntityAITempt(this, 0.25F, Item.wheat.shiftedIndex, true));
but it dousent work and the true was a false and thats dident work ether so it would be great is some one were to now
It is because you haven't yet initialized the instance called minedeathcactus. Putting that getpoison achievement after the minedeathcactus achievement line will solve that problem.
Also, the
method is now
ModLoader's methods all changed to correctly follow "camel-case" is the 1.2.3 update.
Please wait until I make the tutorial.
All of my tutorials are made to not edit base classes. If there is something that requires base class editing, I won't make a tutorial on it.
Post your code please.
First of all, you can delete your WorldGenKartoffel class because it isn't needed and you aren't calling it anyway. I'll need a little more information on what you mean about it not growing in stages though. Does it skip a few and go straight to the last stage or something?
As has been said, merge your mod_ classes. Then in your block class, change the return statement to this:
The reason for you getting an error doing what you're doing is because you need to call the instance of the item in the mod_ class. How you were doing it, you were making it look in the mod_ class for something called ItemManaCrystal, but that instance doesn't exist. ItemManaCrystal is a class, not an instance created in the mod_ class.
I'm not sure what you are trying to do with that. Can you try and explain, other wise just use a basic one like RetroByte said.
Did you add in
public boolean isAIEnabled() { return true; }?
Post your code please.
together they are powerful beyond imagination."
How soon do you need to have this block finished. I am going to make a tutorial on crops, but if you need it now I can make it within 1-2 days or so. A few other people want it as well.
together they are powerful beyond imagination."
public boolean isAIEnabled()
{
return true;
}
but when ever i run minecaft it crases after like 2 minetues in to testing
i start single player and play then it just says saving chunks
plz help mabey its the single playercomands messing with it
I haven't been making any new tutorials lately, so I'm trying to add some new ones. Shouldn't be too long.
Did you install SPC into your MCP jar?
For the crash, make sure you don't have your render distance on far, and that Advanced OpenGL is turned off. Even though I have a 64bit PC and Java, I can't use a far render distance and Advanced GL. I get a crash too.
together they are powerful beyond imagination."
and