Started by
mtus45
on
Topic category: Help with Minecraft modding (Java Edition)
Hello! I would like to know if is it possible to make a tamable/dog-like mob in mcreator, with the same systematics as a wolf, which you give a item and it follows and protects the player.
Thanks for the attention.
Mtus45
Theoretically yes. You need to your mob extends EntityTameable. And propably you will also need make some NBT tags and maybe datawatcher.
For tame you can use for example this:
public boolean interact(EntityPlayer player)
{
ItemStack itemstack = player.inventory.getCurrentItem();
if (itemstack != null && itemstack.getItem() == Items.bone)
{
If(!this.isTamed()){
if (!this.worldObj.isRemote)
{
this.setTamed(true);
this.setOwnerId(player.getUniqueID().toString());}}}}
Thanks for the help, dude. I´ll try it right now.
I´m preaty noob at mcreator, could you explain me where to place the code?
So first thing you need change extends Entity to extends EntityTameable.
And change the public bool interact to this:
public boolean interact(EntityPlayer player)
{
ItemStack itemstack = player.inventory.getCurrentItem();
if (itemstack != null && itemstack.getItem() == Items.bone)
{
If(!this.isTamed()){
if (!this.worldObj.isRemote)
{
this.setTamed(true);
this.setOwnerId(player.getUniqueID().toString());}}}}
You can also look to the EntityWolf source code to have some inspiration.
thx
Sorry for anoying you again, but where is the folder of the codes? I just cant find it! I searched at C:\Pylo\MCreator165\ but i didnt find it. Where is it? :(
@#6
The file might be in:
C:\MCreator 1.6.5 [1.8.9]\forge\sources\net\mincraft\entity\passive
There should be a bunch of java file of entity id & code, which include files for "EntityWolf" and "EntityTameable" in the folder labels "passive".
you could also try looking by typing the word "EntityWolf.java" (or "Entity<name>.java") into your computer search tab, thats what I do. (°w°)