Skip to content

Instantly share code, notes, and snippets.

@PEMapModder
Last active November 12, 2016 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save PEMapModder/7ce437f0c66473711c6e to your computer and use it in GitHub Desktop.
Save PEMapModder/7ce437f0c66473711c6e to your computer and use it in GitHub Desktop.
ChatPopSound - Auto-generated gist plugin stub by pmt.mcpe.me InstaPlugin
---
name: ChatPopSound
author: PEMapModder
version: "1.0"
api:
- 1.12.0
main: PEMapModder\ChatPopSound\Main
commands: []
permissions: []
...
<?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