So, I've tried to make my mob tameable, able to sit/wait and so on. I've looked at the wolf and ocelot code, but I couldn't figure out how to make it tameable there (could've been looking at wrong place however...) but here's the code now... quite bad but yeah... it isn't that easy to make a mob. But it would be nice with some help.
package com.holmisas.entity;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIFollowOwner;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAITempt;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.passive.EntityTameable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class EntityMiniDude extends EntityTameable {
public EntityMiniDude(World par1World) {
super(par1World);
this.setSize(1.0F, 1.0F);
this.tasks.addTask(0, new EntityAIWander(this, 1.0D));
this.tasks.addTask(1, new EntityAILookIdle(this));
this.tasks.addTask(2, new EntityAISwimming(this));
this.tasks.addTask(3, new EntityAITempt(this, 1.7D, Items.sugar, false));
this.tasks.addTask(4, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
}
public boolean isAIEnabled(){
return true;
}
protected void applyEntityAttributes(){
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40.0D);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.3D);
}
/**
* Random Drop Between 1 - 3 dropped at a time
*/
protected Item getDropItem(){
return Items.apple;
}
public int getMaxSpawnedInChunk(){
return 8;
}
@Override
public EntityAgeable createChild(EntityAgeable var1) {
return new EntityMiniDude(worldObj);
}
}