No-PvP regions blocking players' ability to hit NPCs

Discussion in 'WorldGuard' started by Momonche, Jul 11, 2018 at 7:40 AM.

  1. Momonche

    Momonche New Member

    Hello,

    Disabling PvP in a World guard region also removes players' ability to hit NPCs that are Sentinels.
    We first reported this issue to Sentinel, but they headed us back to you :
    https://github.com/mcmonkey4eva/Sentinel/issues/249

    Please note that Sentinels are still able to normally hit players, but players can't fight back.

    This is a very urgent issue for any roleplay server using NPCs to fight, since we obviously don't want players to kill each other, but we want them to be able to attack NPCs.

    (disabling PvP by other means doesn't work either)

    Thank you.
  2. PseudoKnight

    PseudoKnight Well-Known Member Developer

    I don't contribute code to WG, but to be clear, the issue is caused by the plugin that is breaking the API, not the plugin that is simply using the API as documented. Those issues are even talked about in that thread, and it's something I've encountered difficulty with in my own plugins. The good news is WG does try and detect fake players using a few checks (like using brackets around the name of the NPC). However, in this case WG looks at the damager, not the damagee. The damager is a real player, so it handles it like a PVP event. This could probably be changed with an additional check for the damagee.

    In the mean time, I recommend avoiding fake players because they cause problems with all sorts of plugins in my experience. Use other types of NPCs, if you can. Otherwise you'll want to be prepared to handle issues like these, like making your own modifications to WG (and submitting a PR). Or you could just use something else to handle PVP specifically.