Jump to content

Recommended Posts

Posted

 

 

public void onLivingUpdate(World world, int x, int y, int z)

    {

    if (!world.isRemote && this.getHealth() <= 15){

 

    EntityWolf ewolf = new EntityWolf(world);

    ewolf.setLocationAndAngles((double)x + 0.5D, (double)y + 3D, (double)z + 0.5D, 0.0F, 0.0F);

    world.spawnEntityInWorld(ewolf);

   

        }if (this.getHealth() <= 15){

        this.heal(0.5F);

    }

    super.onLivingUpdate();

    }

 

 

The title says it all

My mob has 25 health so there is no trouble with the getHealth

I have tried an other method 

.addPotionEffect(new PotionEffect(Potion.damageBoost.getId(), 30));

And it worked but not the one in the spoiler

So i'm asking if someone can help me with this problem

 

VampZ modder

Posted

Well,

I need an another method because onLivingUpdate. World, int x, int y, int z doesn't work. I have been excepting that already

I remember that there was a method called EntityUpdateTick or something

 

 

VampZ modder

Posted

I tried putting in the onLivingUpdate

World world, int x, int y, int z

That caused the method not to work, what i expected

 

I tried using worldObj :

 

 

EntityWerewolf entitywolf = new EntityWerewolf(worldObj);

entitywolf.copyLocationAndAnglesFrom(entitywolf);

worldObj.spawnEntityInWorld(entitywolf);

 

 

After i tested it, it still doesn't work

VampZ modder

Posted

acuatlly it makes sense because, i want it to spawn from the entity itself so if the "Real one"spawns the "Clone" it can retreat and the "Clone" can fight back

VampZ modder

Posted

So there's the problem i was using entity in another class and here i'm using entitywolf

but how can i set it like : entitywolf copy location from the spawner and not yourself

 

because in my other class i used entity instead of entitywolf

VampZ modder

Posted

Okay is used this method : entitywolf.setLocationAndAngles((double)2, (double)1, (double)2, 0, 0);

and i found out that it spawns the mob at 2, 1, 2

well that's a begin

 

... is there a way that game can check how many things it can spawn the mob with this code?

VampZ modder

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.