-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.php
70 lines (50 loc) · 1.85 KB
/
Main.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
namespace Gamemode\Steellgold;
use pocketmine\plugin\PluginBase;
use pocketmine\event\Listener;
use pocketmine\command\Command;
use pocketmine\command\CommandSender;
use pocketmine\Player;
class Main extends PluginBase implements Listener{
public function onEnable(){
$this->getLogger()->info("|--------------------------|");
$this->getLogger()->info("|-------By Steellgold------|");
$this->getLogger()->info("|----§aEasyGamemodeChange--|");
$this->getLogger()->info("|--------------------------|");
}
public function onCommand(CommandSender $player, Command $command, String $label, array $args) : bool {
switch($command->getName()){
case 'gm0':
$player->addTitle("§6Gamemode", "§fSurvial.");
$player->setGamemode(0);
$player->setHealth(20);
$player->setFood(20);
return true;
break; // gamemode 0
case 'gm1':
$player->addTitle("§6Gamemode", "§fSurvival");
$player->setGamemode(1);
return true;
break; // gamemode 1
case 'gm2':
$player->addTitle("§6Gamemode", "§fAdventure");
$player->setGamemode(2);
$player->setHealth(20);
$player->setFood(20);
return true;
break; // gamemode 2
case 'gm3':
$player->addTitle("§6Gamemode", "§fSpectator");
$player->setGamemode(3);
return true;
break; // gamemode 3
}
return true;
}
public function onDisable(){
$this->getLogger()->info("|--------------------------|");
$this->getLogger()->info("|-------By Steellgold------|");
$this->getLogger()->info("|----§cEasyGamemodeChange--|");
$this->getLogger()->info("|--------------------------|");
}
}