Procedure attack

Started by Kapitan Polska on

Topic category: Advanced modding

Last seen on 13:09, 5. May 2021
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Procedure attack

How to do a procedure for the fact that a given mob dies immediately from a given item, and if it is not this item, it does not die and you have to fight it normally? If someone knows, I would ask for a photo

Last seen on 15:35, 27. Apr 2021
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hi everyone! For the first…
Tue, 04/27/2021 - 15:37

Hi everyone! For the first time in a long time, I feel I can confide in someone who understands yet proposes positive motivating advices and the newest approaches. I'm blessed I've found online therapy and search forward to each session as a new brilliant journey. It also implements tasks that are conducive to helping with the issues presented. I strongly recommend it online talk therapy to use for everyone!

Last seen on 22:39, 22. Aug 2022
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Nice, but is it really…
Fri, 05/14/2021 - 23:14

Nice, but is it really related? Come on.

Last seen on 14:48, 30. Jun 2021
Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hi, I don’t know if there is…
Sat, 06/05/2021 - 00:49

Hi, I don’t know if there is an existing procedure for the action you described, but you can try to write it yourself. Here are some tips:
 about instant kill - in 1.12 the / kill command works like this:
 

this.attackEntityFrom (DamageSource.OUT_OF_WORLD, Float.MAX_VALUE)

Simple and effective.
Or when hitting with a specific item, you can try the entity.setDead method.

Last seen on 14:48, 30. Jun 2021
Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I can also share my piece of…
Sat, 06/05/2021 - 00:59

I can also share my piece of code, but it does slightly different things, allows you to kill a mob with one hit with any object and does not take away damage to the object.
 

@Override
    public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase player) {
        if (player.worldObj.isRemote) {
            return false;
        }
        if (target.canAttackWithItem() && !target.hitByEntity(player) && !target.equals(player)) {
            target.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) player), target.getHealth());
            stack.damageItem(1, player);
            return true;
        }
        return false;
    }

soclikes.com

Last seen on 13:51, 8. Aug 2021
Joined Aug 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
public boolean…
Wed, 08/04/2021 - 08:15
public boolean attackEntityFrom(DamageSource par1DamageSource, float par2)
{
    if (isEntityInvulnerable())
    {
        return false;
    }
    else
    {
        aisit.setSitting(false);
        return super.attackEntityFrom(par1DamageSource, par2);
    }
}


Haven't played at an online casino yet? - Read some reviews. ---> You can see it here.