Skip to content

Instantly share code, notes, and snippets.

@PJZ9n
Created May 9, 2020 06:42
Show Gist options
  • Save PJZ9n/dc909956fba916de9329bbee4a1053ae to your computer and use it in GitHub Desktop.
Save PJZ9n/dc909956fba916de9329bbee4a1053ae to your computer and use it in GitHub Desktop.
<?php
declare(strict_types=1);
namespace a;
use pocketmine\command\Command;
use pocketmine\command\CommandExecutor;
use pocketmine\command\CommandSender;
class test implements CommandExecutor
{
public function onCommand(CommandSender $sender, Command $command, string $label, array $args): bool
{
switch ($label) {//まずは最初の部分( />slot< abc )で分岐
case "slot":
switch ($args[0]) {//次の部分で( /slot >abc< )で分岐
case "syouyu":
//適当な処理
return true;
case "yurisi":
//適当な処理
return true;
}
}
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment