Skip to content

Commit

Permalink
add files by Yoan1680
Browse files Browse the repository at this point in the history
  • Loading branch information
royaljacques authored Feb 1, 2022
0 parents commit b0df328
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### a simple plugin for look id in pocketmine.
[join discord](https://discord.gg/hjbADqXRde)
<br>
```yaml
permission: "Use.Ids"
```
6 changes: 6 additions & 0 deletions plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: SimpleIds_AethTeam
version: 0.0.1
api: 4.0.0
main: Yoan1680\simpleIds\Loader
author: YoAn1680
permissions: {Use.Ids}
19 changes: 19 additions & 0 deletions src/Yoan1680/simpleIds/Events.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
namespace Yoan1680\simpleIds;
use pocketmine\event\Listener;
use pocketmine\event\player\PlayerItemHeldEvent;

class Events implements Listener{


public function onItemHeld(PlayerItemHeldEvent $event){
$player = $event->getPlayer();
if($player->hasPermission("Use.Ids")){
$item = $event->getItem();
$id = $item->getId();
$meta = $item->getMeta();
$name = $item->getVanillaName();
$player->sendActionBarMessage("§f[§6$id §f: §6$meta §f: §6$name §f]");
}
}
}
13 changes: 13 additions & 0 deletions src/Yoan1680/simpleIds/Loader.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
namespace Yoan1680\simpleIds;

use pocketmine\plugin\PluginBase;

class Loader extends PluginBase{
protected function onEnable(): void
{
$this->getServer()->getLogger()->info("SimpleIds à bien été activés !");
$this->getServer()->getLogger()->info("Permission de SimpleIds §a[Use.Ids]");
$this->getServer()->getPluginManager()->registerEvents(new Events, $this);
}
}

0 comments on commit b0df328

Please sign in to comment.