-
-
Save SOF3/384a72a79860fc8d3998d8f01ce7dfe1 to your computer and use it in GitHub Desktop.
ChatPopSound - Auto-generated gist plugin stub by pmt.mcpe.me InstaPlugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: ChatPopSound | |
author: PEMapModder | |
version: "1.0" | |
api: | |
- 1.12.0 | |
main: PEMapModder\ChatPopSound\Main | |
commands: [] | |
permissions: [] | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace PEMapModder\ChatPopSound; | |
use pocketmine\event\player\PlayerChatEvent; | |
use pocketmine\event\Listener; | |
use pocketmine\level\sound\PopSound; | |
use pocketmine\plugin\PluginBase; | |
class Main extends PluginBase implements Listener{ | |
public function onEnable(){ | |
$this->getServer()->getPluginManager()->registerEvents($this, $this); | |
} | |
public function onChat(PlayerChatEvent $event){ | |
$level = $event->getPlayer()->getLevel(); | |
foreach($this->getServer()->getOnlinePlayers() as $player){ | |
$level->addSound(new PopSound($player), $player); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment