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

Can you explain to me the basics ???

Discussion in 'Development' started by Matrox, Nov 6, 2018.

  1. Matrox

    Matrox Slime

    Messages:
    92
    GitHub:
    MatroxMC
    Last edited by a moderator: Nov 6, 2018
  2. PHP

    PHP Creeper

    Messages:
    1
    Thanks for being interested in learning me, get started here
     
    corytortoise likes this.
  3. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    Start by learning PHP syntax. It'll help in the long run if you can resolve syntax errors yourself. Codecademy has a free PHP course, AFAIK. It'll make understanding the code easier.

    After that, try any of the large number of tutorials in the Plugin Resources section. Some aren't as useful as others, but they give you some good, easy to understand bits of info, including the basic plugin structure.
     
  4. Matrox

    Matrox Slime

    Messages:
    92
    GitHub:
    MatroxMC
    I already know the basic form of a plugin

    My simple plugins :

    <?php

    namespace Kit;

    use pocketmine\Server;
    use pocketmine\Player;
    use pocketmine\plugin\PluginBase;
    use pocketmine\command\Command;
    use pocketmine\utils\TextFormat;
    use pocketmine\command\CommandSender;
    use pocketmine\item\enchantment\Enchantment;
    use pocketmine\item\enchantment\EnchantmentInstance;
    use pocketmine\event\Listener;
    use pocketmine\item\Item;
    use pocketmine\block\Block;
    use pocketmine\event\player\PlayerInteractEvent;


    class Main extends PluginBase{

    public function onEnable(){

    $this->getLogger()->info(TextFormat::GREEN."Plugin Kit++ Activer");

    }

    public function onDisable(){

    $this->getLogger()->info(TextFormat::RED."Plugin Kit++ Désactiver");
    }


    public function onCommand(CommandSender $sender, Command $cmd, string $label, array $args): bool {
    switch ($cmd->getName()){
    case "kitminer";


    $sender->sendMessage(TextFormat::RED."Tu as recu ton kit miner !!!!");





    }

    return true;
    }


    }
     
  5. Matrox

    Matrox Slime

    Messages:
    92
    GitHub:
    MatroxMC
    :)
     
    TeraCube likes this.
  6. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    Only English allowed here. I want to be fair but I have one warning (expired) for using any language other than English.
    Use code blocks:
    PHP:
    <?php

    namespace Kit;

    use 
    pocketmine\Server;
    use 
    pocketmine\Player;
    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\command\Command;
    use 
    pocketmine\utils\TextFormat;
    use 
    pocketmine\command\CommandSender;
    use 
    pocketmine\item\enchantment\Enchantment;
    use 
    pocketmine\item\enchantment\EnchantmentInstance;
    use 
    pocketmine\event\Listener;
    use 
    pocketmine\item\Item;
    use 
    pocketmine\block\Block;
    use 
    pocketmine\event\player\PlayerInteractEvent;


    class 
    Main extends PluginBase{

        public function 
    onEnable(){

            
    $this->getLogger()->info(TextFormat::GREEN."Plugin Kit++ Activer");

        }

        public function 
    onDisable(){

            
    $this->getLogger()->info(TextFormat::RED."Plugin Kit++ Désactiver");
        }


        public function 
    onCommand(CommandSender $senderCommand $cmdstring $label, array $args): bool {
             switch (
    $cmd->getName()){
                case 
    "kitminer";


             
    $sender->sendMessage(TextFormat::RED."Tu as recu ton kit miner !!!!");

            
            
                    

             }

             return 
    true;
             }

          
     }
     
  7. Marabou

    Marabou Baby Zombie

    Messages:
    137
    GitHub:
    wiligangster
    NO ONLY ALL !
     
  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.