Hey, sorry to bother you, but I have a question: My custom mobs won't spawn in the wild. They spawn with eggs, however. They did spawn with 1.4.5, but when I updated to 1.4.6, they disappeared.
mod_*******
package net.minecraft.src;
import java.util.Map;
import java.util.Random;
import java.awt.Color;
public class mod_Reiatsu extends BaseMod
{
public void load()
{
//Whole
ModLoader.registerEntityID(EntityWhole.class, "Whole", 26);//registers the mobs name and id
ModLoader.addSpawn("EntityWhole.class", 3, 3, 4, EnumCreatureType.monster);//makes the mob spawn in game see bottom
ModLoader.addLocalization("entity.Whole.name", "Whole");//adds the name of the mob to the spawn egg
EntityList.entityEggs.put(Integer.valueOf(26), new EntityEggInfo(26, 894137, (new Color(43, 85, 42)).getRGB()));//creates the spawn egg of the specified colors you will have to mess around with it
//Hollow Bat
ModLoader.registerEntityID(EntityHollowBat.class, "BatHollow", 27);//registers the mobs name and id
ModLoader.addSpawn("EntityHollowBat.class", 3, 3, 4, EnumCreatureType.monster);//makes the mob spawn in game see bottom
ModLoader.addLocalization("entity.BatHollow.name", "Hollow");//adds the name of the mob to the spawn egg
EntityList.entityEggs.put(Integer.valueOf(27), new EntityEggInfo(27, 16777215, (new Color(43, 85, 42)).getRGB()));//creates the spawn egg of the specified colors you will have to mess around with it
}
public void addRenderer(Map map)
{
map.put(EntityWhole.class, new RenderLiving(new ModelBiped(),.5f));
map.put(EntityHollowBat.class, new RenderLiving(new ModelHollowBat(),.5f));
}
public String getVersion()
{
return "1.4.6";
}
}
[code]
[/spoiler]
EntityHollowBat
[spoiler]
[code]
package net.minecraft.src;
import java.util.Random;
public class EntityHollowBat extends EntityMob//extend this to make mob hostile
{
public EntityHollowBat(World par1World)
{
super(par1World);//super call
this.texture = "/bleachmod/mobs/hollow_bat.png";//specifies texture
this.moveSpeed = .4f;//sets how fast this mob moves
//below this is all the ai tasks that specify how the mob will behave mess around with it to see what happens
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAttackOnCollide(this, EntityPlayer.class, this.moveSpeed, false));
this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityWhole.class, this.moveSpeed, true));
this.tasks.addTask(3, new EntityAIMoveTwardsRestriction(this, this.moveSpeed));
this.tasks.addTask(4, new EntityAIWander(this, this.moveSpeed));
this.tasks.addTask(5, new EntityAILookIdle(this));
this.tasks.addTask(6, new EntityAILeapAtTarget(this, 0.5F));
this.targetTasks.addTask(0, new EntityAIHurtByTarget(this, false));
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 16.0F, 0, true));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWhole.class, 16.0F, 0, false));
//end of ai tasks
}
//the amount of damge the mob does i think
public int func_82193_c(Entity par1Entity)
{
return 10;
}
public int getMaxHealth()//says that the mob will have a health of 20
{
return 60;
}
protected boolean isAIEnabled()//says that the tasks we told it to do before will be run
{
return true;
}
/**
* Returns the volume for the sounds this mob makes.
*/
protected float getSoundVolume()
{
return 0.5F;
}
/**
* Gets the pitch of living sounds in living entities.
*/
protected float getSoundPitch()
{
return super.getSoundPitch() * 0.50F;
}
/**
* Returns the sound this mob makes while it's alive.
*/
protected String getLivingSound()
{
return "mob.endermen.stare";
}
/**
* Returns the sound this mob makes when it is hurt.
*/
protected String getHurtSound()
{
return "mob.endermen.death";
}
/**
* Returns the sound this mob makes on death.
*/
protected String getDeathSound()
{
return "mob.endermen.scream";
}
/**
* Returns true if this entity should push and be pushed by other entities when colliding.
*/
public boolean canBePushed()
{
return true;
}
protected boolean canTriggerWalking()
{
return false;
}
protected void fall() {}
public boolean doesEntityNotTriggerPressurePlate()
{
return true;
}
/**
* Returns the item ID for the item the mob drops on death.
*/
protected int getDropItemId()
{
return mod_Reiatsu.Reiatsu.shiftedIndex;
}
protected void dropFewItems(boolean par1, int par2)
{
this.entityDropItem(new ItemStack(mod_Reiatsu.Reiatsu, 10), 0.0F);
}
/**
* Get this Entity's EnumCreatureAttribute
*/
public EnumCreatureAttribute getCreatureAttribute()
{
return EnumCreatureAttribute.SOULS;
}
protected void dropRareDrop(int par1)
{
switch (this.rand.nextInt(3))
{
case 0:
this.dropItem(mod_Reiatsu.Reiatsu.shiftedIndex, 1);
break;
case 1:
this.dropItem(mod_Reiatsu.ReiatsuBlock.blockID, 1);
break;
case 2:
this.dropItem(mod_Reiatsu.HollowHelmet.shiftedIndex, 1);
}
}
protected void entityInit()
{
super.entityInit();
this.dataWatcher.addObject(16, new Byte((byte)0));
}
public void initCreature(){}
}
ModelHollowBat
package net.minecraft.src;
public class ModelHollowBat extends ModelBase
{
private ModelRenderer batHead;
/** The body box of the bat model. */
private ModelRenderer batBody;
/** The inner right wing box of the bat model. */
private ModelRenderer batRightWing;
/** The inner left wing box of the bat model. */
private ModelRenderer batLeftWing;
/** The outer right wing box of the bat model. */
private ModelRenderer batOuterRightWing;
/** The outer left wing box of the bat model. */
private ModelRenderer batOuterLeftWing;
public ModelHollowBat()
{
this.textureWidth = 64;
this.textureHeight = 64;
this.batHead = new ModelRenderer(this, 0, 0);
this.batHead.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6);
ModelRenderer var1 = new ModelRenderer(this, 24, 0);
var1.addBox(-4.0F, -6.0F, -2.0F, 3, 4, 1);
this.batHead.addChild(var1);
ModelRenderer var2 = new ModelRenderer(this, 24, 0);
var2.mirror = true;
var2.addBox(1.0F, -6.0F, -2.0F, 3, 4, 1);
this.batHead.addChild(var2);
this.batBody = new ModelRenderer(this, 0, 16);
this.batBody.addBox(-3.0F, 4.0F, -3.0F, 6, 12, 6);
this.batBody.setTextureOffset(0, 34).addBox(-5.0F, 16.0F, 0.0F, 10, 6, 1);
this.batRightWing = new ModelRenderer(this, 42, 0);
this.batRightWing.addBox(-12.0F, 1.0F, 1.5F, 10, 16, 1);
this.batOuterRightWing = new ModelRenderer(this, 24, 16);
this.batOuterRightWing.setRotationPoint(-12.0F, 1.0F, 1.5F);
this.batOuterRightWing.addBox(-8.0F, 1.0F, 0.0F, 8, 12, 1);
this.batLeftWing = new ModelRenderer(this, 42, 0);
this.batLeftWing.mirror = true;
this.batLeftWing.addBox(2.0F, 1.0F, 1.5F, 10, 16, 1);
this.batOuterLeftWing = new ModelRenderer(this, 24, 16);
this.batOuterLeftWing.mirror = true;
this.batOuterLeftWing.setRotationPoint(12.0F, 1.0F, 1.5F);
this.batOuterLeftWing.addBox(0.0F, 1.0F, 0.0F, 8, 12, 1);
this.batBody.addChild(this.batRightWing);
this.batBody.addChild(this.batLeftWing);
this.batRightWing.addChild(this.batOuterRightWing);
this.batLeftWing.addChild(this.batOuterLeftWing);
}
/**
* not actually sure this is size, is not used as of now, but the model would be recreated if the value changed and
* it seems a good match for a bats size
*/
public int getBatSize()
{
return 36;
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7)
{
EntityHollowBat var8 = (EntityHollowBat)par1Entity;
{
this.batHead.rotateAngleX = par6 / (180F / (float)Math.PI);
this.batHead.rotateAngleY = par5 / (180F / (float)Math.PI);
this.batHead.rotateAngleZ = 0.0F;
this.batHead.setRotationPoint(0.0F, 0.0F, 0.0F);
this.batRightWing.setRotationPoint(0.0F, 0.0F, 0.0F);
this.batLeftWing.setRotationPoint(0.0F, 0.0F, 0.0F);
this.batBody.rotateAngleX = ((float)Math.PI / 4F) + MathHelper.cos(par4 * 0.1F) * 0.15F;
this.batBody.rotateAngleY = 0.0F;
this.batRightWing.rotateAngleY = MathHelper.cos(par4 * 1.3F) * (float)Math.PI * 0.25F;
this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY;
this.batOuterRightWing.rotateAngleY = this.batRightWing.rotateAngleY * 0.5F;
this.batOuterLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY * 0.5F;
}
this.batHead.render(par7);
this.batBody.render(par7);
}
}
Someone said that it was a problem with ModLoader's Entitytracker code, but I don't know how to fix it. Any help would be wonderful.
Thanks,
LittleBreadLoaf
Nice videos man! Very organized also . I also have a huge idea for a mod but I do not wish to post the info here but if it's successful you will be referenced! Anyway keep up the good work
Nice videos man! Very organized also . I also have a huge idea for a mod but I do not wish to post the info here but if it's successful you will be referenced! Anyway keep up the good work
How to make a new tree
How to make a new sapling
How to make your own mob spawn in a certain biome
How to make an unbreakable block
How to mine your ore with a certain pickaxe
That is all I want to learn plus the ones you listed
I love these tutorials! They are so helpful and I use Java all the time! Might I add a suggestion though? Make a tutorial on how to make blocks glow like Glowstone or torches!
Modloader
Look in the section for Ores, It'll be in your BlockNAME.java class. Episode 8
public int idDropped(int par1, Random par2Random, int par3) { return mod_NAME.ITEM.shiftedIndex; }I will look and see if this happens to my mob
Download My New Mod HERE:
http://www.minecraftforum.net/topic/2099817-wip-164-forge-mcreator-gun-battle-mod/
i have the same problem
Both of you, post your mod_* code (in spoiler and code tags).
Post a topic on my help forums
We will need Minecraft forge, I'm interested in learning that as well
I'm gonna add that to the list when I make one for Forge
Thanks
How can i add custom itemdrops for mobs?
(The items that i made)
I would like to learn:
How to make a new tree
How to make a new sapling
How to make your own mob spawn in a certain biome
How to make an unbreakable block
How to mine your ore with a certain pickaxe
That is all I want to learn plus the ones you listed
when ur finish tell me about
Project 'Client' is missing required library: 'jars/bin/jinput.jar'
Project 'Client' is missing required library: 'jars/bin/lwjgl_util.jar'
Project 'Client' is missing required library: 'jars/bin/lwjgl.jar'
Project 'Client' is missing required library: 'jars/bin/minecraft.jar'
Project 'Server' is missing required library: 'jars/minecraft_server.jar'