Hey inlanoche, thanks for everything. Oh, and that poor gnome :sad.gif:
Anyways, i was tinkering with my codes a bit. I figured a way to open inventory when right clicking a mob with.. an item. I though you could use it and am sharing it. ( with anyone)
Although its a bit stupid because you can open the mobs inventory right away without taming but you can fit it in...
I'm a bad guide and teacher, so i couldn't really make this tutorialish but i might edit this reply when i have time, which i don't right now.
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
package net.minecraft.src;
// Referenced classes of package net.minecraft.src:
// IInventory, ItemStack, NBTTagCompound, NBTTagList,
// SomethingEntity, EntityPlayer, ItemArmor
public class SomethingInventory
implements IInventory
{
public SomethingInventory(EntitySomething entitysomething) //your entity
{
inventory = new ItemStack[9];
inventoryChanged = false;
ent = entitysomething;
}
private int getInventorySlotContainItem(int i)
{
for(int j = 0; j < inventory.length; j++)
{
if(inventory[j] != null && inventory[j].itemID == i)
{
return j;
}
}
return -1;
}
public int storeItemStack(ItemStack itemstack)
{
for(int i = 0; i < inventory.length; i++)
{
if(inventory[i] != null && inventory[i].itemID == itemstack.itemID && inventory[i].isStackable() && inventory[i].stackSize < inventory[i].getMaxStackSize() && inventory[i].stackSize < getInventoryStackLimit() && (!inventory[i].getHasSubtypes() || inventory[i].getItemDamage() == itemstack.getItemDamage()))
{
return i;
}
}
return -1;
}
public int getFirstEmptyStack()
{
for(int i = 0; i < inventory.length; i++)
{
if(inventory[i] == null)
{
return i;
}
}
return -1;
}
private int storePartialItemStack(ItemStack itemstack)
{
int i = itemstack.itemID;
int j = itemstack.stackSize;
int k = storeItemStack(itemstack);
if(k < 0)
{
k = getFirstEmptyStack();
}
if(k < 0)
{
return j;
}
if(inventory[k] == null)
{
inventory[k] = new ItemStack(i, 0, itemstack.getItemDamage());
}
int l = j;
if(l > inventory[k].getMaxStackSize() - inventory[k].stackSize)
{
l = inventory[k].getMaxStackSize() - inventory[k].stackSize;
}
if(l > getInventoryStackLimit() - inventory[k].stackSize)
{
l = getInventoryStackLimit() - inventory[k].stackSize;
}
if(l == 0)
{
return j;
} else
{
j -= l;
inventory[k].stackSize += l;
inventory[k].animationsToGo = 5;
return j;
}
}
public boolean consumeInventoryItem(int i)
{
int j = getInventorySlotContainItem(i);
if(j < 0)
{
return false;
}
if(--inventory[j].stackSize <= 0)
{
inventory[j] = null;
}
return true;
}
public boolean addItemStackToInventory(ItemStack itemstack)
{
if(!itemstack.isItemDamaged())
{
int i;
do
{
i = itemstack.stackSize;
itemstack.stackSize = storePartialItemStack(itemstack);
} while(itemstack.stackSize > 0 && itemstack.stackSize < i);
return itemstack.stackSize < i;
}
int j = getFirstEmptyStack();
if(j >= 0)
{
inventory[j] = ItemStack.copyItemStack(itemstack);
itemstack.stackSize = 0;
return true;
} else
{
return false;
}
}
public ItemStack decrStackSize(int i, int j)
{
ItemStack aitemstack[] = inventory;
if(i >= inventory.length)
{
aitemstack = armorInventory;
i -= inventory.length;
}
if(aitemstack[i] != null)
{
if(aitemstack[i].stackSize <= j)
{
ItemStack itemstack = aitemstack[i];
aitemstack[i] = null;
return itemstack;
}
ItemStack itemstack1 = aitemstack[i].splitStack(j);
if(aitemstack[i].stackSize == 0)
{
aitemstack[i] = null;
}
return itemstack1;
} else
{
return null;
}
}
public void setInventorySlotContents(int i, ItemStack itemstack)
{
ItemStack aitemstack[] = inventory;
if(i >= aitemstack.length)
{
i -= aitemstack.length;
aitemstack = armorInventory;
}
aitemstack[i] = itemstack;
}
public NBTTagList writeToNBT(NBTTagList nbttaglist)
{
for(int i = 0; i < inventory.length; i++)
{
if(inventory[i] != null)
{
NBTTagCompound nbttagcompound = new NBTTagCompound();
nbttagcompound.setByte("Slot", (byte)i);
inventory[i].writeToNBT(nbttagcompound);
nbttaglist.setTag(nbttagcompound);
}
}
for(int j = 0; j < armorInventory.length; j++)
{
if(armorInventory[j] != null)
{
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
nbttagcompound1.setByte("Slot", (byte)(j + 100));
armorInventory[j].writeToNBT(nbttagcompound1);
nbttaglist.setTag(nbttagcompound1);
}
}
return nbttaglist;
}
public void readFromNBT(NBTTagList nbttaglist)
{
inventory = new ItemStack[9];
armorInventory = new ItemStack[1];
for(int i = 0; i < nbttaglist.tagCount(); i++)
{
NBTTagCompound nbttagcompound = (NBTTagCompound)nbttaglist.tagAt(i);
int j = nbttagcompound.getByte("Slot") & 0xff;
ItemStack itemstack = new ItemStack(nbttagcompound);
if(itemstack.getItem() == null)
{
continue;
}
if(j >= 0 && j < inventory.length)
{
inventory[j] = itemstack;
}
if(j >= 100 && j < armorInventory.length + 100)
{
armorInventory[j - 100] = itemstack;
}
}
}
public int getSizeInventory()
{
return inventory.length + 1;
}
public ItemStack getStackInSlot(int i)
{
ItemStack aitemstack[] = inventory;
if(i >= aitemstack.length)
{
i -= aitemstack.length;
aitemstack = armorInventory;
}
return aitemstack[i];
}
public String getInvName()
{
return "Inventory";
}
public int getInventoryStackLimit()
{
return 64;
}
public void onInventoryChanged()
{
inventoryChanged = true;
}
public boolean canInteractWith(EntityPlayer entityplayer)
{
if(ent.isDead)
{
return false;
} else
{
return entityplayer.getDistanceSqToEntity(ent) <= 64D;
}
}
public boolean func_28018_c(ItemStack itemstack)
{
for(int i = 0; i < armorInventory.length; i++)
{
if(armorInventory[i] != null && armorInventory[i].isStackEqual(itemstack))
{
return true;
}
}
for(int j = 0; j < inventory.length; j++)
{
if(inventory[j] != null && inventory[j].isStackEqual(itemstack))
{
return true;
}
}
return false;
}
public void dropAllItems()
{
for(int i = 0; i < inventory.length; i++)
{
if(inventory[i] != null)
{
ent.entityDropItem(inventory[i], 0.0F);
inventory[i] = null;
}
}
}
public ItemStack inventory[];
public ItemStack armorInventory[];
public EntitySomething ent;
public boolean inventoryChanged;
}
So in this one you MUST change the entity with yours or your entity will give an error. I used my EntitySomething here but you must change it with EntityCat and so on.
After you are done with these, you should have an inventory pop up when you right click that Entity with a bone(you can edit). Also the entity will drop all of the items in its inventory upon death. Simple but can be coded furthermore to a more advanced code.
Note: I wrote all these in a hurry, sorry. I didn't have much time while writing these so there might be something wrong.
Hi
After I made some blocks,I wanted to try to create my own passive mod, but i get these five errors:
src\minecraft\net\minecraft\src\Mod_Creature.java:1: class, interface, or enum expected
public void Mod_Creature
^
src\minecraft\net\minecraft\src\Mod_Creature.java:7: class, interface, or enum expected
Modloader.AddSpawn(EntityCreature.java, 100, EnumCreatureType.creature);
^
src\minecraft\net\minecraft\src\Mod_Creature.java:9: class, interface, or enum expected
}
^
src\minecraft\net\minecraft\src\Mod_Creature.java:11: class, interface, or enum expected
public void AddRenderer(Map map)
^
src\minecraft\net\minecraft\src\Mod_Creature.java:14: class, interface, or enum expected
}
^
I will help you figure out how to read these errors (so you can try to fix them on your own later on). Lets look at the very first compile error here:
src\minecraft\net\minecraft\src\Mod_Creature.java:1: class, interface, or enum expected
public void Mod_Creature
First, it tells you which file the error is in. In this case Mod_Creature.java (which by the way will need to be changed to mod_Creature.java for it to be ModLoader compatible). After that you see the :1, this tells you which LINE in the code the error occurs. So now you have a very precise place to start looking for the error. Lastly, it gives a description of the error that occurs in Mod_Creature at line 1, in this case it says "class, interface, or enum expected". Obviously you don't have much coding experience but by simply looking others posted codes, you'll notice they begin with:
public class mod_BlahBlah ...
I am taking an educated guess and saying you are missing the word 'class' right there.
For your tameable superclass entity, you never showed how to make the game remember the name and owner with the NBT. I have made it remembers the name but I do not know how to make it remember the owner :/
Hey inlanoche, thanks for everything. Oh, and that poor gnome :sad.gif:
Anyways, i was tinkering with my codes a bit. I figured a way to open inventory when right clicking a mob with.. an item. I though you could use it and am sharing it. ( with anyone)
Although its a bit stupid because you can open the mobs inventory right away without taming but you can fit it in...
I'm a bad guide and teacher, so i couldn't really make this tutorialish but i might edit this reply when i have time, which i don't right now.
So , in your EntitySomething code add this:
...
Wow thanks! I will go over this tomorrow. I can make the right click think as part of the GUI, shouldn't be a problem. Also, will make a flag to set if the mob can carry stuff or not. Thanks again.
I have borrowed your codes and tried to spawn your afropig in world and it actually worked.
(Although the model is kind of buggy and textureless because i don't have it)
I didn't alter any of your entity,render or model code however my mod code might be different and that might be the reason it works. I think i slowly remember that error and how i fixed it.I recreated the same error in my mod.
I recreated the same error you had by changing the "AfroPig" in spawner block code to something else. That way the spawner couldn't find the reference and crashed the game. There, try this out.
Fixed that part, but it still crashes.
I'll PM you my mod_ file, that has to be the problem.
*private messaged*
For your tameable superclass entity, you never showed how to make the game remember the name and owner with the NBT. I have made it remembers the name but I do not know how to make it remember the owner :/
I was about to go that route when killNature changed my focus to the packanimal code.
When that is done I will do the save code. If you want a jump on that, notice that I also store the owner's "username". That was to find the player in the world (no code to find it by ID, which I found odd. I guess the ID might change on a reload?). it might be best to use this on the load. Load the username, then find the user, and attach the ID at that point.
Hey I tried to add a button for my entity. It doesn't work and close the GUI when I click it :/
Gui:
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
package net.minecraft.src;
import java.util.List;
import net.minecraft.client.Minecraft;
// Referenced classes of package net.minecraft.src:
// GuiScreen, GuiButton, StatCollector, GuiOptions,
// StatList, StatFileWriter, World, GuiMainMenu,
// GuiAchievements, GuiStats, MathHelper
// Code taken from GuiIngameMenu.java
public class GUIDwarf extends GuiScreen
{
public GUIDwarf(EntityDwarf entity, EntityPlayer player)
{
//pass the x,y and z of the spawn block being activated, so we can spawn above it
updateCounter2 = 0;
updateCounter = 0;
theplayer = player;
themob = entity;
}
public boolean doesGuiPauseGame()
{
return true; //make sure the game pauses with this interaction?
}
public void initGui()
{
updateCounter2 = 0;
controlList.clear();
byte byte0 = -16;
int yShift = 24;
controlList.add(new GuiButton(0, width / 2 - 100, height / 5 + yShift + byte0, "Back to game"));
yShift += 24;
if(themob.follow)
{
controlList.add(new GuiButton(2, width / 2 - 100, height / 5 + yShift + byte0, "Don't Follow"));
yShift += 24;
}else
{
controlList.add(new GuiButton(2, width / 2 - 100, height / 5 + yShift + byte0, "Follow"));
yShift += 24;
}
if(themob.Dig)
{
controlList.add(new GuiButton(5, width / 2 - 100, height / 5 + yShift + byte0, "Don't Dig"));
yShift += 24;
}else
{
controlList.add(new GuiButton(5, width / 2 - 100, height / 5 + yShift + byte0, "Dig"));
yShift += 24;
}
controlList.add(new GuiButton(10, width / 2 - 100, height / 5 + yShift + byte0, "Rename " + themob.myName));
//yShift += 24;
String s = themob.myName;
textBox = new GuiTextField(this, fontRenderer, width / 2 - 100,height / 5 + yShift + 6, 200, 20, s);
textBox.isFocused = true;
textBox.setMaxStringLength(32);
textBox.setText(themob.myName);
}
protected void actionPerformed(GuiButton guibutton)
{
if(guibutton.id == 0)
{
mc.displayGuiScreen(null);
mc.setIngameFocus();
return;
}
if(guibutton.id == 10)
{
//mc.displayGuiScreen(new GuiRenameWorld(this, themob.myName));
themob.myName = textBox.getText();
mc.displayGuiScreen(null); //exit out after selection
mc.setIngameFocus();
}
if(guibutton.id == 2)
{
themob.follow = !themob.follow; //toggle
mc.displayGuiScreen(null); //exit out after selection
mc.setIngameFocus();
}
if(guibutton.id == 5)
{
themob.Dig = !themob.Dig; //toggle
mc.displayGuiScreen(null); //exit out after selection
mc.setIngameFocus();
}
}
protected void keyTyped(char c, int i)
{
textBox.textboxKeyTyped(c, i);
//((GuiButton)controlList.get(0)).enabled = textBox.getText().trim().length() > 0;
if(c == '\r')
{
actionPerformed((GuiButton)controlList.get(0));
}
}
protected void mouseClicked(int i, int j, int k)
{
super.mouseClicked(i, j, k);
textBox.mouseClicked(i, j, k);
}
public void updateScreen()
{
super.updateScreen();
updateCounter++;
}
public void drawScreen(int i, int j, float f)
{
drawDefaultBackground();
boolean flag = !mc.theWorld.func_650_a(updateCounter2++);
if(flag || updateCounter < 20)
{
float f1 = ((float)(updateCounter % 10) + f) / 10F;
f1 = MathHelper.sin(f1 * 3.141593F * 2.0F) * 0.2F + 0.8F;
int k = (int)(255F * f1);
drawString(fontRenderer, "Saving level..", 8, height - 16, k << 16 | k << 8 | k);
}
textBox.drawTextBox();
drawCenteredString(fontRenderer, themob.myName + "'s" + themob.entityType + " Tasks", width / 2, 30, 0xffffff);
super.drawScreen(i, j, f);
}
private int updateCounter2;
private int updateCounter;
private EntityPlayer theplayer;
private EntityDwarf themob;
private GuiTextField textBox;
}
If you want to see my entity I will PM it to you.
I also managed to break the follow code :/
PM me if you see a problem.
So when you click Dig, the menu closes, as it should (since after the toggle, the next 2 lines close the code). But if you go back into the menu, is it toggled? If so, then the issue is in your entity class. PM me if you don't want to post it here.
does someone knows how to make a mob change from model over time or by feeding?
i want to make my baby hound change to an overgrown hound which has a completely different model once feeded some food.
Gladly appreciated.
Well, I would think that you would have to make a new method in your Model code, deleting the old boxes, and defining new ones. This could be called the same way I did my custom animations. I haven't tried it, but it's easy to check.
If you have a GUI make a button that will call up a method in your model class to delete, say, the head. If you can do that, then it should work. Interesting idea, I can do a test sample and post it later.
Not as easy as I thought. Tried several things in the model file, but the most I got was for either the whole model to disappear (when I set the head = hull;) or to have the screen go all glitchy when I looked at him.
Best bet for this idea is to have 2 entities. When you change from one to the other, just despawn the old, and spawn the new. This is also better for dealing with the texture shift.
I was about to go that route when killNature changed my focus to the packanimal code.
When that is done I will do the save code. If you want a jump on that, notice that I also store the owner's "username". That was to find the player in the world (no code to find it by ID, which I found odd. I guess the ID might change on a reload?). it might be best to use this on the load. Load the username, then find the user, and attach the ID at that point.
Hmm I have tried saving username and owner to NBT but it has not worked :/ It will be in my entity when I send it to you for the question below
So when you click Dig, the menu closes, as it should (since after the toggle, the next 2 lines close the code). But if you go back into the menu, is it toggled? If so, then the issue is in your entity class. PM me if you don't want to post it here.
I will pm it to you... even though it looks like your base there is a lot of things added to it.
This might be strange. But would it be possible to make a player ride the entity backwards? I'm waiting forward for your completed Tamable Entity by the way.
Edit: Oh by the way i've tried the tamable entity code and it gives out 2 errors in eclipse.
One in line 240 and one in line 161. Why are those?
This might be strange. But would it be possible to make a player ride the entity backwards? I'm waiting forward for your completed Tamable Entity by the way.
I'm guessing yes to riding backwards, but with the player controlling? Unless you are looking to do some turret code, I can't see why. You could probably force (with non-controllable ridden mobs) the players view to be +180 from the mount's view.
Well the entity class is coming to a close. 1 thing that I want in it (the saving) and some other stuff that would be nice (fight stuff, and delay on spamming to tame animals, though you could still bypass this with Tame on 1 object).
Just updated quite a bit, including your inventory stuff, but run through the GUI after taming.
I'd suggest generating a random int upon which the model will change then store the times youre fed it X somehow
2.
look at the Chicken class. it uses local variables to control how the wings render
not sure if it will work.
If you look at my tamable code, I use progressive "feeding" to get the mob to be tamable. It doesn't have to be random, but my code allows for that. You set how much boost the mood gets, and at what mood (total boosts) it becomes tamed. Could be changed for when the model changes. I even have resizing by age code. That covers part 1
Part 2 is not what you are looking for. My tutorial on custom animations (see OP for link) does that, and a step further as I use my own calculations for the animation. But that will not "change" your model into something else. Like I posted, I've tried changing the render/model code. The best bet, if you are looking for more than a texture change is to spawn a new entity at the same spot, and copy over any stats that need to be carried over, then despawn the old mob. it's actually much cleaner I'd think.
If you are just looking to change the texture, then just change it when the time is right.
I'm guessing those errors i encounter are because i lack key bindings?
Aw crap... Maybe. Can you post those lines? they should be fine. I have them as
161:
List list1 = worldObj.getCollidingBoundingBoxes(this, boundingBox.func_28195_e(0.03125D, 0.0D, 0.03125D));
240:
super.updatePlayerActionState();
Don't see why though, those are actually part of the original code. Wait, I don't think I have keybindings in the entity class, the code for that is in my main mod_ java file. If I put it in, it would only be a check on a value tied to mod_JWorld.keyDoes. This check for a key state, but I don't think I put that in...
Read my OP, if you're not using Eclipse I'm not helping. These look like compile errors to me.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
I decompile with MCP and edit the Code with eclipse
I´m new to the whole coding stuff :smile.gif:
Didnt work
Anyways, i was tinkering with my codes a bit. I figured a way to open inventory when right clicking a mob with.. an item. I though you could use it and am sharing it. ( with anyone)
Although its a bit stupid because you can open the mobs inventory right away without taming but you can fit it in...
I'm a bad guide and teacher, so i couldn't really make this tutorialish but i might edit this reply when i have time, which i don't right now.
So , in your EntitySomething code add this:
This is where the game opens the inventory/gui when you right click it. As you can see in this part:
You must right click the mob with a bone to open its inventory.
You must also add this below all your codes.
There is a bit more you must add, here is the full code for EntitySomething.
Full EntitySomething code(edit accordingly!):
This here is the gui of the inventory. Here is the code for that one.
SomethingInventoryGui:
Here is where you define your gui. You must make the texture too. Here is one:
http://www.2shared.com/photo/wVkMVbKB/inventory.html
Now you also need the gui code, like so:
SomethingInventory:
So in this one you MUST change the entity with yours or your entity will give an error. I used my EntitySomething here but you must change it with EntityCat and so on.
You also need SomethingContainer code:
After you are done with these, you should have an inventory pop up when you right click that Entity with a bone(you can edit). Also the entity will drop all of the items in its inventory upon death. Simple but can be coded furthermore to a more advanced code.
Note: I wrote all these in a hurry, sorry. I didn't have much time while writing these so there might be something wrong.
I will help you figure out how to read these errors (so you can try to fix them on your own later on). Lets look at the very first compile error here:
First, it tells you which file the error is in. In this case Mod_Creature.java (which by the way will need to be changed to mod_Creature.java for it to be ModLoader compatible). After that you see the :1, this tells you which LINE in the code the error occurs. So now you have a very precise place to start looking for the error. Lastly, it gives a description of the error that occurs in Mod_Creature at line 1, in this case it says "class, interface, or enum expected". Obviously you don't have much coding experience but by simply looking others posted codes, you'll notice they begin with:
I am taking an educated guess and saying you are missing the word 'class' right there.
Wow thanks! I will go over this tomorrow. I can make the right click think as part of the GUI, shouldn't be a problem. Also, will make a flag to set if the mob can carry stuff or not. Thanks again.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Fixed that part, but it still crashes.
I'll PM you my mod_ file, that has to be the problem.
*private messaged*
No, it wouldn't spawn pigs either. :/
Gui:
If you want to see my entity I will PM it to you.
I also managed to break the follow code :/
PM me if you see a problem.
I was about to go that route when killNature changed my focus to the packanimal code.
When that is done I will do the save code. If you want a jump on that, notice that I also store the owner's "username". That was to find the player in the world (no code to find it by ID, which I found odd. I guess the ID might change on a reload?). it might be best to use this on the load. Load the username, then find the user, and attach the ID at that point.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
So when you click Dig, the menu closes, as it should (since after the toggle, the next 2 lines close the code). But if you go back into the menu, is it toggled? If so, then the issue is in your entity class. PM me if you don't want to post it here.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Well, I would think that you would have to make a new method in your Model code, deleting the old boxes, and defining new ones. This could be called the same way I did my custom animations. I haven't tried it, but it's easy to check.
If you have a GUI make a button that will call up a method in your model class to delete, say, the head. If you can do that, then it should work. Interesting idea, I can do a test sample and post it later.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Not as easy as I thought. Tried several things in the model file, but the most I got was for either the whole model to disappear (when I set the head = hull;) or to have the screen go all glitchy when I looked at him.
Best bet for this idea is to have 2 entities. When you change from one to the other, just despawn the old, and spawn the new. This is also better for dealing with the texture shift.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Hmm I have tried saving username and owner to NBT but it has not worked :/ It will be in my entity when I send it to you for the question below
I will pm it to you... even though it looks like your base there is a lot of things added to it.
no and that's why i'm so curious of why it isnt working
Edit: Oh by the way i've tried the tamable entity code and it gives out 2 errors in eclipse.
One in line 240 and one in line 161. Why are those?
I'm guessing yes to riding backwards, but with the player controlling? Unless you are looking to do some turret code, I can't see why. You could probably force (with non-controllable ridden mobs) the players view to be +180 from the mount's view.
Well the entity class is coming to a close. 1 thing that I want in it (the saving) and some other stuff that would be nice (fight stuff, and delay on spamming to tame animals, though you could still bypass this with Tame on 1 object).
Just updated quite a bit, including your inventory stuff, but run through the GUI after taming.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
If you look at my tamable code, I use progressive "feeding" to get the mob to be tamable. It doesn't have to be random, but my code allows for that. You set how much boost the mood gets, and at what mood (total boosts) it becomes tamed. Could be changed for when the model changes. I even have resizing by age code. That covers part 1
Part 2 is not what you are looking for. My tutorial on custom animations (see OP for link) does that, and a step further as I use my own calculations for the animation. But that will not "change" your model into something else. Like I posted, I've tried changing the render/model code. The best bet, if you are looking for more than a texture change is to spawn a new entity at the same spot, and copy over any stats that need to be carried over, then despawn the old mob. it's actually much cleaner I'd think.
If you are just looking to change the texture, then just change it when the time is right.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Aw crap... Maybe. Can you post those lines? they should be fine. I have them as
161:
240:
Don't see why though, those are actually part of the original code. Wait, I don't think I have keybindings in the entity class, the code for that is in my main mod_ java file. If I put it in, it would only be a check on a value tied to mod_JWorld.keyDoes. This check for a key state, but I don't think I put that in...
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE