Okay, so I tried to make a monster mob, and everything works right, except for one thing. The mob doesn't move. Or attack, for that matter. I've looked over my code several times, but I haven't found the problem yet. Maybe someone here can help me? Here's all the relevant code:
mod_Legendarium:
package net.minecraft.src;
import net.minecraft.client.Minecraft;
import java.util.*;
public class mod_Legendarium extends BaseMod{
public void load(){
//Mob Grok
ModLoader.registerEntityID(EntityGrok.class, "Grok",
ModLoader.getUniqueEntityId());
ModLoader.addSpawn(EntityGrok.class, 4, 5, 8, EnumCreatureType.monster);
}
public void addRenderer(Map map)
{
map.put(EntityGrok.class, new RenderGrok(new ModelGrok(), 1.0F));
}
public String getVersion(){
return "1.0";}
}
EntityGrok:
package net.minecraft.src;
import java.util.Random;
public class EntityGrok extends EntityMob{
private static final ItemStack defaultHeldItem;
public EntityGrok(World world)
{
super(world);
texture = "/items/Grok.png";
moveSpeed = 0.5F;
isImmuneToFire = false;
float f = 0.23F;
getNavigator().setBreakDoors(true);
tasks.addTask(0, new EntityAIWander(this, moveSpeed));
tasks.addTask(1, new EntityAISwimming(this));
tasks.addTask(2, new EntityAIBreakDoor(this));
tasks.addTask(3, new EntityAIAttackOnCollide(this, net.minecraft.src.EntityPlayer.class, moveSpeed, false));
tasks.addTask(4, new EntityAIAttackOnCollide(this, net.minecraft.src.EntityVillager.class, moveSpeed, true));
tasks.addTask(5, new EntityAIMoveTwardsRestriction(this, moveSpeed));
tasks.addTask(6, new EntityAIMoveThroughVillage(this, moveSpeed, false));
tasks.addTask(8, new EntityAIWatchClosest(this, net.minecraft.src.EntityPlayer.class, 8F));
tasks.addTask(9, new EntityAILookIdle(this));
targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntityPlayer.class, 16F, 0, true));
targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntityVillager.class, 16F, 0, false));
attackStrength = 5;
}
protected boolean isAIEnabled()
{
return true;
}
public boolean interact(EntityPlayer entityplayer)
{
ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Gew, unqi hasr! Die, foolish human!");
return true;
}
public int getMaxHealth()
{
return 15;
}
protected String getLivingSound()
{
return "mob.zombie";
}
protected String getHurtSound()
{
return "mob.zombiehurt";
}
protected String getDeathSound()
{
return "mob.zombiedeath";
}
protected int getDropItemId()
{
return Item.clay.shiftedIndex;
}
public EnumCreatureAttribute getCreatureAttribute()
{
return EnumCreatureAttribute.UNDEAD;
}
protected boolean canDespawn()
{
return false;
}
public void onLivingUpdate()
{
if (worldObj.isDaytime() && !worldObj.isRemote)
{
float f = getBrightness(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)
{
setFire(8);
}
}
}
static
{
defaultHeldItem = new ItemStack(Item.bow, 1);
}
}
Any help will be deeply appreciated! Thanks in advance!
--CNSoup
EDIT: It should also be noted that I can damage and kill them, but when I hit them, they begin to move their arms and legs, like they are moving, but they don't go anywhere.
This is my crash report.
I think it is something to do with the modloader name for the NPC.
Mods loaded: 7
ModLoader 1.2.5
mod_TuArmor 1.2.5
mod_TuBlock 1.2.5
mod_TuFood 1.2.5
mod_TuItem 1.2.5
mod_TuNPC 1.2.5
mod_TuTool 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 582bb498 --------
Generated 7/14/12 7:24 PM
Minecraft: Minecraft 1.2.5
OS: Mac OS X (x86_64) version 10.7.4
Java: 1.6.0_33, Apple Inc.
VM: Java HotSpotâ„¢ 64-Bit Server VM (mixed mode), Apple Inc.
LWJGL: 2.4.2
OpenGL: NVIDIA GeForce GT 330M OpenGL Engine version 2.1 NVIDIA-7.18.18, NVIDIA Corporation
java.lang.Error: Unresolved compilation problems:
Hippo cannot be resolved to a type
Hippo cannot be resolved to a type
at net.minecraft.src.mod_TuNPC.load(mod_TusasonNPC.java:10)
at net.minecraft.src.ModLoader.init(ModLoader.java:856)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:157)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:85)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:424)
at net.minecraft.client.Minecraft.run(Minecraft.java:786)
at java.lang.Thread.run(Thread.java:680)
--- END ERROR REPORT 79978036 ----------
I made a NPC, and it loaded up correctly and recompiled without any errors, but it doesn't seem to be spawning. Or the rate is too small. Is there somewhere in the code to edit the spawn rate to make it higher?
Also, I want my mob to be around in daylight and not burn, but still attack. So I'm not sure what EnumCreatureType to set it as....?
Okay, so I tried to make a monster mob, and everything works right, except for one thing. The mob doesn't move. Or attack, for that matter. I've looked over my code several times, but I haven't found the problem yet. Maybe someone here can help me? Here's all the relevant code:
mod_Legendarium:
package net.minecraft.src;
import net.minecraft.client.Minecraft;
import java.util.*;
public class mod_Legendarium extends BaseMod{
public void load(){
//Mob Grok
ModLoader.registerEntityID(EntityGrok.class, "Grok",
ModLoader.getUniqueEntityId());
ModLoader.addSpawn(EntityGrok.class, 4, 5, 8, EnumCreatureType.monster);
}
public void addRenderer(Map map)
{
map.put(EntityGrok.class, new RenderGrok(new ModelGrok(), 1.0F));
}
public String getVersion(){
return "1.0";}
}
EntityGrok:
package net.minecraft.src;
import java.util.Random;
public class EntityGrok extends EntityMob{
private static final ItemStack defaultHeldItem;
public EntityGrok(World world)
{
super(world);
texture = "/items/Grok.png";
moveSpeed = 0.5F;
isImmuneToFire = false;
float f = 0.23F;
getNavigator().setBreakDoors(true);
tasks.addTask(0, new EntityAIWander(this, moveSpeed));
tasks.addTask(1, new EntityAISwimming(this));
tasks.addTask(2, new EntityAIBreakDoor(this));
tasks.addTask(3, new EntityAIAttackOnCollide(this, net.minecraft.src.EntityPlayer.class, moveSpeed, false));
tasks.addTask(4, new EntityAIAttackOnCollide(this, net.minecraft.src.EntityVillager.class, moveSpeed, true));
tasks.addTask(5, new EntityAIMoveTwardsRestriction(this, moveSpeed));
tasks.addTask(6, new EntityAIMoveThroughVillage(this, moveSpeed, false));
tasks.addTask(8, new EntityAIWatchClosest(this, net.minecraft.src.EntityPlayer.class, 8F));
tasks.addTask(9, new EntityAILookIdle(this));
targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntityPlayer.class, 16F, 0, true));
targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntityVillager.class, 16F, 0, false));
attackStrength = 5;
}
protected boolean isAIEnabled()
{
return true;
}
public boolean interact(EntityPlayer entityplayer)
{
ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Gew, unqi hasr! Die, foolish human!");
return true;
}
public int getMaxHealth()
{
return 15;
}
protected String getLivingSound()
{
return "mob.zombie";
}
protected String getHurtSound()
{
return "mob.zombiehurt";
}
protected String getDeathSound()
{
return "mob.zombiedeath";
}
protected int getDropItemId()
{
return Item.clay.shiftedIndex;
}
public EnumCreatureAttribute getCreatureAttribute()
{
return EnumCreatureAttribute.UNDEAD;
}
protected boolean canDespawn()
{
return false;
}
public void onLivingUpdate()
{
if (worldObj.isDaytime() && !worldObj.isRemote)
{
float f = getBrightness(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)
{
setFire(8);
}
}
}
static
{
defaultHeldItem = new ItemStack(Item.bow, 1);
}
}
Any help will be deeply appreciated! Thanks in advance!
--CNSoup
EDIT: It should also be noted that I can damage and kill them, but when I hit them, they begin to move their arms and legs, like they are moving, but they don't go anywhere.
I think it might be in your model file. Making a new modle is really hard, so I would just use ModelBiped for now (Normal human model).
I made a NPC, and it loaded up correctly and recompiled without any errors, but it doesn't seem to be spawning. Or the rate is too small. Is there somewhere in the code to edit the spawn rate to make it higher?
Also, I want my mob to be around in daylight and not burn, but still attack. So I'm not sure what EnumCreatureType to set it as....?
Normal mobs don't burn in daylight unless you tell them to burn in daylight. Same with attacking. The day/night cycle doesn't affect the mobs in TechGuy's tutorials, only when they spawn.
As for the spawn rate, look back in the tutorial. TechGuy tells you what the code means, so just reread it and you'll be fine
Edit: Oh, set the EnumCreatureType to monster as well
Mods loaded: 2
ModLoader 1.2.5
mod_DayZ 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 288d3454 --------
Generated 15/07/12 7:28 PM
Minecraft: Minecraft 1.2.5
OS: Windows 7 (x86) version 6.1
Java: 1.7.0, Oracle Corporation
VM: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: ATI Mobility Radeon HD 4200 Series version 3.2.9704 Compatibility Profile Context, ATI Technologies Inc.
java.lang.RuntimeException: java.lang.Exception: Image not found: DayZ.png
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1451)
at net.minecraft.src.ModLoader.onTick(ModLoader.java:1104)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:21)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:922)
at net.minecraft.client.Minecraft.run(Minecraft.java:801)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.Exception: Image not found: DayZ.png
at net.minecraft.src.ModLoader.loadImage(ModLoader.java:1024)
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1443)
... 5 more
--- END ERROR REPORT 9a643aab ----------
Mods loaded: 2
ModLoader 1.2.5
mod_DayZ 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 288d3454 --------
Generated 15/07/12 7:28 PM
Minecraft: Minecraft 1.2.5
OS: Windows 7 (x86) version 6.1
Java: 1.7.0, Oracle Corporation
VM: Java HotSpotâ„¢ Client VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: ATI Mobility Radeon HD 4200 Series version 3.2.9704 Compatibility Profile Context, ATI Technologies Inc.
java.lang.RuntimeException: java.lang.Exception: Image not found: DayZ.png
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1451)
at net.minecraft.src.ModLoader.onTick(ModLoader.java:1104)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:21)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:922)
at net.minecraft.client.Minecraft.run(Minecraft.java:801)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.Exception: Image not found: DayZ.png
at net.minecraft.src.ModLoader.loadImage(ModLoader.java:1024)
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1443)
... 5 more
--- END ERROR REPORT 9a643aab ----------
trhanks for the help
You need to read the error:
java.lang.RuntimeException: java.lang.Exception: Image not found: DayZ.png
Put a / before the name of your image. Please use code tags.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Normal mobs don't burn in daylight unless you tell them to burn in daylight. Same with attacking. The day/night cycle doesn't affect the mobs in TechGuy's tutorials, only when they spawn.
As for the spawn rate, look back in the tutorial. TechGuy tells you what the code means, so just reread it and you'll be fine
Edit: Oh, set the EnumCreatureType to monster as well
Thank you. I also looked back at the code and I understand what to do now.
Hey, Techguy, I got another problem with biomes.
So I decided to make a biome with my custom block, which makes the player run 1 1/2 times faster.
I put in all the correct code and stuff, and the top block is the custom block. Here is the code:
mod_MIBM class file.
package net.minecraft.src;
public class mod_MIBM extends BaseMod {
public static final BiomeGenBase wastelands = (new BiomeGenWastelands(23)).setColor(0x2768c9).setBiomeName("Wastelands");
public static final BiomeGenBase hellearth = (new BiomeGenHellOnEarth(24)).setColor(0x2768c0).setBiomeName("Hell On Earth");
public static final BiomeGenBase endearth = (new BiomeGenEndOnEarth(25)).setColor(0x2768c1).setBiomeName("End On Earth");
public static final BiomeGenBase stoneplains = (new BiomeGenStonePlains(26)).setColor(0x2768c2).setBiomeName("Stone Plains");
public static final BiomeGenBase ruinedlands = (new BiomeGenRuins(27)).setColor(0x2768c3).setBiomeName("Ruined Lands");
public static final BiomeGenBase deadlylands = (new BiomeGenDeadlyLands(26)).setColor(0x2768c4).setBiomeName("Deadly Lands");
public static final BiomeGenBase runlands = (new BiomeGenFastLands(27)).setColor(0x2768c5).setBiomeName("Fast Lands");
public static Block fastBlock = new BlockSpeed(160).setHardness(5F).setStepSound(Block.soundMetalFootstep).setBlockName("BlockSpeed");
public void load(){
ModLoader.addBiome(wastelands);
ModLoader.addBiome(hellearth);
ModLoader.addBiome(endearth);
ModLoader.addBiome(stoneplains);
ModLoader.addBiome(ruinedlands);
ModLoader.addBiome(deadlylands);
ModLoader.addBiome(runlands);
ModLoader.registerBlock(fastBlock);
ModLoader.addName(fastBlock, "Fast Block");
}
public String getVersion(){
return "MIBM 1.2.5";
}
}
BiomeGenFastLands class file:
package net.minecraft.src;
import java.util.List;
public class BiomeGenFastLands extends BiomeGenBase {
public BiomeGenFastLands(int par1) {
super(par1);
spawnableMonsterList.clear();
spawnableCreatureList.clear();
topBlock = (byte)mod_MIBM.fastBlock.blockID;
fillerBlock = (byte)Block.dirt.blockID;
}
}
Error Report:
Mods loaded: 1
ModLoader 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 9f578458 --------
Generated 7/15/12 1:05 PM
Minecraft: Minecraft 1.2.5
OS: Windows 7 (x86) version 6.1
Java: 1.7.0_05, Oracle Corporation
VM: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: ATI Radeon X1200 Series version 2.1.8545 Release, ATI Technologies Inc.
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at net.minecraft.src.ModLoader.addMod(ModLoader.java:287)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1279)
at net.minecraft.src.ModLoader.init(ModLoader.java:849)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:157)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:85)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:424)
at net.minecraft.client.Minecraft.run(Minecraft.java:786)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at net.minecraft.src.BiomeGenFastLands.<init>(BiomeGenFastLands.java:11)
at net.minecraft.src.mod_MIBM.<clinit>(mod_MIBM.java:10)
... 15 more
--- END ERROR REPORT 2d4d3306 ----------
Please help with my code. Somewhy It don't want to let me to add sliver tools rcipes. Works if I replace "Item.Silveringot" with "Block.dirt"
package net.minecraft.src;
public class mod_tomo extends BaseMod
{
public static final Block Silverore = new Silveroreblock(160, 0).setBlockName("Silverore") .setHardness(3F).setResistance(5F).setLightValue(0F);
public static final Item Silveringot = new Silveroreitem(1000).setItemName("Silveringot");
public static final Item Silversword = new ItemSSword (1001, EnumToolMaterialSilver.Silver).setItemName("Silversword");
public static final Item Silvershovel = new ItemSSpade (1002, EnumToolMaterialSilver.Silver).setItemName("Silvershovel");
public static final Item Silverpickaxe = new ItemSPickaxe (1003, EnumToolMaterialSilver.Silver).setItemName("Silverpickaxe");
public static final Item Silveraxe = new ItemSAxe (1004, EnumToolMaterialSilver.Silver).setItemName("Silveraxe");
public static final Item Silverhoe = new ItemSHoe (1005, EnumToolMaterialSilver.Silver).setItemName("Silverhoe");
public void load()
{
Silveringot.iconIndex = ModLoader.addOverride("/gui/items.png", "/tomomoditems/Silveringot.png");
Silversword.iconIndex = ModLoader.addOverride("/gui/items.png", "/tomomoditems/Silversword.png");
Silvershovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/tomomoditems/Silvershovel.png");
Silverpickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/tomomoditems/Silverpickaxe.png");
Silveraxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/tomomoditems/Silveraxe.png");
Silverhoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/tomomoditems/Silverhoe.png");
Silverore.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/tomomoditems/Silverore.png");
ModLoader.registerBlock(Silverore);
ModLoader.addName(Silverore, "Silver Ore");
ModLoader.addName(Silveringot, "Silver Ingot");
ModLoader.addName(Silversword, "Silver Sword");
ModLoader.addName(Silvershovel, "Silver Shovel");
ModLoader.addName(Silverpickaxe, "Silver Pickaxe");
ModLoader.addName(Silveraxe, "Silver Axe");
ModLoader.addName(Silverhoe, "Silver Hoe");
ModLoader.addSmelting(Silverore.blockID, new ItemStack(Silveringot, 1));
ModLoader.addRecipe(new ItemStack(Silversword,1), new Object [] {" Z ", " Z ", " Y ", Character.valueOf ('Z'), Item.Silveringot, Character.valueOf ('Y'), Item.stick});
ModLoader.addRecipe(new ItemStack(Silversword,1), new Object [] {" Z ", " Z ", " Y ", 'Z', Item.Silveringot, 'Y', Item.stick});
ModLoader.addRecipe(new ItemStack(Silvershovel,1), new Object [] {" Z ", " Y ", " Y ", 'Z', Item.Silveringot, 'Y', Item.stick});
ModLoader.addRecipe(new ItemStack(Silverpickaxe,1), new Object [] {"ZZZ", " Y ", " Y ", 'Z', Item.Silveringot, 'Y', Item.stick});
ModLoader.addRecipe(new ItemStack(Silveraxe,1), new Object [] {"ZZ ", "ZY ", " Y ", 'Z', Item.Silveringot, 'Y', Item.stick});
ModLoader.addRecipe(new ItemStack(Silverhoe,1), new Object [] {"ZZ ", " Y ", " Y ", 'Z', Item.Silveringot, 'Y', Item.stick});
}
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 8 ; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(55);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(Silverore.blockID, 9)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
public String getVersion()
{
return "Version 1.2.5";
}
}
And now the crash log:
Mods loaded: 2
ModLoader 1.2.5
mod_tomo Version 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT bcce365d --------
Generated 15/07/12 16:32
Minecraft: Minecraft 1.2.5
OS: Windows 7 (amd64) version 6.1
Java: 1.7.0_05, Oracle Corporation
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: AMD Radeon HD 6700 Series version 4.2.11631 Compatibility Profile Context, ATI Technologies Inc.
java.lang.NullPointerException
at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.java:398)
at net.minecraft.src.ModLoader.addRecipe(ModLoader.java:412)
at net.minecraft.src.mod_tomo.load(mod_tomo.java:32)
at net.minecraft.src.ModLoader.init(ModLoader.java:856)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:157)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:85)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:424)
at net.minecraft.client.Minecraft.run(Minecraft.java:786)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT d3810d23 ----------
P.S. srry i'm new can't figure out how to make a spoiler
Here is your problem:
Silveringot is not in the Item class, it is in the mod_tomo class, you only need to put the Silveringot, not Item.Silveringot. Or, (not quite sure if this works) you can put this.Silveringot.
Rollback Post to RevisionRollBack
Want to get me back in the thread? Quote one of my posts!
== ERRORS FOUND ==
src\minecraft\net\minecraft\net\mod_Gag.java:5: error: cannot find symbol
public static final item Birthdaycake = new ItemBirthdaycake(5000).setItemName ("bdaycake");
symbol: class item
location: class mod_Gag
My code
mod_Gag
package net.minecraft.src;
public class mod_Gag extends BaseMod
{
public static final item Birthdaycake = new ItemBirthdaycake(5000).setItemName("bdaycake");
public void load()
{
Birthdaycake.iconIndex = ModLoader.addOverride("/gui/items.png", "/image.png");
ModLoader.addName(Birthdaycake, "Birthday Cake");
ModLoader.addRecipe(new ItemStack (Birthdaycake, 1), new Object [] {"#",
Character.valueOf('#'), Block.dirt});
}
public String getVersion()
{
return "1.2.5";
}
}
ItemBirthdaycake
package net.minecraft.src;
public class ItemBirthdaycake extends Item
{
public ItemBirthdaycake(int i)
{
super(i);
maxStackSize = 64;
}
}
== ERRORS FOUND ==
src\minecraft\net\minecraft\net\mod_Gag.java:5: error: cannot find symbol
public static final item Birthdaycake = new ItemBirthdaycake(5000).setItemName ("bdaycake");
symbol: class item
location: class mod_Gag
My code
mod_Gag
package net.minecraft.src;
public class mod_Gag extends BaseMod
{
public static final item Birthdaycake = new ItemBirthdaycake(5000).setItemName ("anynamehere");
public void load()
{
Birthdaycake.iconIndex = ModLoader.addOverride("/gui/items.png", "/image.png");
ModLoader.addName(Birthdaycake, "Birthday Cake");
ModLoader.addRecipe(new ItemStack (Birthdaycake, 1), new Object [] {"#",
Character.valueOf('#'), Block.dirt});
}
public String getVersion()
{
return "1.2.5";
}
}
ItemBirthdaycake
package net.minecraft.src;
public class ItemBirthdaycake extends Item
{
public ItemBirthdaycake(int i)
{
super(i);
maxStackSize = 64;
}
}
On the line that says "public static final item", the 'i' in item should be capital.
The line should look like this:
public static final Item Birthdaycake = new ItemBirthdaycake(5000).setItemName ("anynamehere");
Rollback Post to RevisionRollBack
Want to get me back in the thread? Quote one of my posts!
timoteo2000, many thanks. this.Silveringot works perfectly. Not sure why smelting recipe with Item.Silveringot worked, though.
For the future, when you're working with items or blocks, Block.Something means that "Something" is declared in the "Block" class. Same with Items. Item.Something would mean that "Something" is declared in the Item class. As such, it's called referencing. If you don't put Block. or Item. in front of things, then it looks for said object within the class you're working with. "this.Silveringot" may work, but it's not a necessity as it's being referenced in the same class you're working with. It's safe to use just "Silveringot" for your recipes.
== ERRORS FOUND ==
src\minecraft\net\minecraft\net\mod_Gag.java:5: error: cannot find symbol
public static final item Birthdaycake = new ItemBirthdaycake(5000).setItemName ("bdaycake");
symbol: class item
location: class mod_Gag
My code
mod_Gag
package net.minecraft.src;
public class mod_Gag extends BaseMod
{
public static final item Birthdaycake = new ItemBirthdaycake(5000).setItemName("bdaycake");
public void load()
{
Birthdaycake.iconIndex = ModLoader.addOverride("/gui/items.png", "/image.png");
ModLoader.addName(Birthdaycake, "Birthday Cake");
ModLoader.addRecipe(new ItemStack (Birthdaycake, 1), new Object [] {"#",
Character.valueOf('#'), Block.dirt});
}
public String getVersion()
{
return "1.2.5";
}
}
ItemBirthdaycake
package net.minecraft.src;
public class ItemBirthdaycake extends Item
{
public ItemBirthdaycake(int i)
{
super(i);
maxStackSize = 64;
}
}
timoteo2000 is correct. But I just wanted to add something. Your cake has not been given any special properties inside the ItemBirthdaycake class. By default, things will stack to a maximum of 64, so it doesn't need to be told that. Unless you plan on giving it other properties, then the "ItemBirthdayCake" class would be just extra clutter to keep up to date. It'd be easier on you later to delete said class and change your item declaration to this within your mod_* class (incorporating the capital i timoteo2000 mentioned):
public static final Item Birthdaycake = new Item(5000).setItemName ("bdaycake");
Hey, Techguy, I got another problem with biomes.
So I decided to make a biome with my custom block, which makes the player run 1 1/2 times faster.
I put in all the correct code and stuff, and the top block is the custom block. Here is the code:
mod_MIBM class file.
package net.minecraft.src;
public class mod_MIBM extends BaseMod {
public static final BiomeGenBase wastelands = (new BiomeGenWastelands(23)).setColor(0x2768c9).setBiomeName("Wastelands");
public static final BiomeGenBase hellearth = (new BiomeGenHellOnEarth(24)).setColor(0x2768c0).setBiomeName("Hell On Earth");
public static final BiomeGenBase endearth = (new BiomeGenEndOnEarth(25)).setColor(0x2768c1).setBiomeName("End On Earth");
public static final BiomeGenBase stoneplains = (new BiomeGenStonePlains(26)).setColor(0x2768c2).setBiomeName("Stone Plains");
public static final BiomeGenBase ruinedlands = (new BiomeGenRuins(27)).setColor(0x2768c3).setBiomeName("Ruined Lands");
public static final BiomeGenBase deadlylands = (new BiomeGenDeadlyLands(26)).setColor(0x2768c4).setBiomeName("Deadly Lands");
public static final BiomeGenBase runlands = (new BiomeGenFastLands(27)).setColor(0x2768c5).setBiomeName("Fast Lands");
public static Block fastBlock = new BlockSpeed(160).setHardness(5F).setStepSound(Block.soundMetalFootstep).setBlockName("BlockSpeed");
public void load(){
ModLoader.addBiome(wastelands);
ModLoader.addBiome(hellearth);
ModLoader.addBiome(endearth);
ModLoader.addBiome(stoneplains);
ModLoader.addBiome(ruinedlands);
ModLoader.addBiome(deadlylands);
ModLoader.addBiome(runlands);
ModLoader.registerBlock(fastBlock);
ModLoader.addName(fastBlock, "Fast Block");
}
public String getVersion(){
return "MIBM 1.2.5";
}
}
BiomeGenFastLands class file:
package net.minecraft.src;
import java.util.List;
public class BiomeGenFastLands extends BiomeGenBase {
public BiomeGenFastLands(int par1) {
super(par1);
spawnableMonsterList.clear();
spawnableCreatureList.clear();
topBlock = (byte)mod_MIBM.fastBlock.blockID;
fillerBlock = (byte)Block.dirt.blockID;
}
}
Error Report:
Mods loaded: 1
ModLoader 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 9f578458 --------
Generated 7/15/12 1:05 PM
Minecraft: Minecraft 1.2.5
OS: Windows 7 (x86) version 6.1
Java: 1.7.0_05, Oracle Corporation
VM: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: ATI Radeon X1200 Series version 2.1.8545 Release, ATI Technologies Inc.
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at net.minecraft.src.ModLoader.addMod(ModLoader.java:287)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1279)
at net.minecraft.src.ModLoader.init(ModLoader.java:849)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:157)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:85)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:424)
at net.minecraft.client.Minecraft.run(Minecraft.java:786)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at net.minecraft.src.BiomeGenFastLands.<init>(BiomeGenFastLands.java:11)
at net.minecraft.src.mod_MIBM.<clinit>(mod_MIBM.java:10)
... 15 more
--- END ERROR REPORT 2d4d3306 ----------
Unless it's been fixed, your custom block(s) needs to be below BlockID 127 in order for it to be used in a biome generation.
My mob spawns fine now, but I gave it a zombie skin for testing and it turned out like this...
Unless you're using EntityZombie's actual model class, chances are that the zombie won't work the same. Especially if it's a custom model. What is the model you gave your mob? (Not texture)
timoteo2000 is correct. But I just wanted to add something. Your cake has not been given any special properties inside the ItemBirthdaycake class. By default, things will stack to a maximum of 64, so it doesn't need to be told that. Unless you plan on giving it other properties, then the "ItemBirthdayCake" class would be just extra clutter to keep up to date. It'd be asier on you later to delete said class and change your item declaration to this (incorporating the capital i timoteo2000 mentioned):
public static final Item Birthdaycake = new Item(5000).setItemName ("bdaycake");
Unless you're using EntityZombie's actual model class, chances are that the zombie won't work the same. Especially if it's a custom model. What is the model you gave your mob? (Not texture)
Oh ok, whoops. I didn't give it any properties on purpose. I like to get the basic coding first and get that working before I go into that. Don't wanna be buried in a pile of errors.
I just noticed the mob is based off of ModelBase. I believe that is the problem. If I change it to ModelBiped it will change to the shape of a human, correct?
How to make a step sound for custom block
because its always stone sound
All step sounds can be found within the Block class. In order to actually set a step sound, you need to add .setStepSound to the end of your block declarations. Here's an example:
public static final Block blockExample = new Block(134, Material.iron).setBlockName("blockExample").setHardness(1.5F).setResistance(10F).setStepSound(Block.soundMetalFootstep);
In that little example, I gave blockExample a metal footstep sound. In order to actually reference the sound, though, you need to put Block. in front of the step sound, as they're all located within the Block Class. Also, here's a list of all the stepsounds:
Oh ok, whoops. I didn't give it any properties on purpose. I like to get the basic coding first and get that working before I go into that. Don't wanna be buried in a pile of errors.
I just noticed the mob is based off of ModelBase. I believe that is the problem. If I change it to ModelBiped it will change to the shape of a human, correct?
It should, yeah.
Rollback Post to RevisionRollBack
I used to maintain the Minecraft Forums Mod List. However, life has stepped in the way of that. Perhaps later...
needed? Because I do not have a texture for the item at the moment, but will add one later. But since I don't have one, is it really needed to be there? Will it mess up any of the code if left there or taken away?
needed? Because I do not have a texture for the item at the moment, but will add one later. But since I don't have one, is it really needed to be there? Will it mess up any of the code if left there or taken away?
If you want to test your code in-game, it will be needed. Speaking of textures... I also forgot to add something else to the declaration. Change it to the following:
public static final Item Birthdaycake = new Item(5000, 0).setItemName ("bdaycake");
I forgot the ", 0" after the ItemID. The 0 refers to the location on the items.png. If you don't have an image texture to add to it yet, just leave out the the whole addOverride line for now, and it will default to a texture already in-game. Best to just comment out your entire image declaration for now. Like so:
This will allow you to just come back to it later without deleting it from the code. When you want it to effect your game again, just remove the two // from the beginning.
(Also, If you leave the number at 0 without declaring a texture for it, it'll look like a leather helmet in-game)
Rollback Post to RevisionRollBack
I used to maintain the Minecraft Forums Mod List. However, life has stepped in the way of that. Perhaps later...
I get it now. Thanks. However, just one more thing. Say I make the image and name it birthdaycake.png, and when the player installs it the picture goes into the item folder. Would I change the code to this or something else?
mod_Legendarium:
package net.minecraft.src; import net.minecraft.client.Minecraft; import java.util.*; public class mod_Legendarium extends BaseMod{ public void load(){ //Mob Grok ModLoader.registerEntityID(EntityGrok.class, "Grok", ModLoader.getUniqueEntityId()); ModLoader.addSpawn(EntityGrok.class, 4, 5, 8, EnumCreatureType.monster); } public void addRenderer(Map map) { map.put(EntityGrok.class, new RenderGrok(new ModelGrok(), 1.0F)); } public String getVersion(){ return "1.0";} }EntityGrok:
package net.minecraft.src; import java.util.Random; public class EntityGrok extends EntityMob{ private static final ItemStack defaultHeldItem; public EntityGrok(World world) { super(world); texture = "/items/Grok.png"; moveSpeed = 0.5F; isImmuneToFire = false; float f = 0.23F; getNavigator().setBreakDoors(true); tasks.addTask(0, new EntityAIWander(this, moveSpeed)); tasks.addTask(1, new EntityAISwimming(this)); tasks.addTask(2, new EntityAIBreakDoor(this)); tasks.addTask(3, new EntityAIAttackOnCollide(this, net.minecraft.src.EntityPlayer.class, moveSpeed, false)); tasks.addTask(4, new EntityAIAttackOnCollide(this, net.minecraft.src.EntityVillager.class, moveSpeed, true)); tasks.addTask(5, new EntityAIMoveTwardsRestriction(this, moveSpeed)); tasks.addTask(6, new EntityAIMoveThroughVillage(this, moveSpeed, false)); tasks.addTask(8, new EntityAIWatchClosest(this, net.minecraft.src.EntityPlayer.class, 8F)); tasks.addTask(9, new EntityAILookIdle(this)); targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntityPlayer.class, 16F, 0, true)); targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntityVillager.class, 16F, 0, false)); attackStrength = 5; } protected boolean isAIEnabled() { return true; } public boolean interact(EntityPlayer entityplayer) { ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Gew, unqi hasr! Die, foolish human!"); return true; } public int getMaxHealth() { return 15; } protected String getLivingSound() { return "mob.zombie"; } protected String getHurtSound() { return "mob.zombiehurt"; } protected String getDeathSound() { return "mob.zombiedeath"; } protected int getDropItemId() { return Item.clay.shiftedIndex; } public EnumCreatureAttribute getCreatureAttribute() { return EnumCreatureAttribute.UNDEAD; } protected boolean canDespawn() { return false; } public void onLivingUpdate() { if (worldObj.isDaytime() && !worldObj.isRemote) { float f = getBrightness(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) { setFire(8); } } } static { defaultHeldItem = new ItemStack(Item.bow, 1); } }ModelGrok:
package net.minecraft.src; public class ModelGrok extends ModelBase { //fields ModelRenderer head; ModelRenderer body; ModelRenderer rightarm; ModelRenderer leftarm; ModelRenderer rightleg; ModelRenderer leftleg; ModelRenderer horn1; ModelRenderer horn2; public int heldItemLeft; public int heldItemRight; public boolean isSneak; public boolean aimedBow; public ModelGrok() { textureWidth = 64; textureHeight = 64; head = new ModelRenderer(this, 0, 0); head.addBox(-4F, -8F, -4F, 8, 8, 8); head.setRotationPoint(1F, 2F, 0F); head.setTextureSize(64, 64); head.mirror = true; setRotation(head, 0F, 0F, 0F); body = new ModelRenderer(this, 0, 20); body.addBox(-4F, 0F, -2F, 10, 12, 4); body.setRotationPoint(0F, 2F, 0F); body.setTextureSize(64, 64); body.mirror = true; setRotation(body, 0F, 0F, 0F); rightarm = new ModelRenderer(this, 29, 17); rightarm.addBox(-3F, -2F, -2F, 4, 12, 4); rightarm.setRotationPoint(-5F, 4F, 0F); rightarm.setTextureSize(64, 64); rightarm.mirror = true; setRotation(rightarm, 0F, 0F, 0F); leftarm = new ModelRenderer(this, 46, 17); leftarm.addBox(-1F, -2F, -2F, 4, 12, 4); leftarm.setRotationPoint(7F, 4F, 0F); leftarm.setTextureSize(64, 64); leftarm.mirror = true; setRotation(leftarm, 0F, 0F, 0F); rightleg = new ModelRenderer(this, 22, 44); rightleg.addBox(-2F, 0F, -2F, 4, 10, 4); rightleg.setRotationPoint(-1F, 14F, 0F); rightleg.setTextureSize(64, 64); rightleg.mirror = true; setRotation(rightleg, 0F, 0F, 0F); leftleg = new ModelRenderer(this, 0, 44); leftleg.addBox(-2F, 0F, -2F, 4, 10, 4); leftleg.setRotationPoint(3F, 14F, 0F); leftleg.setTextureSize(64, 64); leftleg.mirror = true; setRotation(leftleg, 0F, 0F, 0F); horn1 = new ModelRenderer(this, 35, 0); horn1.addBox(0F, 0F, 0F, 1, 2, 1); horn1.setRotationPoint(-2F, -8F, 0F); horn1.setTextureSize(64, 64); horn1.mirror = true; setRotation(horn1, 0F, 0F, 0F); horn2 = new ModelRenderer(this, 44, 0); horn2.addBox(0F, 0F, 0F, 1, 2, 1); horn2.setRotationPoint(3F, -8F, 0F); horn2.setTextureSize(64, 64); horn2.mirror = true; setRotation(horn2, 0F, 0F, 0F); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { setRotationAngles(par2, par3, par4, par5, par6, par7); head.render(par7); body.render(par7); rightarm.render(par7); leftarm.render(par7); rightleg.render(par7); leftleg.render(par7); horn1.render(par7); horn2.render(par7); } /** * Sets the models various rotation angles. */ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6) { head.rotateAngleY = par4 / (180F / (float)Math.PI); head.rotateAngleX = par5 / (180F / (float)Math.PI); rightarm.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 2.0F * par2 * 0.5F; leftarm.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 2.0F * par2 * 0.5F; rightarm.rotateAngleZ = 0.0F; leftarm.rotateAngleZ = 0.0F; rightleg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2; leftleg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2; rightleg.rotateAngleY = 0.0F; leftleg.rotateAngleY = 0.0F; if (isRiding) { rightarm.rotateAngleX += -((float)Math.PI / 5F); leftarm.rotateAngleX += -((float)Math.PI / 5F); rightleg.rotateAngleX = -((float)Math.PI * 2F / 5F); leftleg.rotateAngleX = -((float)Math.PI * 2F / 5F); rightleg.rotateAngleY = ((float)Math.PI / 10F); leftleg.rotateAngleY = -((float)Math.PI / 10F); } if (heldItemLeft != 0) { leftarm.rotateAngleX = leftarm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)heldItemLeft; } if (heldItemRight != 0) { rightarm.rotateAngleX = rightarm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)heldItemRight; } rightarm.rotateAngleY = 0.0F; leftarm.rotateAngleY = 0.0F; } /** * renders the ears (specifically, deadmau5's) */ public void renderEars(float par1) { horn1.rotateAngleY = head.rotateAngleY; horn1.rotateAngleX = head.rotateAngleX; horn1.rotationPointX = 0.0F; horn1.rotationPointY = 0.0F; horn1.render(par1); horn2.rotateAngleY = head.rotateAngleY; horn2.rotateAngleX = head.rotateAngleX; horn2.rotationPointX = 0.0F; horn2.rotationPointY = 0.0F; horn2.render(par1); } }RenderGrok:
package net.minecraft.src; import org.lwjgl.opengl.GL11; public class RenderGrok extends RenderLiving { protected ModelGrok modelGrokMain; protected float field_40296_d; public RenderGrok(ModelGrok par1ModelGrok, float par2) { this(par1ModelGrok, par2, 1.0F); modelGrokMain = par1ModelGrok; } public RenderGrok(ModelGrok par1ModelGrok, float par2, float par3) { super(par1ModelGrok, par2); modelGrokMain = par1ModelGrok; field_40296_d = par3; } public void renderGrokA(EntityGrok entity, double d, double d1, double d2, float f, float f1) { super.doRenderLiving(entity, d, d1, d2, f, f1); } public void doRenderLiving(EntityLiving entityliving, double d, double d1, double d2, float f, float f1) { super.doRenderLiving((EntityGrok) entityliving, d, d1, d2, f, f1); } public void doRender(Entity entity, double d, double d1, double d2, float f, float f1) { renderGrokA((EntityGrok)entity, d, d1, d2, f, f1); } protected void preRenderScale(EntityGrok entity, float f) { GL11.glScalef(1.0F, 1.0F, 1.0F); } protected void preRenderCallback(EntityLiving entityliving, float f) { preRenderScale((EntityGrok)entityliving, f); } }Any help will be deeply appreciated! Thanks in advance!
--CNSoup
EDIT: It should also be noted that I can damage and kill them, but when I hit them, they begin to move their arms and legs, like they are moving, but they don't go anywhere.
I think it is something to do with the modloader name for the NPC.
[color=#941c64]package[/color] net.minecraft.src; [color=#941c64]import[/color] java.util.Map; [color=#941c64]public[/color] [color=#941c64]class[/color] mod_TuNPC [color=#941c64]extends[/color] BaseMod { [color=#941c64]public[/color] [color=#941c64]void[/color] load() { ModLoader.registerEntityID(Hippo.[color=#941c64]class[/color], [color=#3a40f4]"Hippo"[/color], ModLoader.getUniqueEntityId()); ModLoader.addSpawn([u]Hippo[/u].[color=#941c64]class[/color], 20, 20, 20, EnumCreatureType.[color=#0431c3]creature[/color]); } [color=#941c64]public[/color] [color=#941c64]void[/color] addRenderer(Map map) { map.put([u]Hippo[/u].[color=#941c64]class[/color], [color=#941c64]new[/color] RenderBiped([color=#941c64]new[/color] ModelBiped(), 0.5F)); } [color=#941c64]public[/color] String getVersion() { [color=#941c64]return[/color] [color=#3a40f4]"1.2.5"[/color]; } }Also, I want my mob to be around in daylight and not burn, but still attack. So I'm not sure what EnumCreatureType to set it as....?
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumNormal mobs don't burn in daylight unless you tell them to burn in daylight. Same with attacking. The day/night cycle doesn't affect the mobs in TechGuy's tutorials, only when they spawn.
As for the spawn rate, look back in the tutorial. TechGuy tells you what the code means, so just reread it and you'll be fine
Edit: Oh, set the EnumCreatureType to monster as well
Mods loaded: 2
ModLoader 1.2.5
mod_DayZ 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 288d3454 --------
Generated 15/07/12 7:28 PM
Minecraft: Minecraft 1.2.5
OS: Windows 7 (x86) version 6.1
Java: 1.7.0, Oracle Corporation
VM: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: ATI Mobility Radeon HD 4200 Series version 3.2.9704 Compatibility Profile Context, ATI Technologies Inc.
java.lang.RuntimeException: java.lang.Exception: Image not found: DayZ.png
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1451)
at net.minecraft.src.ModLoader.onTick(ModLoader.java:1104)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:21)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:922)
at net.minecraft.client.Minecraft.run(Minecraft.java:801)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.Exception: Image not found: DayZ.png
at net.minecraft.src.ModLoader.loadImage(ModLoader.java:1024)
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1443)
... 5 more
--- END ERROR REPORT 9a643aab ----------
trhanks for the help
You need to read the error:
Put a / before the name of your image. Please use code tags.
together they are powerful beyond imagination."
Thank you. I also looked back at the code and I understand what to do now.
because its always stone sound
So I decided to make a biome with my custom block, which makes the player run 1 1/2 times faster.
I put in all the correct code and stuff, and the top block is the custom block. Here is the code:
package net.minecraft.src; public class mod_MIBM extends BaseMod { public static final BiomeGenBase wastelands = (new BiomeGenWastelands(23)).setColor(0x2768c9).setBiomeName("Wastelands"); public static final BiomeGenBase hellearth = (new BiomeGenHellOnEarth(24)).setColor(0x2768c0).setBiomeName("Hell On Earth"); public static final BiomeGenBase endearth = (new BiomeGenEndOnEarth(25)).setColor(0x2768c1).setBiomeName("End On Earth"); public static final BiomeGenBase stoneplains = (new BiomeGenStonePlains(26)).setColor(0x2768c2).setBiomeName("Stone Plains"); public static final BiomeGenBase ruinedlands = (new BiomeGenRuins(27)).setColor(0x2768c3).setBiomeName("Ruined Lands"); public static final BiomeGenBase deadlylands = (new BiomeGenDeadlyLands(26)).setColor(0x2768c4).setBiomeName("Deadly Lands"); public static final BiomeGenBase runlands = (new BiomeGenFastLands(27)).setColor(0x2768c5).setBiomeName("Fast Lands"); public static Block fastBlock = new BlockSpeed(160).setHardness(5F).setStepSound(Block.soundMetalFootstep).setBlockName("BlockSpeed"); public void load(){ ModLoader.addBiome(wastelands); ModLoader.addBiome(hellearth); ModLoader.addBiome(endearth); ModLoader.addBiome(stoneplains); ModLoader.addBiome(ruinedlands); ModLoader.addBiome(deadlylands); ModLoader.addBiome(runlands); ModLoader.registerBlock(fastBlock); ModLoader.addName(fastBlock, "Fast Block"); } public String getVersion(){ return "MIBM 1.2.5"; } }package net.minecraft.src; import java.util.List; public class BiomeGenFastLands extends BiomeGenBase { public BiomeGenFastLands(int par1) { super(par1); spawnableMonsterList.clear(); spawnableCreatureList.clear(); topBlock = (byte)mod_MIBM.fastBlock.blockID; fillerBlock = (byte)Block.dirt.blockID; } }Error Report:
Here is your problem:
Silveringot is not in the Item class, it is in the mod_tomo class, you only need to put the Silveringot, not Item.Silveringot. Or, (not quite sure if this works) you can put this.Silveringot.
Error Log
src\minecraft\net\minecraft\net\mod_Gag.java:5: error: cannot find symbol
public static final item Birthdaycake = new ItemBirthdaycake(5000).setItemName ("bdaycake");
symbol: class item
location: class mod_Gag
My code
mod_Gag
package net.minecraft.src; public class mod_Gag extends BaseMod { public static final item Birthdaycake = new ItemBirthdaycake(5000).setItemName("bdaycake"); public void load() { Birthdaycake.iconIndex = ModLoader.addOverride("/gui/items.png", "/image.png"); ModLoader.addName(Birthdaycake, "Birthday Cake"); ModLoader.addRecipe(new ItemStack (Birthdaycake, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt}); } public String getVersion() { return "1.2.5"; } }ItemBirthdaycake
package net.minecraft.src; public class ItemBirthdaycake extends Item { public ItemBirthdaycake(int i) { super(i); maxStackSize = 64; } }On the line that says "public static final item", the 'i' in item should be capital.
The line should look like this:
public static final Item Birthdaycake = new ItemBirthdaycake(5000).setItemName ("anynamehere");
-
View User Profile
-
View Posts
-
Send Message
Retired StaffFor the future, when you're working with items or blocks, Block.Something means that "Something" is declared in the "Block" class. Same with Items. Item.Something would mean that "Something" is declared in the Item class. As such, it's called referencing. If you don't put Block. or Item. in front of things, then it looks for said object within the class you're working with. "this.Silveringot" may work, but it's not a necessity as it's being referenced in the same class you're working with. It's safe to use just "Silveringot" for your recipes.
timoteo2000 is correct. But I just wanted to add something. Your cake has not been given any special properties inside the ItemBirthdaycake class. By default, things will stack to a maximum of 64, so it doesn't need to be told that. Unless you plan on giving it other properties, then the "ItemBirthdayCake" class would be just extra clutter to keep up to date. It'd be easier on you later to delete said class and change your item declaration to this within your mod_* class (incorporating the capital i timoteo2000 mentioned):
public static final Item Birthdaycake = new Item(5000).setItemName ("bdaycake");Unless it's been fixed, your custom block(s) needs to be below BlockID 127 in order for it to be used in a biome generation.
Unless you're using EntityZombie's actual model class, chances are that the zombie won't work the same. Especially if it's a custom model. What is the model you gave your mob? (Not texture)
Oh ok, whoops. I didn't give it any properties on purpose. I like to get the basic coding first and get that working before I go into that. Don't wanna be buried in a pile of errors.
I just noticed the mob is based off of ModelBase. I believe that is the problem. If I change it to ModelBiped it will change to the shape of a human, correct?
-
View User Profile
-
View Posts
-
Send Message
Retired StaffAll step sounds can be found within the Block class. In order to actually set a step sound, you need to add .setStepSound to the end of your block declarations. Here's an example:
public static final Block blockExample = new Block(134, Material.iron).setBlockName("blockExample").setHardness(1.5F).setResistance(10F).setStepSound(Block.soundMetalFootstep);In that little example, I gave blockExample a metal footstep sound. In order to actually reference the sound, though, you need to put Block. in front of the step sound, as they're all located within the Block Class. Also, here's a list of all the stepsounds:
soundPowderFootstep
soundWoodFootstep
soundGravelFootstep
soundGrassFootstep
soundStoneFootstep
soundMetalFootstep
soundGlassFootstep
soundClothFootstep
soundSandFootstep
It should, yeah.
Birthdaycake.iconIndex = ModLoader.addOverride("/gui/items.png", "/image.png");Is the
("/gui/items.png", "/image.png")needed? Because I do not have a texture for the item at the moment, but will add one later. But since I don't have one, is it really needed to be there? Will it mess up any of the code if left there or taken away?-
View User Profile
-
View Posts
-
Send Message
Retired StaffIf you want to test your code in-game, it will be needed. Speaking of textures... I also forgot to add something else to the declaration. Change it to the following:
public static final Item Birthdaycake = new Item(5000, 0).setItemName ("bdaycake");I forgot the ", 0" after the ItemID. The 0 refers to the location on the items.png. If you don't have an image texture to add to it yet, just leave out the the whole addOverride line for now, and it will default to a texture already in-game. Best to just comment out your entire image declaration for now. Like so:
//Birthdaycake.iconIndex = ModLoader.addOverride("/gui/items.png", "/image.png");This will allow you to just come back to it later without deleting it from the code. When you want it to effect your game again, just remove the two // from the beginning.
(Also, If you leave the number at 0 without declaring a texture for it, it'll look like a leather helmet in-game)
Birthdaycake.iconIndex = ModLoader.addOverride("/item/birthdaycake.png");EDIT: New error.
public static Item Birthdaycake = new ItemBirthdaycake(5000, 0).setItemName ("bdaycake");required: int
found: int,int
reason: actual and formal lists differ length