1.8.8 NPC Knockback

Discussion in 'Spigot Plugin Development' started by zVortexGG, Mar 30, 2020.

  1. Hi, Im making combattag plugin and I need velocity for NPC.

    Code:

    public Npc spawn(final Player player) {
    Npc npc = this.getSpawnedNpc(player.getUniqueId());
    if (npc != null) {
    return null;
    }
    npc = new Npc(this.plugin.getNpcPlayerHelper(), this.plugin.getNpcPlayerHelper().spawn(player));
    this.spawnedNpcs.put(player.getUniqueId(), npc);
    final Player entity = npc.getEntity();
    entity.setVelocity(entity.getVelocity().setY(1.1));
    }
     
  2. entity.getVelocity().multiply(-1);
     
  3. I still dont have knockback when I logout in Combat

    NPC spawns but have doesnt knockback and fall
     
  4. What exactly are you trying to do?? You cannot knockback à player if he is offline
     
  5. When player left in combat tag, spawn npc
     
  6. You current code doesn't spawn a NPC?
     
  7. It might. We need to see the `NPCPlayerHelper` class.
     
  8. No I want to edit the CombatTagPlus plugin, npc only..
    Its dont have knockback and dont fall
     
  9. Yeah but how are you spawning the NPC? Because you can't hit a "fake" entity