Jump to content

1.7.10 Trouble spawning mob after certain health


NeoSup2130

Recommended Posts

 

 

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

Link to comment
Share on other sites

What doesn't work with the

onLivingUpdate

?

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.