1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Help create my plugin random Chest

Discussion in 'Help' started by girlx189, Aug 15, 2018.

  1. girlx189

    girlx189 Spider

    Messages:
    10
    How to generate a chest on random cordinant?
    <?php

    namespace chest;

    use pocketmine\plugin\PluginBase;
    use pocketmine\command\Command;
    use pocketmine\command\CommandSender;

    class Main extends PluginBase{

    public function onEnable(){
    $this->getLogger()->info("[Chest]");
    }
    public function onCommand(CommandSender $sender, Command $command, $label, array $args){
    if($cmd->getName() == "chest"){
    $x = rand(1,100);
    $y = rand(80,100);
    $z = rand(1,100);
    $sender->getServer()->broadcastMessage("[Chest] create random chest cordinants : ( X -> $x ) ( Y -> $y ) ( Z -> $z ) ")

    }

    }
    }
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.