I'm in a bit of a predicament, as I am one of the few who still uses Minecraft 1.5.2, mostly because my computer is horrible, and am planning on buying Minecraft when I get a better computer, but that's beside the point. Basically I started making a mod using Forge last year(2013) in early October, and I just dropped until a few weeks ago, when I picked the project up again, and added an Entity. This is the problem according to the Console:
This is the error message that stands out to me in the console
2014-02-28 23:06:50 [WARNING] [Minecraft-Client] Skipping Entity with id 0
This is my Entity coding in my main class
public void addRender (Map varl) {
varl.put(EntityDan1.class, new RenderDan1(new ModelDan1(), 275.0F));
2014-02-28 23:06:13 [INFO] [ForgeModLoader] Forge Mod Loader version 5.2.23.738 for Minecraft 1.5.2 loading
2014-02-28 23:06:13 [INFO] [ForgeModLoader] Java is Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_40, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jdk1.7.0_40\jre
2014-02-28 23:06:13 [INFO] [ForgeModLoader] Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
2014-02-28 23:06:13 [WARNING] [ForgeModLoader] Found an un-manifested jar file in the coremods folder : Creeper-Gauntlet-Mod-1.5.2.jar, it will be ignored.
2014-02-28 23:06:20 [INFO] [STDOUT] 229 recipes
2014-02-28 23:06:20 [INFO] [STDOUT] 27 achievements
2014-02-28 23:06:21 [INFO] [Minecraft-Client] Setting user: Player480
2014-02-28 23:06:21 [INFO] [STDOUT] (Session ID is -)
2014-02-28 23:06:21 [INFO] [STDERR] Client asked for parameter: server
2014-02-28 23:06:21 [INFO] [Minecraft-Client] LWJGL Version: 2.4.2
2014-02-28 23:06:22 [INFO] [MinecraftForge] Attempting early MinecraftForge initialization
2014-02-28 23:06:22 [INFO] [STDOUT] MinecraftForge v7.8.1.738 Initialized
2014-02-28 23:06:22 [INFO] [ForgeModLoader] MinecraftForge v7.8.1.738 Initialized
2014-02-28 23:06:22 [INFO] [STDOUT] Replaced 85 ore recipies
2014-02-28 23:06:22 [INFO] [MinecraftForge] Completed early MinecraftForge initialization
2014-02-28 23:06:22 [INFO] [ForgeModLoader] Reading custom logging properties from C:\Users\Matthew Scarbrough\Desktop\MCP744\jars\config\logging.properties
2014-02-28 23:06:22 [OFF] [ForgeModLoader] Logging level for ForgeModLoader logging is set to ALL
2014-02-28 23:06:22 [INFO] [ForgeModLoader] Searching C:\Users\Matthew Scarbrough\Desktop\MCP744\jars\mods for mods
2014-02-28 23:06:26 [INFO] [ForgeModLoader] Forge Mod Loader has identified 4 mods to load
2014-02-28 23:06:26 [INFO] [mcp] Activating mod mcp
2014-02-28 23:06:26 [INFO] [FML] Activating mod FML
2014-02-28 23:06:26 [INFO] [Forge] Activating mod Forge
2014-02-28 23:06:26 [INFO] [XerainCraft] Activating mod XerainCraft
2014-02-28 23:06:26 [INFO] [ForgeModLoader] FML has found a non-mod file Not-Enough-Items-1.5.2.jar in your mods directory. It will now be injected into your classpath. This could severe stability issues, it should be removed if possible.
2014-02-28 23:06:26 [INFO] [ForgeModLoader] Registering Forge Packet Handler
2014-02-28 23:06:26 [INFO] [ForgeModLoader] Succeeded registering Forge Packet Handler
2014-02-28 23:06:26 [INFO] [ForgeModLoader] Configured a dormant chunk cache size of 0
2014-02-28 23:06:27 [INFO] [STDOUT]
2014-02-28 23:06:27 [INFO] [STDOUT] Starting up SoundSystem...
2014-02-28 23:06:27 [INFO] [STDOUT] Initializing LWJGL OpenAL
2014-02-28 23:06:27 [INFO] [STDOUT] (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org)
2014-02-28 23:06:27 [INFO] [STDOUT] OpenAL initialized.
2014-02-28 23:06:27 [INFO] [STDOUT]
2014-02-28 23:06:29 [INFO] [ForgeModLoader] Forge Mod Loader has detected an older LWJGL version, new advanced texture animation features are disabled
2014-02-28 23:06:29 [INFO] [ForgeModLoader] Not using advanced OpenGL 4.3 advanced capability for animations : OpenGL 4.3 is not available
2014-02-28 23:06:29 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/lava_flow.txt
2014-02-28 23:06:29 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/water_flow.txt
2014-02-28 23:06:29 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_0.txt
2014-02-28 23:06:29 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_1.txt
2014-02-28 23:06:29 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/lava.txt
2014-02-28 23:06:29 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/portal.txt
2014-02-28 23:06:29 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/water.txt
2014-02-28 23:06:29 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/cookedfries.png, but that file does not exist. Ignoring.
2014-02-28 23:06:29 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/fries.png, but that file does not exist. Ignoring.
2014-02-28 23:06:30 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/oilfries.png, but that file does not exist. Ignoring.
2014-02-28 23:06:30 [INFO] [Minecraft-Client] Found animation info for: textures/items/slimeball.txt
2014-02-28 23:06:30 [INFO] [Minecraft-Client] Found animation info for: textures/items/clock.txt
2014-02-28 23:06:30 [INFO] [Minecraft-Client] Found animation info for: textures/items/compass.txt
2014-02-28 23:06:30 [INFO] [ForgeModLoader] Forge Mod Loader has successfully loaded 4 mods
2014-02-28 23:06:31 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/lava_flow.txt
2014-02-28 23:06:31 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/water_flow.txt
2014-02-28 23:06:31 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_0.txt
2014-02-28 23:06:31 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_1.txt
2014-02-28 23:06:31 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/lava.txt
2014-02-28 23:06:31 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/portal.txt
2014-02-28 23:06:31 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/water.txt
2014-02-28 23:06:31 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/cookedfries.png, but that file does not exist. Ignoring.
2014-02-28 23:06:32 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/fries.png, but that file does not exist. Ignoring.
2014-02-28 23:06:32 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/oilfries.png, but that file does not exist. Ignoring.
2014-02-28 23:06:32 [INFO] [Minecraft-Client] Found animation info for: textures/items/slimeball.txt
2014-02-28 23:06:32 [INFO] [Minecraft-Client] Found animation info for: textures/items/clock.txt
2014-02-28 23:06:32 [INFO] [Minecraft-Client] Found animation info for: textures/items/compass.txt
2014-02-28 23:06:34 [INFO] [STDERR] Exception in thread "Thread-11" java.lang.IllegalArgumentException: input stream cannot be null
2014-02-28 23:06:34 [INFO] [STDERR] at net.minecraft.client.mco.Request.func_96352_a(Request.java:94)
2014-02-28 23:06:34 [INFO] [STDERR] at net.minecraft.client.mco.Request.func_96364_c(Request.java:80)
2014-02-28 23:06:34 [INFO] [STDERR] at net.minecraft.client.mco.McoClient.func_96377_a(McoClient.java:198)
2014-02-28 23:06:34 [INFO] [STDERR] at net.minecraft.client.mco.McoClient.func_96375_b(McoClient.java:89)
2014-02-28 23:06:34 [INFO] [STDERR] at net.minecraft.client.gui.ThreadTitleScreen.run(ThreadTitleScreen.java:39)
2014-02-28 23:06:38 [INFO] [Minecraft-Server] Starting integrated minecraft server version 1.5.2
2014-02-28 23:06:38 [INFO] [Minecraft-Server] Generating keypair
2014-02-28 23:06:39 [INFO] [ForgeModLoader] Loading dimension 0 (Copy of Official Testing Grounds) (net.minecraft.server.integrated.IntegratedServer@332fc652)
2014-02-28 23:06:39 [INFO] [ForgeModLoader] Loading dimension 1 (Copy of Official Testing Grounds) (net.minecraft.server.integrated.IntegratedServer@332fc652)
2014-02-28 23:06:39 [INFO] [ForgeModLoader] Loading dimension -1 (Copy of Official Testing Grounds) (net.minecraft.server.integrated.IntegratedServer@332fc652)
2014-02-28 23:06:39 [INFO] [Minecraft-Server] Preparing start region for level 0
2014-02-28 23:06:40 [INFO] [Minecraft-Server] Preparing spawn area: 27%
2014-02-28 23:06:41 [INFO] [Minecraft-Server] Preparing spawn area: 87%
2014-02-28 23:06:42 [INFO] [STDOUT] loading single player
2014-02-28 23:06:42 [INFO] [Minecraft-Server] Player480[/127.0.0.1:0] logged in with entity id 201 at (-231.0279670257223, 5.7692720754184394, -55.93754167941709)
2014-02-28 23:06:46 [WARNING] [Minecraft-Server] Can't keep up! Did the system time change, or is the server overloaded?
2014-02-28 23:06:50 [WARNING] [Minecraft-Client] Skipping Entity with id 0
2014-02-28 23:06:51 [INFO] [Minecraft-Server] Stopping server
2014-02-28 23:06:51 [INFO] [Minecraft-Server] Saving players
2014-02-28 23:06:51 [INFO] [Minecraft-Server] Saving worlds
2014-02-28 23:06:51 [INFO] [Minecraft-Server] Saving chunks for level 'Copy of Official Testing Grounds'/Overworld
2014-02-28 23:06:52 [INFO] [Minecraft-Server] Saving chunks for level 'Copy of Official Testing Grounds'/Nether
2014-02-28 23:06:52 [INFO] [Minecraft-Server] Saving chunks for level 'Copy of Official Testing Grounds'/The End
2014-02-28 23:06:52 [INFO] [ForgeModLoader] Unloading dimension 0
2014-02-28 23:06:52 [INFO] [ForgeModLoader] Unloading dimension -1
2014-02-28 23:06:52 [INFO] [ForgeModLoader] Unloading dimension 1
2014-02-28 23:06:53 [INFO] [STDERR] net.minecraft.util.ReportedException: Exception in world tick
2014-02-28 23:06:53 [INFO] [STDERR] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1878)
2014-02-28 23:06:53 [INFO] [STDERR] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:835)
2014-02-28 23:06:53 [INFO] [STDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:760)
2014-02-28 23:06:53 [INFO] [STDERR] at java.lang.Thread.run(Thread.java:724)
2014-02-28 23:06:53 [INFO] [STDERR] Caused by: java.lang.NullPointerException
2014-02-28 23:06:53 [INFO] [STDERR] at net.minecraft.client.multiplayer.NetClientHandler.handleMobSpawn(NetClientHandler.java:930)
2014-02-28 23:06:53 [INFO] [STDERR] at net.minecraft.network.packet.Packet24MobSpawn.processPacket(Packet24MobSpawn.java:143)
2014-02-28 23:06:53 [INFO] [STDERR] at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89)
2014-02-28 23:06:53 [INFO] [STDERR] at net.minecraft.client.multiplayer.NetClientHandler.processReadPackets(NetClientHandler.java:266)
2014-02-28 23:06:53 [INFO] [STDERR] at net.minecraft.client.multiplayer.WorldClient.tick(WorldClient.java:94)
2014-02-28 23:06:53 [INFO] [STDERR] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1862)
2014-02-28 23:06:53 [INFO] [STDERR] ... 3 more
2014-02-28 23:07:03 [INFO] [Minecraft-Client] Stopping!
2014-02-28 23:07:03 [INFO] [STDOUT]
2014-02-28 23:07:03 [INFO] [STDOUT] SoundSystem shutting down...
2014-02-28 23:07:03 [INFO] [STDOUT] Author: Paul Lamb, www.paulscode.com
2014-02-28 23:07:03 [INFO] [STDOUT]
2014-02-28 23:07:07 [INFO] [STDERR] Someone is closing me!
This is the Entity Class
package MrRichBOB.XerainCraft;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.ai.EntityAIBeg;
import net.minecraft.entity.ai.EntityAIFollowOwner;
import net.minecraft.entity.ai.EntityAIFollowParent;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAILeapAtTarget;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIMate;
import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget;
import net.minecraft.entity.ai.EntityAIOwnerHurtTarget;
import net.minecraft.entity.ai.EntityAIPanic;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAITargetNonTamed;
import net.minecraft.entity.ai.EntityAITempt;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class EntityDan1 extends EntityHuman
{
private EntityAIBase aiLiving;
public EntityDan1(World par1World)
{
super(par1World);
this.texture = "/mob/Dan1.png";
this.setSize(0.9F, 1.3F);
this.getNavigator().setAvoidsWater(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAITempt(this, 0.25F, Item.flintAndSteel.itemID, false));
this.tasks.addTask(3, new EntityAIWander(this, 0.2F));
this.tasks.addTask(4, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.tasks.addTask(5, new EntityAILookIdle(this));
this.tasks.addTask(7, new EntityAILeapAtTarget(this, 0.4F));
this.tasks.addTask(8, new EntityAIAttackOnCollide(this, this.moveSpeed, true));
this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(10, new EntityAILookIdle(this));
this.targetTasks.addTask(11, new EntityDan1AIOwnerHurtByTarget(this));
this.targetTasks.addTask(12, new EntityDan1AIOwnerHurtTarget(this));
this.targetTasks.addTask(13, new EntityAIHurtByTarget(this, true));
this.targetTasks.addTask(14, new EntityDan1AITargetNonTamed(this, EntitySheep.class, 16.0F, 200, false));
this.tasks.addTask(15, new EntityDan1AIFollowOwner(this, this.moveSpeed, 10.0F, 2.0F));
}
/**
* Returns true if the newer Entity AI code should be run
*/
public boolean isAIEnabled()
{
return true;
}
public int getMaxHealth()
{
return 100;
}
/**
* Returns the sound this mob makes while it's alive.
*/
protected String getLivingSound()
{
return "mob.cow.say";
}
/**
* Returns the sound this mob makes when it is hurt.
*/
protected String getHurtSound()
{
return "mob.cow.hurt";
}
/**
* Returns the sound this mob makes on death.
*/
protected String getDeathSound()
{
return "mob.cow.hurt";
}
/**
* Plays step sound at given x, y, z for the entity
*/
protected void playStepSound(int par1, int par2, int par3, int par4)
{
this.playSound("mob.player.step", 0.15F, 1.0F);
}
/**
* Returns the volume for the sounds this mob makes.
*/
protected float getSoundVolume()
{
return 0.4F;
}
/**
* Returns the item ID for the item the mob drops on death.
*/
protected int getDropItemId()
{
return XerainCraft.dannyleg.itemID;
}
/**
* Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
* par2 - Level of Looting used to kill this mob.
*/
protected void dropFewItems(boolean par1, int par2)
{
int j = this.rand.nextInt(3) + this.rand.nextInt(1 + par2);
int k;
for (k = 0; k < j; ++k)
{
this.dropItem(XerainCraft.dannyleg.itemID, 2);
}
}
/**
* Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
*/
public boolean interact(EntityPlayer par1EntityPlayer)
{
ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem();
if (itemstack != null && itemstack.itemID == Item.bucketEmpty.itemID)
{
if (--itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, new ItemStack(Item.bucketMilk));
}
else if (!par1EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bucketMilk)))
{
par1EntityPlayer.dropPlayerItem(new ItemStack(Item.bucketMilk.itemID, 1, 0));
}
return true;
}
else
{
return super.interact(par1EntityPlayer);
}
}
@Override
public boolean getCanSpawnHere() {
if(worldObj.villageCollectionObj.getVillageList().iterator().hasNext() &&
worldObj.villageCollectionObj.findNearestVillage((int)this.posX, (int)this.posY, (int)this.posZ, 10) ==
null) {
return false;
}
return true;
}
protected boolean canDespawn() { return false; } // false for villagers, I believe
/**
* This function is used when two same-species animals in 'love mode' breed to generate the new baby animal.
*/
public EntityDan1 spawnBabyAnimal(EntityAgeable par1EntityAgeable)
{
return new EntityDan1(this.worldObj);
}
public EntityAgeable createChild(EntityAgeable par1EntityAgeable)
{
return this.spawnBabyAnimal(par1EntityAgeable);
}
public boolean isTamed() {
// TODO Auto-generated method stub
return true;
}
public EntityLiving getOwner() {
// TODO Auto-generated method stub
return null;
}
public boolean isSitting() {
// TODO Auto-generated method stub
return true;
}
}
It won't spawn naturally or with a custom chicken egg code I done, but the egg tries to spawn the mob, at which case, the game crashes.
Two other things, I'm using a custom model(Yes I did use its code generated by Techne,)
and I don't know any working spawn egg codes for custom spawn egg, which is why I used the modified chicken egg code.
If I need to provide any additional information, I will gladly do so.
This was a big issue a while back when 1.3.1 was out. I did a explanation on it. It's a lot to read but what's happening is ModLoader is assigning your Id that is out of bounds for it to handle. You said you're using Forge? If so, don't use Modloader at all, convert your mod to Forge and read this post.
Rollback Post to RevisionRollBack
Same ****, different day - Modification Development Section
This was a big issue a while back when 1.3.1 was out. I did a explanation on it. It's a lot to read but what's happening is ModLoader is assigning your Id that is out of bounds for it to handle. You said you're using Forge? If so, don't use Modloader at all, convert your mod to Forge and read this post.
When I was following the tutorial, I was extremely skeptical of that, so after a bit of searching, I actually found the codes:
Although I have yet to test the natural generation, but it spawns! Now while we're on the subject; how would one get the "LanguageRegistry.instance().addStringLocalization("entity.instance.yourMob.name", "Your Mob");" code line to work? I couldn't get it work so I just deleted it.
Did you mean to delete this, or are you using these lines to create a spawn egg? Don't register the same entity on Global and Mod registries.
Use this to add your spawn egg
// Class Field
private static int startEntityId = 300;
public static int getUniqueEntityId() {
do {
startEntityId++;
} while (EntityList.getStringFromID(startEntityId) != null);
return startEntityId;
}
public static void registerEntityEgg(Class<? extends Entity> entity,
int primaryColor, int secondaryColor) {
int id = getUniqueEntityId();
EntityList.IDtoClassMapping.put(id, entity);
EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor,
secondaryColor));
}
It's been a while since I've used this code, so it may not work. Which I will test it out later.
Rollback Post to RevisionRollBack
Same ****, different day - Modification Development Section
Did you mean to delete this, or are you using these lines to create a spawn egg? Don't register the same entity on Global and Mod registries.
Use this to add your spawn egg
// Class Field
private static int startEntityId = 300;
public static int getUniqueEntityId() {
do {
startEntityId++;
} while (EntityList.getStringFromID(startEntityId) != null);
return startEntityId;
}
public static void registerEntityEgg(Class<? extends Entity> entity,
int primaryColor, int secondaryColor) {
int id = getUniqueEntityId();
EntityList.IDtoClassMapping.put(id, entity);
EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor,
secondaryColor));
}
It's been a while since I've used this code, so it may not work. Which I will test it out later.
I was skeptical of the ModLoader codes then I found these codes.
I meant to and did delete the language registration for the mob, for it's the LanguageRegistration for the mob that I can't get to work.
The Line of CODE]{EntityRegistry.registerGlobalEntityID(EntityDan1.
class, "dan1", EntityRegistry.findGlobalUniqueEntityId(), 333333, 0xFF9900); is just fine it works perfectly, as my intentions the spawn egg too.
The Line of CODE]{EntityRegistry.registerGlobalEntityID(EntityDan1.
class, "dan1", EntityRegistry.findGlobalUniqueEntityId(), 333333, 0xFF9900); is just fine it works perfectly, as my intentions the spawn egg too.
Well, it does work because the Forge's Mod entities are checked before Minecrafts(Vanilla). It's just those methods weren't meant to work together, but it does for now. If you do start to get problems, just use the code I put above to register the eggs.
As for the language registry. Forge doesn't use the LanguageRegistry anymore. Instead you put your own language file in src/main/resources/assets directory.
For english, create en_US.lang file.
Then put your entity,item,blocks, etc. names in there
entity.dan1.name=Dan's Name
Make sure there aren't any spaced between the equals sign.
Rollback Post to RevisionRollBack
Same ****, different day - Modification Development Section
// Class Field
private static int startEntityId = 300;
public static int getUniqueEntityId() {
do {
startEntityId++;
} while (EntityList.getStringFromID(startEntityId) != null);
return startEntityId;
}
public static void registerEntityEgg(Class<? extends Entity> entity,
int primaryColor, int secondaryColor) {
int id = getUniqueEntityId();
EntityList.IDtoClassMapping.put(id, entity);
EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor,
secondaryColor));
}
It's been a while since I've used this code, so it may not work. Which I will test it out later.
This is the error message that stands out to me in the console
This is my Entity coding in my main class
public void addRender (Map varl) {
varl.put(EntityDan1.class, new RenderDan1(new ModelDan1(), 275.0F));
ModLoader.registerEntityID(EntityDan1.class, "dan1", ModLoader.getUniqueEntityId());
ModLoader.addSpawn(EntityDan1.class, 90, 6, 35, EnumCreatureType.creature, BiomeGenBase.plains);
}
This is the full console report
2014-02-28 23:06:13 [INFO] [ForgeModLoader] Java is Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_40, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jdk1.7.0_40\jre
2014-02-28 23:06:13 [INFO] [ForgeModLoader] Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
2014-02-28 23:06:13 [WARNING] [ForgeModLoader] Found an un-manifested jar file in the coremods folder : Creeper-Gauntlet-Mod-1.5.2.jar, it will be ignored.
2014-02-28 23:06:20 [INFO] [STDOUT] 229 recipes
2014-02-28 23:06:20 [INFO] [STDOUT] 27 achievements
2014-02-28 23:06:21 [INFO] [Minecraft-Client] Setting user: Player480
2014-02-28 23:06:21 [INFO] [STDOUT] (Session ID is -)
2014-02-28 23:06:21 [INFO] [STDERR] Client asked for parameter: server
2014-02-28 23:06:21 [INFO] [Minecraft-Client] LWJGL Version: 2.4.2
2014-02-28 23:06:22 [INFO] [MinecraftForge] Attempting early MinecraftForge initialization
2014-02-28 23:06:22 [INFO] [STDOUT] MinecraftForge v7.8.1.738 Initialized
2014-02-28 23:06:22 [INFO] [ForgeModLoader] MinecraftForge v7.8.1.738 Initialized
2014-02-28 23:06:22 [INFO] [STDOUT] Replaced 85 ore recipies
2014-02-28 23:06:22 [INFO] [MinecraftForge] Completed early MinecraftForge initialization
2014-02-28 23:06:22 [INFO] [ForgeModLoader] Reading custom logging properties from C:\Users\Matthew Scarbrough\Desktop\MCP744\jars\config\logging.properties
2014-02-28 23:06:22 [OFF] [ForgeModLoader] Logging level for ForgeModLoader logging is set to ALL
2014-02-28 23:06:22 [INFO] [ForgeModLoader] Searching C:\Users\Matthew Scarbrough\Desktop\MCP744\jars\mods for mods
2014-02-28 23:06:26 [INFO] [ForgeModLoader] Forge Mod Loader has identified 4 mods to load
2014-02-28 23:06:26 [INFO] [mcp] Activating mod mcp
2014-02-28 23:06:26 [INFO] [FML] Activating mod FML
2014-02-28 23:06:26 [INFO] [Forge] Activating mod Forge
2014-02-28 23:06:26 [INFO] [XerainCraft] Activating mod XerainCraft
2014-02-28 23:06:26 [INFO] [ForgeModLoader] FML has found a non-mod file Not-Enough-Items-1.5.2.jar in your mods directory. It will now be injected into your classpath. This could severe stability issues, it should be removed if possible.
2014-02-28 23:06:26 [INFO] [ForgeModLoader] Registering Forge Packet Handler
2014-02-28 23:06:26 [INFO] [ForgeModLoader] Succeeded registering Forge Packet Handler
2014-02-28 23:06:26 [INFO] [ForgeModLoader] Configured a dormant chunk cache size of 0
2014-02-28 23:06:27 [INFO] [STDOUT]
2014-02-28 23:06:27 [INFO] [STDOUT] Starting up SoundSystem...
2014-02-28 23:06:27 [INFO] [STDOUT] Initializing LWJGL OpenAL
2014-02-28 23:06:27 [INFO] [STDOUT] (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org)
2014-02-28 23:06:27 [INFO] [STDOUT] OpenAL initialized.
2014-02-28 23:06:27 [INFO] [STDOUT]
2014-02-28 23:06:29 [INFO] [ForgeModLoader] Forge Mod Loader has detected an older LWJGL version, new advanced texture animation features are disabled
2014-02-28 23:06:29 [INFO] [ForgeModLoader] Not using advanced OpenGL 4.3 advanced capability for animations : OpenGL 4.3 is not available
2014-02-28 23:06:29 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/lava_flow.txt
2014-02-28 23:06:29 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/water_flow.txt
2014-02-28 23:06:29 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_0.txt
2014-02-28 23:06:29 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_1.txt
2014-02-28 23:06:29 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/lava.txt
2014-02-28 23:06:29 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/portal.txt
2014-02-28 23:06:29 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/water.txt
2014-02-28 23:06:29 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/cookedfries.png, but that file does not exist. Ignoring.
2014-02-28 23:06:29 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/fries.png, but that file does not exist. Ignoring.
2014-02-28 23:06:30 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/oilfries.png, but that file does not exist. Ignoring.
2014-02-28 23:06:30 [INFO] [Minecraft-Client] Found animation info for: textures/items/slimeball.txt
2014-02-28 23:06:30 [INFO] [Minecraft-Client] Found animation info for: textures/items/clock.txt
2014-02-28 23:06:30 [INFO] [Minecraft-Client] Found animation info for: textures/items/compass.txt
2014-02-28 23:06:30 [INFO] [ForgeModLoader] Forge Mod Loader has successfully loaded 4 mods
2014-02-28 23:06:31 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/lava_flow.txt
2014-02-28 23:06:31 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/water_flow.txt
2014-02-28 23:06:31 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_0.txt
2014-02-28 23:06:31 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_1.txt
2014-02-28 23:06:31 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/lava.txt
2014-02-28 23:06:31 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/portal.txt
2014-02-28 23:06:31 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/water.txt
2014-02-28 23:06:31 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/cookedfries.png, but that file does not exist. Ignoring.
2014-02-28 23:06:32 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/fries.png, but that file does not exist. Ignoring.
2014-02-28 23:06:32 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/oilfries.png, but that file does not exist. Ignoring.
2014-02-28 23:06:32 [INFO] [Minecraft-Client] Found animation info for: textures/items/slimeball.txt
2014-02-28 23:06:32 [INFO] [Minecraft-Client] Found animation info for: textures/items/clock.txt
2014-02-28 23:06:32 [INFO] [Minecraft-Client] Found animation info for: textures/items/compass.txt
2014-02-28 23:06:34 [INFO] [STDERR] Exception in thread "Thread-11" java.lang.IllegalArgumentException: input stream cannot be null
2014-02-28 23:06:34 [INFO] [STDERR] at net.minecraft.client.mco.Request.func_96352_a(Request.java:94)
2014-02-28 23:06:34 [INFO] [STDERR] at net.minecraft.client.mco.Request.func_96364_c(Request.java:80)
2014-02-28 23:06:34 [INFO] [STDERR] at net.minecraft.client.mco.McoClient.func_96377_a(McoClient.java:198)
2014-02-28 23:06:34 [INFO] [STDERR] at net.minecraft.client.mco.McoClient.func_96375_b(McoClient.java:89)
2014-02-28 23:06:34 [INFO] [STDERR] at net.minecraft.client.gui.ThreadTitleScreen.run(ThreadTitleScreen.java:39)
2014-02-28 23:06:38 [INFO] [Minecraft-Server] Starting integrated minecraft server version 1.5.2
2014-02-28 23:06:38 [INFO] [Minecraft-Server] Generating keypair
2014-02-28 23:06:39 [INFO] [ForgeModLoader] Loading dimension 0 (Copy of Official Testing Grounds) (net.minecraft.server.integrated.IntegratedServer@332fc652)
2014-02-28 23:06:39 [INFO] [ForgeModLoader] Loading dimension 1 (Copy of Official Testing Grounds) (net.minecraft.server.integrated.IntegratedServer@332fc652)
2014-02-28 23:06:39 [INFO] [ForgeModLoader] Loading dimension -1 (Copy of Official Testing Grounds) (net.minecraft.server.integrated.IntegratedServer@332fc652)
2014-02-28 23:06:39 [INFO] [Minecraft-Server] Preparing start region for level 0
2014-02-28 23:06:40 [INFO] [Minecraft-Server] Preparing spawn area: 27%
2014-02-28 23:06:41 [INFO] [Minecraft-Server] Preparing spawn area: 87%
2014-02-28 23:06:42 [INFO] [STDOUT] loading single player
2014-02-28 23:06:42 [INFO] [Minecraft-Server] Player480[/127.0.0.1:0] logged in with entity id 201 at (-231.0279670257223, 5.7692720754184394, -55.93754167941709)
2014-02-28 23:06:46 [WARNING] [Minecraft-Server] Can't keep up! Did the system time change, or is the server overloaded?
2014-02-28 23:06:50 [WARNING] [Minecraft-Client] Skipping Entity with id 0
2014-02-28 23:06:51 [INFO] [Minecraft-Server] Stopping server
2014-02-28 23:06:51 [INFO] [Minecraft-Server] Saving players
2014-02-28 23:06:51 [INFO] [Minecraft-Server] Saving worlds
2014-02-28 23:06:51 [INFO] [Minecraft-Server] Saving chunks for level 'Copy of Official Testing Grounds'/Overworld
2014-02-28 23:06:52 [INFO] [Minecraft-Server] Saving chunks for level 'Copy of Official Testing Grounds'/Nether
2014-02-28 23:06:52 [INFO] [Minecraft-Server] Saving chunks for level 'Copy of Official Testing Grounds'/The End
2014-02-28 23:06:52 [INFO] [ForgeModLoader] Unloading dimension 0
2014-02-28 23:06:52 [INFO] [ForgeModLoader] Unloading dimension -1
2014-02-28 23:06:52 [INFO] [ForgeModLoader] Unloading dimension 1
2014-02-28 23:06:53 [INFO] [STDERR] net.minecraft.util.ReportedException: Exception in world tick
2014-02-28 23:06:53 [INFO] [STDERR] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1878)
2014-02-28 23:06:53 [INFO] [STDERR] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:835)
2014-02-28 23:06:53 [INFO] [STDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:760)
2014-02-28 23:06:53 [INFO] [STDERR] at java.lang.Thread.run(Thread.java:724)
2014-02-28 23:06:53 [INFO] [STDERR] Caused by: java.lang.NullPointerException
2014-02-28 23:06:53 [INFO] [STDERR] at net.minecraft.client.multiplayer.NetClientHandler.handleMobSpawn(NetClientHandler.java:930)
2014-02-28 23:06:53 [INFO] [STDERR] at net.minecraft.network.packet.Packet24MobSpawn.processPacket(Packet24MobSpawn.java:143)
2014-02-28 23:06:53 [INFO] [STDERR] at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89)
2014-02-28 23:06:53 [INFO] [STDERR] at net.minecraft.client.multiplayer.NetClientHandler.processReadPackets(NetClientHandler.java:266)
2014-02-28 23:06:53 [INFO] [STDERR] at net.minecraft.client.multiplayer.WorldClient.tick(WorldClient.java:94)
2014-02-28 23:06:53 [INFO] [STDERR] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1862)
2014-02-28 23:06:53 [INFO] [STDERR] ... 3 more
2014-02-28 23:07:03 [INFO] [Minecraft-Client] Stopping!
2014-02-28 23:07:03 [INFO] [STDOUT]
2014-02-28 23:07:03 [INFO] [STDOUT] SoundSystem shutting down...
2014-02-28 23:07:03 [INFO] [STDOUT] Author: Paul Lamb, www.paulscode.com
2014-02-28 23:07:03 [INFO] [STDOUT]
2014-02-28 23:07:07 [INFO] [STDERR] Someone is closing me!
This is the Entity Class
package MrRichBOB.XerainCraft;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.ai.EntityAIBeg;
import net.minecraft.entity.ai.EntityAIFollowOwner;
import net.minecraft.entity.ai.EntityAIFollowParent;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAILeapAtTarget;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIMate;
import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget;
import net.minecraft.entity.ai.EntityAIOwnerHurtTarget;
import net.minecraft.entity.ai.EntityAIPanic;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAITargetNonTamed;
import net.minecraft.entity.ai.EntityAITempt;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class EntityDan1 extends EntityHuman
{
private EntityAIBase aiLiving;
public EntityDan1(World par1World)
{
super(par1World);
this.texture = "/mob/Dan1.png";
this.setSize(0.9F, 1.3F);
this.getNavigator().setAvoidsWater(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAITempt(this, 0.25F, Item.flintAndSteel.itemID, false));
this.tasks.addTask(3, new EntityAIWander(this, 0.2F));
this.tasks.addTask(4, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.tasks.addTask(5, new EntityAILookIdle(this));
this.tasks.addTask(7, new EntityAILeapAtTarget(this, 0.4F));
this.tasks.addTask(8, new EntityAIAttackOnCollide(this, this.moveSpeed, true));
this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(10, new EntityAILookIdle(this));
this.targetTasks.addTask(11, new EntityDan1AIOwnerHurtByTarget(this));
this.targetTasks.addTask(12, new EntityDan1AIOwnerHurtTarget(this));
this.targetTasks.addTask(13, new EntityAIHurtByTarget(this, true));
this.targetTasks.addTask(14, new EntityDan1AITargetNonTamed(this, EntitySheep.class, 16.0F, 200, false));
this.tasks.addTask(15, new EntityDan1AIFollowOwner(this, this.moveSpeed, 10.0F, 2.0F));
}
/**
* Returns true if the newer Entity AI code should be run
*/
public boolean isAIEnabled()
{
return true;
}
public int getMaxHealth()
{
return 100;
}
/**
* Returns the sound this mob makes while it's alive.
*/
protected String getLivingSound()
{
return "mob.cow.say";
}
/**
* Returns the sound this mob makes when it is hurt.
*/
protected String getHurtSound()
{
return "mob.cow.hurt";
}
/**
* Returns the sound this mob makes on death.
*/
protected String getDeathSound()
{
return "mob.cow.hurt";
}
/**
* Plays step sound at given x, y, z for the entity
*/
protected void playStepSound(int par1, int par2, int par3, int par4)
{
this.playSound("mob.player.step", 0.15F, 1.0F);
}
/**
* Returns the volume for the sounds this mob makes.
*/
protected float getSoundVolume()
{
return 0.4F;
}
/**
* Returns the item ID for the item the mob drops on death.
*/
protected int getDropItemId()
{
return XerainCraft.dannyleg.itemID;
}
/**
* Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
* par2 - Level of Looting used to kill this mob.
*/
protected void dropFewItems(boolean par1, int par2)
{
int j = this.rand.nextInt(3) + this.rand.nextInt(1 + par2);
int k;
for (k = 0; k < j; ++k)
{
this.dropItem(XerainCraft.dannyleg.itemID, 2);
}
}
/**
* Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
*/
public boolean interact(EntityPlayer par1EntityPlayer)
{
ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem();
if (itemstack != null && itemstack.itemID == Item.bucketEmpty.itemID)
{
if (--itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, new ItemStack(Item.bucketMilk));
}
else if (!par1EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bucketMilk)))
{
par1EntityPlayer.dropPlayerItem(new ItemStack(Item.bucketMilk.itemID, 1, 0));
}
return true;
}
else
{
return super.interact(par1EntityPlayer);
}
}
@Override
public boolean getCanSpawnHere() {
if(worldObj.villageCollectionObj.getVillageList().iterator().hasNext() &&
worldObj.villageCollectionObj.findNearestVillage((int)this.posX, (int)this.posY, (int)this.posZ, 10) ==
null) {
return false;
}
return true;
}
protected boolean canDespawn() { return false; } // false for villagers, I believe
/**
* This function is used when two same-species animals in 'love mode' breed to generate the new baby animal.
*/
public EntityDan1 spawnBabyAnimal(EntityAgeable par1EntityAgeable)
{
return new EntityDan1(this.worldObj);
}
public EntityAgeable createChild(EntityAgeable par1EntityAgeable)
{
return this.spawnBabyAnimal(par1EntityAgeable);
}
public boolean isTamed() {
// TODO Auto-generated method stub
return true;
}
public EntityLiving getOwner() {
// TODO Auto-generated method stub
return null;
}
public boolean isSitting() {
// TODO Auto-generated method stub
return true;
}
}
It won't spawn naturally or with a custom chicken egg code I done, but the egg tries to spawn the mob, at which case, the game crashes.
Two other things, I'm using a custom model(Yes I did use its code generated by Techne,)
and I don't know any working spawn egg codes for custom spawn egg, which is why I used the modified chicken egg code.
If I need to provide any additional information, I will gladly do so.
I went back an remade the files, while deleting the chicken egg code, but the entity still won't spawn I just can't figure out what the problem is.
When I was following the tutorial, I was extremely skeptical of that, so after a bit of searching, I actually found the codes:
//entityspacifics
public void Mobs() {
EntityRegistry.registerModEntity(EntityDan1.
class, "Danny(Cyclopse Glasses)", 2, this, 80, 3, true);
EntityRegistry.addSpawn(EntityDan1.
class, 5, 2, 6, EnumCreatureType.creature, BiomeGenBase.plains);
}
public void registerRenderInformation() {
RenderingRegistry.registerEntityRenderingHandler(EntityDan1.
class, new RenderDan1(new ModelDan1(), 0.5F));
}
{EntityRegistry.registerGlobalEntityID(EntityDan1.
class, "dan1", EntityRegistry.findGlobalUniqueEntityId(), 333333, 0xFF9900);
}
Although I have yet to test the natural generation, but it spawns! Now while we're on the subject; how would one get the "LanguageRegistry.instance().addStringLocalization("entity.instance.yourMob.name", "Your Mob");" code line to work? I couldn't get it work so I just deleted it.
Why? It's how you register and handle Entities with Forge. Nothing to be skeptical of.
Did you mean to delete this, or are you using these lines to create a spawn egg? Don't register the same entity on Global and Mod registries.
Use this to add your spawn egg
It's been a while since I've used this code, so it may not work. Which I will test it out later.
I was skeptical of the ModLoader codes then I found these codes.
I meant to and did delete the language registration for the mob, for it's the LanguageRegistration for the mob that I can't get to work.
The Line of CODE]{EntityRegistry.registerGlobalEntityID(EntityDan1.
class, "dan1", EntityRegistry.findGlobalUniqueEntityId(), 333333, 0xFF9900); is just fine it works perfectly, as my intentions the spawn egg too.
Well, it does work because the Forge's Mod entities are checked before Minecrafts(Vanilla). It's just those methods weren't meant to work together, but it does for now. If you do start to get problems, just use the code I put above to register the eggs.
As for the language registry. Forge doesn't use the LanguageRegistry anymore. Instead you put your own language file in src/main/resources/assets directory.
For english, create en_US.lang file.
Then put your entity,item,blocks, etc. names in there
Make sure there aren't any spaced between the equals sign.
How would one get that code line to work?