Dog-like mod

Started by mtus45 on Mon, 02/29/2016 - 19:36

Topic category: Help with modding

Last seen on 22:26, 1. Mar 2016
Joined Feb 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
Dog-like mod
Mon, 02/29/2016 - 19:36

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

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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());}}}}
              

Last seen on 22:26, 1. Mar 2016
Joined Feb 2016
User points:

User statistics:

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

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

 

Last seen on 22:26, 1. Mar 2016
Joined Feb 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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?

 

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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.

Last seen on 22:26, 1. Mar 2016
Joined Feb 2016
User points:

User statistics:

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

thx

Last seen on 22:26, 1. Mar 2016
Joined Feb 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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? :(

 

Last seen on 19:24, 17. Apr 2020
Joined Nov 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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°)