Mob that assists another mob

Published by Red Tofu on
Status
Resolved
Issue description

Mob thats pet to another mob like acting like a necromancer to say simply is a mob can follow another mob and help each other on attacking.

@SubscribeEvent public void necromancerDamage(LivingDamageEvent event) { if (event.getEntity() instanceof NecromancerEntity && event.getSource().getTrueSource() instanceof LivingEntity) { List<MobEntity> mobEntities = event.getEntity().world.getEntitiesWithinAABB(MobEntity.class, event.getEntity().getBoundingBox().grow(10)); Iterator iterator = mobEntities.iterator(); while (iterator.hasNext()) { MobEntity mobEntity = (MobEntity) event.getEntity(); if (mobEntity.isEntityUndead()) { mobEntity.setAttackTarget((LivingEntity) event.getSource().getTrueSource()); } } }

This will make all undead mob will attack who that attack the necromanccer

This is just a example i want it to also follow each other and attack even Thier master is  not attacked/attacked. Too

 

Issue comments

This is very specific request, and therefore can't be added in such form.

There can be a procedure block set attack target of <entity> added, but open a separate specific request for this.

The global trigger for damage event already exists, so do checks and entity in range procedures.