Dog-like mod

Started by mtus45 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Dog-like mod

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

Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Theoretically yes. You need
Mon, 02/29/2016 - 20:04

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());}}}}
              

Joined Feb 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks for the help, dude. I
Mon, 02/29/2016 - 20:09

Thanks for the help, dude. I´ll try it right now.

 

Joined Feb 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I´m preaty noob at mcreator,
Mon, 02/29/2016 - 20:24

I´m preaty noob at mcreator, could you explain me where to place the code?

 

Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So first thing you need
Mon, 02/29/2016 - 20:32

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.

Joined Feb 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
thx
Mon, 02/29/2016 - 20:33

thx

Joined Feb 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sorry for anoying you again,
Mon, 02/29/2016 - 21:45

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? :(

 

Joined Nov 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RE:Sorry for anoying you again,
Fri, 03/04/2016 - 02:01

@#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°)