Solved Put player in spectator mode on death

Discussion in 'Plugin Development' started by voltywolty, Nov 20, 2021.

  1. Offline

    voltywolty

    Hey all. I'm currently trying to make it where the player gets put in spectator mode on death. I have it where if the damage is greater than the players health, it puts them in spectator mode using EntityDamageEvent. However, the problem with this is that it doesn't actually register the player as a kill for my game mode.

    The reason I want them to be put in spectator mode when they die is so when they respawn, they don't have to reload chunks entirely. Is there a better way of going about this?
     
  2. Offline

    pixelrider2000

    Why doesn't your plugin register the kill? EntityDamageEvent has a damage source, so there should be no problem finding out who killed the player. Tell me if I misunderstood you though ;)
     
  3. Offline

    voltywolty

    Like the death isn’t appearing in the chat, so I’m assuming it isn’t reading it as a kill.
     
  4. Offline

    Kars

    That is because you (presumably) canceled the damage event. So there is no death event.
    Just manually do whatever registers a kill for your plugin and also send the message in chat yourself.
     

Share This Page