[request] Keep inventory only when in pvp.

Discussion in 'Spigot Plugin Help' started by bobiaboia, Nov 21, 2020.

  1. Basically, a plugin that, whenever players die from another player, they keep their items. Its pretty frustrating sorting out players items after PvP. This is for my SMP, where people mess around and kill each other, but would still like the added difficulty of losing items due to natural deaths. Any help is appreciated. Thanks!
  2. Are you looking for a plugin that does this, or do you need help with the code?
    You could use a EntityDamageByEntityEvent() check if the entity is a player, and when the player’s health is 0 (The PlayerDeathEvent probably works as well). You could use setKeepInventory(true). And when they get killed by a normal entity setKeepInventory(false)
  3. I am looking for a plugin that does this.
    I am willing to make it on my own but i have no experience.
  4. I see, I have quite a lot of experience creating plugins. So I’ll be able to create it for you, contact me on discord, N1L8#9430.
  5. Ok thanks, I sent a friend request