Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Open Chests
* Test opening inventories
* @name OpenInv
* @main aliuly\openinv\OpenInventory
* @version 1.0.0
* @api 1.12.0
* @description Test open inventory plugin
* @author aliuly
namespace aliuly\openinv{
use pocketmine\plugin\PluginBase;
use pocketmine\command\CommandExecutor;
use pocketmine\command\ConsoleCommandSender;
use pocketmine\command\CommandSender;
use pocketmine\command\Command;
use pocketmine\Player;
use pocketmine\command\PluginCommand;
class OpenInventory extends PluginBase implements CommandExecutor{
public function onEnable(){
$cmd = new PluginCommand("openinv",$this);
$cmd->setDescription("Open inventory demo");
public function onCommand(CommandSender $sender, Command $cmd, $label, array $args) {
if ($sender instanceof Player) {
$sender->sendMessage("Openning inventory");
return true;
$sender->sendMessage("Run in-game only");
return true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment