Draconic Evolution

Draconic Evolution

77M Downloads

Mod interaction with FlashNpc. Created Npcs cannot be killed/removed.

Tri-eDge17 opened this issue ยท 1 comments

commented

Combination of Draconic Evolution with related core libraries causes some issues with another mod im trying to get to work.
Even with these mods in question only, it does not work so im pretty sure its interaction with these mods entirely.
Capture
I am running on Forge version 36.2.26 but I've tried on 36.2.28 as well to no avail.

  • Created Npcs from said mod cannot be removed using intended method of using the NPC editor.
  • It cannot even be killed using the /kill command.

https://youtu.be/ljQo53MoorE

I've spoken to the developer of the FlashNpc mod and he says that he says he's basically triggerring a kill command when hit by the npc editor in creative mode, everything we did and can re-create with Draconic removed from the mod pool.

public class NpcEntity extends AmbientEntity {

  // ...

  @Override
  public boolean hitByEntity(Entity entityIn) {
    if (entityIn instanceof PlayerEntity) {
      PlayerEntity player = (PlayerEntity)entityIn;
      if (player.hasPermissionLevel(4) && player.isCreative() && player.getHeldItem(Hand.MAIN_HAND).getItem() instanceof NpcEditorItem) {
        this.onKillCommand();
      }
    }
    return true;
  }

  // ...
}

Other statements from him are as follows:

  • Draconic Evolution causes the method I mentioned here to not function properly. Checks go through but LivingEntity#onKillCommand doesn't kill the entity.
  • Only Draconic Evolution produces this behaviour, having purely CodeChickenLib and BrandonsCore doesn't.
  • Side note: NPCs can only be damaged by the Out Of World damage type, otherwise LivingDamageEvent is cancelled.
commented

This will be fixed in the next update. The issue is I have custom code in place to ensure the /kill command will work on players wearing DE armor. It works by detecting the Float.MAX_VALUE Out of World damage applied by the kill command and replaces it with my own damage source that can bypass my armor. But as FlashNpc can only be killed by out of world damage this means they will no longer die.

My solution is to only apply my bypass if the entity is wearing DE armor.