From 35f9fe6236cfd2f0c9597fbd742ea5c0d648b3b3 Mon Sep 17 00:00:00 2001 From: SleepSpace9 Date: Sun, 10 Dec 2017 23:56:08 +0100 Subject: [PATCH] fix for commands not working for playernames containing spaces (#111) --- src/slapper/Main.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slapper/Main.php b/src/slapper/Main.php index 7fde977..767c7f3 100755 --- a/src/slapper/Main.php +++ b/src/slapper/Main.php @@ -717,7 +717,7 @@ public function onEntityDamage(EntityDamageEvent $event) { if(isset($entity->namedtag->Commands)) { $server = $this->getServer(); foreach ($entity->namedtag->Commands as $cmd) { - $server->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", $damagerName, $cmd)); + $server->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", '"'.$damagerName.'"', $cmd)); } } }