Block animations are hard. I'm currently working with someone trying to do them and get them working well.
Awesome, Thanks!
It is on the list to do, I'll get to it when I get to it.
A crash at the crafting grid normally indicates something wrong with the texture/s of the block. The crash report also indicates this. Make sure that it is the correct size, format and in the right location.
They are quite difficult, especially to make a tutorial on. I can try once I get rid of some of the tutorials on the list already.
I think we were talking about mobs? Something like this should work.
Put that in the constructor of your biome class. The three ints at the end are the same as ModLoader's addSpawn method.
Probability of spawning in chunk - Minimum in Chunk - Maximum in Chunk
Character.valueOf is part of Java. More specifically, char. It is a primitive data type, and is a single 16-bit Unicode Character. We use it in Minecraft for getting the values of characters that we add into a string/s for the recipe of an item. So then we can assign an ingredient to that symbol/character in the recipe, then the code in CraftingManager.java reads it all, and makes it an actual recipe in the game.
Block.dirt is simply the name of the an instance in Block.java called "dirt". As I said above, It is used by CraftingManager.java to make an actual recipe. Block.dirt in code, is the same thing as having a dirt block in your inventory, or even just the world around.
Does this clear up a few things for you?
Yes. But I decided I was making a craftable item and not an ore XD
Do you know how to make mob spawners? Because I want to make a mob spawner generate on my boat, I also want to make it spawn a custom mob that I made, so, do you know how to do this?
Put that in the constructor of your biome class. The three ints at the end are the same as ModLoader's addSpawn method.
Probability of spawning in chunk - Minimum in Chunk - Maximum in Chunk
No, a custom block. I made a custom cactus block and I want it to spawn in my biome
I am having issues with adding an achievement to my mod. Here's part of the code:
public static final Achievement Bilskos = new Achievement(6130, "Bilskos", 0, -3, mod_Mystics.Bilsko, null).registerAchievement();
public static final Achievement Calibers = new Achievement(6131, "Calibers", 0, -4, mod_Mystics.Caliber, null).registerAchievement();
Yes. But I decided I was making a craftable item and not an ore XD
Titanium mod is Copyrighted :3
One thing you must know about coding, is that it is very flexible and you can do what you like with it. I never said anything about making it an ore. You just have to make a recipe that suits it. Referencing things from Item and Block, and all the other classes.
Do you know how to make mob spawners? Because I want to make a mob spawner generate on my boat, I also want to make it spawn a custom mob that I made, so, do you know how to do this?
Maybe have a look at TileEntityMobSpawner and how that is assigned to BlockMobSpawner.
No, a custom block. I made a custom cactus block and I want it to spawn in my biome
Oh, sorry. I'll get back to you when I have the solution. I think I know how to do it. I just need to test it.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
I made a basic HumanNPC from your code but I THINK it doesn't spawn. I set it's spawn rate really high just so i can see it to make sure it's there. Is It because of my picture or my code? Here's My code of the human. P.S. I tried to make this a spoiler If i did this wrong please show me how to make one.
mod_Person.java
package net.minecraft.src;
import java.util.Map;
public class mod_Person extends BaseMod
{
If you see this The Character.valueOf basiclly means that dirt = # if you put ### that means three dirt in a row. You can also put more of then 1 of these in one line but seperate them with a comma like so:
I am having issues with adding an achievement to my mod. Here's part of the code:
public static final Achievement Bilskos = new Achievement(6130, "Bilskos", 0, -3, mod_Mystics.Bilsko, null).registerAchievement();
public static final Achievement Calibers = new Achievement(6131, "Calibers", 0, -4, mod_Mystics.Caliber, null).registerAchievement();
They don't show up anywhere in the achievement GUI nor does the achievement pop up when my item is crafted. Can you help me?
ModLoader's methods all changed to the correct camel-casing in 1.2.3. Also, you had the second addAchievementDesc outside of the load() method.
ModLoader.AddAchievementDesc
should now be
ModLoader.addAchievementDesc
Also, as I see you figured out, you can't have two methods with the same name in one class. The problem with how you've fixed the problem though. You need to simply add the second if statement to the first method as takenFromCrafting1 is not an actual method that has been defined in BaseMod. Your code should look like this once you've made the above changes:
I made a basic HumanNPC from your code but I THINK it doesn't spawn. I set it's spawn rate really high just so i can see it to make sure it's there. Is It because of my picture or my code? Here's My code of the human. P.S. I tried to make this a spoiler If i did this wrong please show me how to make one.
mod_Person.java
package net.minecraft.src;
import java.util.Map;
public class mod_Person extends BaseMod
{
i've tried putting all my food items into one mod file but it won't work
package net.minecraft.src;
public class mod_quadcraft
{
public static final Item HamSammich = new ItemFood(5001, 16, 1F, false).setItemName("Ham Sammich");
public static final Item BeefSammich = new ItemFood(5002, 16, 1F, false).setItemName("BeefSammich");
public static final Item FishSammich = new ItemFood(5003, 14, 1F, false).setItemName("FishSammich");
public static final Item ChickenSammich = new ItemFood(5004, 14, 1F, false).setItemName("ChickenSammich");
public void load()
{
HamSammich.iconIndex = ModLoader.addOverride("/gui/items.png", "/gui/hamsammich.png");
ModLoader.addName(HamSammich, "Ham Sammich");
ModLoader.addRecipe(new ItemStack(HamSammich, 1), new Object [] {" B ", " P "," B ", Character.valueOf('B'), Item.bread, Character.valueOf('P'), Item.porkCooked});
BeefSammich.iconIndex = ModLoader.addOverride("/gui/items.png", "/gui/beefsammich.png");
ModLoader.addName(BeefSammich, "Beef Sammich");
ModLoader.addRecipe(new ItemStack(BeefSammich, 1), new Object [] {" B ", " S ", " B ", Character.valueOf('B'), Item.bread, Character.valueOf('S'), Item.beefCooked});
FishSammich.iconIndex = ModLoader.addOverride("/gui/items.png", "/gui/fishsammich.png");
ModLoader.addName(FishSammich, "Fish Sammich");
ModLoader.addRecipe(new ItemStack(FishSammich, 1), new Object [] {" B ", " F ", " B ", Character.valueOf('B'), Item.bread, Character.valueOf('F'), Item.fishCooked});
ChickenSammich.iconIndex = ModLoader.addOverride("/gui/items.png", "/gui/chickensammich.png");
ModLoader.addName(ChickenSammich, "Chicken Sammich");
ModLoader.addRecipe(new ItemStack(ChickenSammich, 1), new Object [] {" B ", " C ", " B ", Character.valueOf('B'), Item.bread, Character.valueOf('C'), Item.chickenCooked});
}
public String getVersion()
{
return "1.2.3";
}
}
Your class needs to extend BaseMod. Simple mistake has simple fix.
public class mod_quadcraft
changes to
public class mod_quadcraft extends BaseMod
Don't worry, you're not the only one who has done it. I did the exact same thing when starting the mod in my signature and I was pulling my hair for hours trying to figure out why it wasn't working.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
I have done that, but I still get a crash when I craft the dirtglass
Just figured it out. You didn't register the block with ModLoader
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Maybe have a look at TileEntityMobSpawner and how that is assigned to BlockMobSpawner.
I will give it a shot, I will tell you if it works.
although, I think that the entity that it spawns is determined when it is generated, as there is code to imply that in WorldGenDungeons (if you look at the very bottom of that file) and it doesn't seem like there is anything like that in TileEntityMobSpawner, so I am thinking that I have to tell it what to spawn it in my WorldGenBoat file
package net.minecraft.src;
import java.util.Random;
public class mod_Burnstone extends BaseMod
{
public static final Block Burnstone = new BlockBurnstone(180,0).setHardness(3f).setBlockName("burnstone");
public void GenerateSurface(World world, Random rand, int basex, int basez)
{
for(int x = 0; x < 10; x++)
{
int Xcoord = basex + rand.nextInt(5);
int Ycoord = rand.nextInt(40);
int Zcoord = basez = rand.nextInt(5);
(new WorldGenMinable(Burnstone.blockID, 70)).generate(world, rand, Xcoord, Ycoord, Zcoord);
}
}
public String getVersion()
{
return "1.2.4";
}
}
BlockBurnstone
package net.minecraft.src;
import java.util.Random;
public class BlockBurnstone extends Block
{
public BlockBurnstone(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random rand, int j)
{
return mod_Burnstone.Burnstone.blockID;
}
public int quantityDropped(Random rand)
{
return 1;
}
I have been thinking about the mob spawner thing and I started testing a few things, this is my code:
package net.minecraft.src;
import java.util.Random;
public class WorldGenBoat extends WorldGenerator
{
public WorldGenBoat()
{
}
public boolean generate(World world, Random random, int i, int j, int k)
{
if(world.getBlockId(i, j -1, k) == Block.waterStill.blockID && world.getBlockId(i, j, k) ==
0)
{
int wood = Block.planks.blockID;
//Body railing
world.setBlockWithNotify(i, j, k, wood);
world.setBlockWithNotify(i, j, k +1, wood);
world.setBlockWithNotify(i, j, k +2, wood);
world.setBlockWithNotify(i, j, k +3, wood);
world.setBlockWithNotify(i, j, k +4, wood);
world.setBlockWithNotify(i, j, k +5, wood);
world.setBlockWithNotify(i, j, k +6, wood);
world.setBlockWithNotify(i, j, k +7, wood);
world.setBlockWithNotify(i, j, k -1, wood);
world.setBlockWithNotify(i, j, k -2, wood);
//test
world.setBlockWithNotify(i +3, j, k +2, Block.mobSpawner.blockID);
TileEntityMobSpawner tileentitymobspawner = (TileEntityMobSpawner)
World.getBlockTileEntity (i +3, j, k +2);
if (tileentitymobspawner != null)
{
tileentitymobspawner.setMobID("Pirate");
}
else
{
System.err.println((new StringBuilder()).append("Failed to fetch mob spawner
entity at (").append(i).append(", ").append(j).append(", ").append(k).append
(")").toString());
}
return true;
}
return false;
}}
but I get this error with it
== ERRORS FOUND ==
warning: [options] bootstrap class path not set in conjunction with -source 1.6
src\minecraft\net\minecraft\src\WorldGenBoat.java:273: error: non-static method
getBlockTileEntity(int,int,int) cannot be referenced from a static context
TileEntityMobSpawner tileentitymobspawner = (TileEntityMobSpawner)World.
getBlockTileEntity (i +3, j, k +2);
^
So, I was just wondering if I am going in the right direction with this, and if you knew how to fix that error.
-Thank You-
ModLoader's methods all changed to the correct camel-casing in 1.2.3. Also, you had the second addAchievementDesc outside of the load() method.
ModLoader.AddAchievementDesc
should now be
ModLoader.addAchievementDesc
Also, as I see you figured out, you can't have two methods with the same name in one class. The problem with how you've fixed the problem though. You need to simply add the second if statement to the first method as takenFromCrafting1 is not an actual method that has been defined in BaseMod. Your code should look like this once you've made the above changes:
Strange...I've done what you said but it still hasn't been working. I'm not sure if it's with the issues with the locations, but I place it somewhere closest to where "The End" achievements are. I even used a minecraft item to see if there was an issue with my item but it still doesn't come up.
EDIT: Man, I'm an idiot. I put my whole achievements coding onto the server java file instead of the client one. Well, that's what I get for trying to get this to work in both client/smp. The only issue now is that whenever I check my achievements GUI it shows that I already have the achievement finished. Tried it on two new worlds already and got the same thing so far.
public static final Item TitaniumPick = new ItemPickaxe(EnumToolMaterial.TITANIUM).setItemName("TitaniumPick");
public static final Item TitaniumShovel = new ItemSpade(EnumToolMaterial.TITANIUM).setItemName("TitaniumShovel");
public static final Item TitaniumAxe = new ItemAxe(EnumToolMaterial.TITANIUM).setItemName("TitaniumAxe");
public static final Item TitaniumHoe = new ItemHoe(EnumToolMaterial.TITANIUM).setItemName("TitaniumHoe");
public static final Item TitaniumSword = new ItemSword(EnumToolMaterial.TITANIUM).setItemName("TitaniumSword");
Register the names, textures and recipes as you would a normal item in public void load(), then find EnumToolMaterial.java
(this is a base classfile, so TechGuy doesnt support it) and under
Level: the harvesting level of the tool. Iron is 2, diamond is 3, stone is 1, wood/gold is 0.
Uses: The durability measured in the number of blocks you can break. Diamond is 1561, gold is 32, iron is 250.
Speed: A float measuring the harvesting speed of the tool. Remember to put F after this number. Gold (12F) is very fast.
Mob Damage: Damage done to mobs (sword only).
Enchantability: A variable used to calculate the value of enchantments done on tools of this material, higher means you get better enchantments for your XP.
package net.minecraft.src;
import java.util.Random;
public class mod_Burnstone extends BaseMod
{
public static final Block Burnstone = new BlockBurnstone(180,0).setHardness(3f).setBlockName("burnstone");
public void GenerateSurface(World world, Random rand, int basex, int basez)
{
for(int x = 0; x < 10; x++)
{
int Xcoord = basex + rand.nextInt(5);
int Ycoord = rand.nextInt(40);
int Zcoord = basez = rand.nextInt(5);
(new WorldGenMinable(Burnstone.blockID, 70)).generate(world, rand, Xcoord, Ycoord, Zcoord);
}
}
public String getVersion()
{
return "1.2.4";
}
}
BlockBurnstone
package net.minecraft.src;
import java.util.Random;
public class BlockBurnstone extends Block
{
public BlockBurnstone(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random rand, int j)
{
return mod_Burnstone.Burnstone.blockID;
}
public int quantityDropped(Random rand)
{
return 1;
}
}
Ummm... That isn't an error, that is code... So, if you post the error it will be easier for people to help you, also: you didn't use the Code tags, they are done the same way as a spoiler, except that you put "code " inside the brackets instead of "spoiler".
Hey TechGuy543,
I can tell that you are a busy guy, but I'm starting a mod, and I want to create a couple blocks that when you click on them, they bring up a GUI, like a crafting table, or furnace. The only catch is that I want to make a block that has a crafting grid, that is 4 by 4, instead of 3 by 3,, and something like a furnace, but with custom fuels that only work with that specific block's GUI. If you can help me, or make a tutorial on this, it would be VERY much appreciated!
ok problem , then again their always is in coding
when i try and run my mod ( just adds 3 blocks atm ) i get a "string index out of range at 5 , but the only 2 5's i have are in the quanity of the items i want to make , and their not even set up to be strings ><
the error
java.lang.StringIndexOutOfBoundsException: String index out of range: 5
at java.lang.String.charAt(Unknown Source)
at fr.a(SourceFile:549)
at ModLoader.addRecipe(ModLoader.java:401)
at mod_MoreDecrotives.load(mod_MoreDecrotives.java:28)
at ModLoader.init(ModLoader.java:891)
at ModLoader.addAllRenderers(ModLoader.java:189)
at ahu.<init>(ahu.java:79)
at ahu.<clinit>(ahu.java:9)
at net.minecraft.client.Minecraft.a(SourceFile:267)
at net.minecraft.client.Minecraft.run(SourceFile:650)
at java.lang.Thread.run(Unknown Source)
package net.minecraft.src;
import java.util.Random;
public class mod_Burnstone extends BaseMod
{
public static final Block Burnstone = new BlockBurnstone(180,0).setHardness(3f).setBlockName("burnstone");
public void GenerateSurface(World world, Random rand, int basex, int basez)
{
for(int x = 0; x < 10; x++)
{
int Xcoord = basex + rand.nextInt(5);
int Ycoord = rand.nextInt(40);
int Zcoord = basez = rand.nextInt(5);
(new WorldGenMinable(Burnstone.blockID, 70)).generate(world, rand, Xcoord, Ycoord, Zcoord);
}
}
public String getVersion()
{
return "1.2.4";
}
}
BlockBurnstone
package net.minecraft.src;
import java.util.Random;
public class BlockBurnstone extends Block
{
public BlockBurnstone(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random rand, int j)
{
return mod_Burnstone.Burnstone.blockID;
}
public int quantityDropped(Random rand)
{
return 1;
}
I have written all the code for my new block but I don't know where I need to save my image for the texture. Where in the mcp61 folder do I need to save my textures?
Please read the section about images. It is still applicable in MCP61 even though I am only supporting 1.2.3 in this thread at this time. Updating is in progress though.
I have been thinking about the mob spawner thing and I started testing a few things, this is my code:
package net.minecraft.src;
import java.util.Random;
public class WorldGenBoat extends WorldGenerator
{
public WorldGenBoat()
{
}
public boolean generate(World world, Random random, int i, int j, int k)
{
if(world.getBlockId(i, j -1, k) == Block.waterStill.blockID && world.getBlockId(i, j, k) ==
0)
{
int wood = Block.planks.blockID;
//Body railing
world.setBlockWithNotify(i, j, k, wood);
world.setBlockWithNotify(i, j, k +1, wood);
world.setBlockWithNotify(i, j, k +2, wood);
world.setBlockWithNotify(i, j, k +3, wood);
world.setBlockWithNotify(i, j, k +4, wood);
world.setBlockWithNotify(i, j, k +5, wood);
world.setBlockWithNotify(i, j, k +6, wood);
world.setBlockWithNotify(i, j, k +7, wood);
world.setBlockWithNotify(i, j, k -1, wood);
world.setBlockWithNotify(i, j, k -2, wood);
//test
world.setBlockWithNotify(i +3, j, k +2, Block.mobSpawner.blockID);
TileEntityMobSpawner tileentitymobspawner = (TileEntityMobSpawner)
World.getBlockTileEntity (i +3, j, k +2);
if (tileentitymobspawner != null)
{
tileentitymobspawner.setMobID("Pirate");
}
else
{
System.err.println((new StringBuilder()).append("Failed to fetch mob spawner
entity at (").append(i).append(", ").append(j).append(", ").append(k).append
(")").toString());
}
return true;
}
return false;
}}
but I get this error with it
== ERRORS FOUND ==
warning: [options] bootstrap class path not set in conjunction with -source 1.6
src\minecraft\net\minecraft\src\WorldGenBoat.java:273: error: non-static method
getBlockTileEntity(int,int,int) cannot be referenced from a static context
TileEntityMobSpawner tileentitymobspawner = (TileEntityMobSpawner)World.
getBlockTileEntity (i +3, j, k +2);
^
So, I was just wondering if I am going in the right direction with this, and if you knew how to fix that error.
-Thank You-
It's because all of this code:
TileEntityMobSpawner tileentitymobspawner = (TileEntityMobSpawner)
World.getBlockTileEntity (i +3, j, k +2);
if (tileentitymobspawner != null)
{
tileentitymobspawner.setMobID("Pirate");
}
else
{
System.err.println((new StringBuilder()).append("Failed to fetch mob spawner
entity at (").append(i).append(", ").append(j).append(", ").append(k).append
(")").toString());
}
needs to be in a block class. Are you trying to make a mob spawn in the world like that on a certain block or something?
Strange...I've done what you said but it still hasn't been working. I'm not sure if it's with the issues with the locations, but I place it somewhere closest to where "The End" achievements are. I even used a minecraft item to see if there was an issue with my item but it still doesn't come up.
EDIT: Man, I'm an idiot. I put my whole achievements coding onto the server java file instead of the client one. Well, that's what I get for trying to get this to work in both client/smp. The only issue now is that whenever I check my achievements GUI it shows that I already have the achievement finished. Tried it on two new worlds already and got the same thing so far.
It is because Achievements are not saved with the world, but with the jar. If you change the jar, then the achievements will all be cleared.
ok problem , then again their always is in coding
when i try and run my mod ( just adds 3 blocks atm ) i get a "string index out of range at 5 , but the only 2 5's i have are in the quanity of the items i want to make , and their not even set up to be strings ><
the error
java.lang.StringIndexOutOfBoundsException: String index out of range: 5
at java.lang.String.charAt(Unknown Source)
at fr.a(SourceFile:549)
at ModLoader.addRecipe(ModLoader.java:401)
at mod_MoreDecrotives.load(mod_MoreDecrotives.java:28)
at ModLoader.init(ModLoader.java:891)
at ModLoader.addAllRenderers(ModLoader.java:189)
at ahu.<init>(ahu.java:79)
at ahu.<clinit>(ahu.java:9)
at net.minecraft.client.Minecraft.a(SourceFile:267)
at net.minecraft.client.Minecraft.run(SourceFile:650)
at java.lang.Thread.run(Unknown Source)
Hey TechGuy543,
I can tell that you are a busy guy, but I'm starting a mod, and I want to create a couple blocks that when you click on them, they bring up a GUI, like a crafting table, or furnace. The only catch is that I want to make a block that has a crafting grid, that is 4 by 4, instead of 3 by 3,, and something like a furnace, but with custom fuels that only work with that specific block's GUI. If you can help me, or make a tutorial on this, it would be VERY much appreciated!
It is quite difficult to make something like this, even more so to make a tutorial on. The problem is that there are so many variables people can change to make the gui how they want it. The main problem with what you're doing with the crafting is probably that you would need to rewrite the crafting system(or possibly build onto the current one). That, could be hard to do if you don't have much experience with Java, especially the way in which Minecraft uses it.
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. But I decided I was making a craftable item and not an ore XD
Titanium mod is Copyrighted :3
No, a custom block. I made a custom cactus block and I want it to spawn in my biome
They don't show up anywhere in the achievement GUI nor does the achievement pop up when my item is crafted. Can you help me?
One thing you must know about coding, is that it is very flexible and you can do what you like with it. I never said anything about making it an ore. You just have to make a recipe that suits it. Referencing things from Item and Block, and all the other classes.
Rewrite the override again. Even if it is exactly the same as the current one. Sometimes wreiting things helps.
Maybe have a look at TileEntityMobSpawner and how that is assigned to BlockMobSpawner.
Oh, sorry. I'll get back to you when I have the solution. I think I know how to do it. I just need to test it.
together they are powerful beyond imagination."
mod_Person.java
import java.util.Map;
public class mod_Person extends BaseMod
{
public void load()
{
ModLoader.registerEntityID(EntityPerson.class, "Person", ModLoader.getUniqueEntityId());
ModLoader.addSpawn(EntityPerson.class, 72, 75, 77, EnumCreatureType.creature);
}
public void addRenderer(Map map)
{
map.put(EntityPerson.class, new RenderBiped(new ModelBiped(), 0.5F));
}
public String getVersion()
{
return "1.2.3";
}
}
EntityPerson.java
import java.util.Random;
public class EntityPerson extends EntityMob
{
@SuppressWarnings("null")
public EntityPerson(World world)
{
super(world);
texture = "/Person.png";
attackStrength = 4;
moveSpeed = 3.5F;
tasks.addTask(0, new EntityAISwimming(this));
tasks.addTask(1, new EntityAIBreakDoor(this));
tasks.addTask(2, new EntityAIAttackOnCollide(this, net.minecraft.src.EntityPerson.class, moveSpeed, false));
tasks.addTask(3, new EntityAIAttackOnCollide(this, net.minecraft.src.EntityVillager.class, moveSpeed, true));
tasks.addTask(6, new EntityAIWander(this, moveSpeed));
tasks.addTask(7, new EntityAIWatchClosest(this, net.minecraft.src.EntityPerson.class, 8F));
tasks.addTask(7, new EntityAILookIdle(this));
EntityAITasks targetTasks = null;
targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntityPerson.class, 36F, 0, true));
targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntityPig.class, 16F, 0, true));
targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntitySheep.class, 16F, 0, true));
targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntityCow.class, 16F, 0, true));
targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntityChicken.class, 16F, 0, true));
}
public ItemStack getHeldItem()
{
return defaultHeldItem;
}
static
{
defaultHeldItem = new ItemStack(Item.stick, 1);
}
private static final ItemStack defaultHeldItem;
public int getMaxHealth()
{
return 5;
}
protected String getLivingSound()
{
return "mob.villager.default";
}
protected String getHurtSound()
{
return "mob.Human.defaulthurt";
}
protected String getDeathSound()
{
return "mob.villager.defaultdeath";
}
public boolean isAIEnabled()
{
return true;
}
protected void dropFewItems(boolean flag, int i)
{
int j = rand.nextInt(3 + i);
for (int k = 0; k &--#60; j; k++)
{
dropItem(Item.goldNugget.shiftedIndex, 5);
dropItem(Item.ingotGold.shiftedIndex, 3);
dropItem(Item.appleGold.shiftedIndex, 2);
dropItem(Item.swordGold.shiftedIndex, 1);
}
j = rand.nextInt(3 + i);
for (int l = 0; l &--#60; j; l++)
{
dropItem(Item.helmetGold.shiftedIndex, 1);
dropItem(Item.plateGold.shiftedIndex, 1);
dropItem(Item.bootsGold.shiftedIndex, 1);
dropItem(Item.legsGold.shiftedIndex, 1);
dropItem(Item.pickaxeGold.shiftedIndex, 1);
}
}
protected boolean canDespawn()
{
return false;
}
}
If you see this The Character.valueOf basiclly means that dirt = # if you put ### that means three dirt in a row. You can also put more of then 1 of these in one line but seperate them with a comma like so:
Character.valueOf is simply making a symbol = to a block in minecraft.
ModLoader's methods all changed to the correct camel-casing in 1.2.3. Also, you had the second addAchievementDesc outside of the load() method.
should now be
Also, as I see you figured out, you can't have two methods with the same name in one class. The problem with how you've fixed the problem though. You need to simply add the second if statement to the first method as takenFromCrafting1 is not an actual method that has been defined in BaseMod. Your code should look like this once you've made the above changes:
The only problem with your code that could cause an issue like that, which I can currently see, is this:
Remove that and it should work fine.
Your class needs to extend BaseMod. Simple mistake has simple fix.
changes to
Don't worry, you're not the only one who has done it. I did the exact same thing when starting the mod in my signature and I was pulling my hair for hours trying to figure out why it wasn't working.
together they are powerful beyond imagination."
Just figured it out. You didn't register the block with ModLoader
together they are powerful beyond imagination."
I will give it a shot, I will tell you if it works.
although, I think that the entity that it spawns is determined when it is generated, as there is code to imply that in WorldGenDungeons (if you look at the very bottom of that file) and it doesn't seem like there is anything like that in TileEntityMobSpawner, so I am thinking that I have to tell it what to spawn it in my WorldGenBoat file
mod_Burnstone
import java.util.Random;
public class mod_Burnstone extends BaseMod
{
public static final Block Burnstone = new BlockBurnstone(180,0).setHardness(3f).setBlockName("burnstone");
public void load()
{
ModLoader.registerBlock(Burnstone);
ModLoader.addName(Burnstone,"Burnstone Ore");
Burnstone.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/customBlock.png");
}
public void GenerateSurface(World world, Random rand, int basex, int basez)
{
for(int x = 0; x < 10; x++)
{
int Xcoord = basex + rand.nextInt(5);
int Ycoord = rand.nextInt(40);
int Zcoord = basez = rand.nextInt(5);
(new WorldGenMinable(Burnstone.blockID, 70)).generate(world, rand, Xcoord, Ycoord, Zcoord);
}
}
public String getVersion()
{
return "1.2.4";
}
}
import java.util.Random;
public class BlockBurnstone extends Block
{
public BlockBurnstone(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random rand, int j)
{
return mod_Burnstone.Burnstone.blockID;
}
public int quantityDropped(Random rand)
{
return 1;
}
}
but I get this error with it
-Thank You-
Strange...I've done what you said but it still hasn't been working. I'm not sure if it's with the issues with the locations, but I place it somewhere closest to where "The End" achievements are. I even used a minecraft item to see if there was an issue with my item but it still doesn't come up.EDIT: Man, I'm an idiot. I put my whole achievements coding onto the server java file instead of the client one. Well, that's what I get for trying to get this to work in both client/smp. The only issue now is that whenever I check my achievements GUI it shows that I already have the achievement finished. Tried it on two new worlds already and got the same thing so far.
I need tools for the Titanium mod (Pickaxe, shovel, sword, etc.)
Register the names, textures and recipes as you would a normal item in public void load(), then find EnumToolMaterial.java
(this is a base classfile, so TechGuy doesnt support it) and under put:
Level: the harvesting level of the tool. Iron is 2, diamond is 3, stone is 1, wood/gold is 0.
Uses: The durability measured in the number of blocks you can break. Diamond is 1561, gold is 32, iron is 250.
Speed: A float measuring the harvesting speed of the tool. Remember to put F after this number. Gold (12F) is very fast.
Mob Damage: Damage done to mobs (sword only).
Enchantability: A variable used to calculate the value of enchantments done on tools of this material, higher means you get better enchantments for your XP.
If I helped you at all or made a nice post, go ahead and click the green plus over there if you want.
Ummm... That isn't an error, that is code... So, if you post the error it will be easier for people to help you, also: you didn't use the Code tags, they are done the same way as a spoiler, except that you put "code " inside the brackets instead of "spoiler".
I can tell that you are a busy guy, but I'm starting a mod, and I want to create a couple blocks that when you click on them, they bring up a GUI, like a crafting table, or furnace. The only catch is that I want to make a block that has a crafting grid, that is 4 by 4, instead of 3 by 3,, and something like a furnace, but with custom fuels that only work with that specific block's GUI. If you can help me, or make a tutorial on this, it would be VERY much appreciated!
when i try and run my mod ( just adds 3 blocks atm ) i get a "string index out of range at 5 , but the only 2 5's i have are in the quanity of the items i want to make , and their not even set up to be strings ><
the error
Post the error.
Please read the section about images. It is still applicable in MCP61 even though I am only supporting 1.2.3 in this thread at this time. Updating is in progress though.
Yeah, it should be sorry. It should be like this:
It's because all of this code:
needs to be in a block class. Are you trying to make a mob spawn in the world like that on a certain block or something?
It is because Achievements are not saved with the world, but with the jar. If you change the jar, then the achievements will all be cleared.
Post your code.
It is quite difficult to make something like this, even more so to make a tutorial on. The problem is that there are so many variables people can change to make the gui how they want it. The main problem with what you're doing with the crafting is probably that you would need to rewrite the crafting system(or possibly build onto the current one). That, could be hard to do if you don't have much experience with Java, especially the way in which Minecraft uses it.
together they are powerful beyond imagination."