pmmp / PocketMine-MP

A server software for Minecraft: Bedrock Edition in PHP
https://pmmp.io
GNU Lesser General Public License v3.0
3.27k stars 1.55k forks source link

lots of things that should be done on death are done on respawn #1567

Open dktapps opened 6 years ago

dktapps commented 6 years ago

Issue description

Players can quit to title on death instead of respawning, and thereby evade things that should be done on respawn, such as removing effects, resetting hunger, resetting health, XP, etc etc...

xXRyzen commented 6 years ago

Not sure if this is related but a player noticed that when dying in any world via void(only been tested with void) the player respawns at hub in Creative mode, bypassing the set Survival GM in world config.

zKoz210 commented 6 years ago

Unfortunately, many players know about this bug. Any ideas how to fix it?

Muqsit commented 6 years ago

@zKoz210 that's the whole purpose of opening an issue - to know if someone has a good solution :p

eqMFqfFd commented 6 years ago

I'm also having problems with this and I lost a whole afternoon figuring out what's wrong until I remembered this issue. It's quite serious and needs a solution soon.

Sample

public function onPlayerQuit(\pocketmine\event\player\PlayerQuitEvent $event){
  $player = $event->getPlayer();
  if($player->getName() == "XxKenyGamerxX"){
    $player->kill();
  }
}

Before

After

jojoe77777 commented 6 years ago

@kenygamer assuming you mean that the items are still there, use

$player->kill();
$player->save();

as a workaround

eqMFqfFd commented 6 years ago

@jojoe77777 Not working.

eqMFqfFd commented 6 years ago

Should this fix the issue I was having?

dktapps commented 6 years ago

@kenygamer it fixes the exploits related to this issue, yes. The problem described in this issue still applies, but players can't exploit respawn loopholes to take advantage of it anymore.