Despawn Mob - Feature Request

Status
Fixed
Product/platform
Not applicable
Priority
Normal
Issue description

Hello everyone, it's me, TheGreatKingBoo_!

Today, i just wanted to do a quick suggestion for a thing that strangely hasn't been implemented yet (from what i know atleast): The "Despawn Mob" procedure element

Basically, it would just despawn the mob that has this element in his procedure, nothing too hard to understand!

Issue comments

I'm not sure if this is related but I did see something where you can banish the mob to another dimension. Could that be useful?

if you can't wait for the update here is the code for it :)

this one is for when you right click the mob with a specific item it will die V

if (entity.inventory.getCurrentItem() != null && entity.inventory.getCurrentItem().getItem() == mcreator_adogbiscuit.block) {
                if (entity instanceof EntityPlayer)
                    setDead();
            }

            return true;

 

(paste this under the ProcessInteract part)

 

And this one is for when a mob has existed for a certain amount of ticks it dies V

 

         @Override
public void onUpdate()
{
    super.onUpdate();

    if (this.ticksExisted >= 600)
    {
        this.setDead();
    }
}
 

(paste this under onStruckByLightning)

 

setDead() method is very problematic in the aspect of server-side mods. We have added set health procedure block instead. You will be able to use this block from 1.8.0 on. Use the set health block and set the value to 0.

For healing to max health it will be useful, but you would need a "get health" for adding specific amounts of health. Being able to do a negative amount of damage to an entity would give the se result though probably would need a totally different code. 



Donate to MCreator

By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. It is a free project made by developers working on it in their free time.