Hello I would like to have the base to code a plugin I already know how to make the message in the terminal, give items, rename items but I do not know how to put up the magnieres you give me in your answer like this: https://forums.pmmp.io/threads/put-an-enchantment-on-the-floor.6942/#post-58627 for example i would like to know how to use if and set up class Thanks
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.
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; } }
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: <?phpnamespace 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; } }