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

ClassNotFoundException: "Class DanielYTK\Coder\code not found" error

Discussion in 'Development' started by DanielYTK, Feb 8, 2017.

  1. DanielYTK

    DanielYTK Zombie

    Messages:
    227
    ClassNotFoundException: "Class DanielYTK\Coder\code not found" (EXCEPTION) in "/src/spl/BaseClassLoader" at line 131
     
  2. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    You'll have to show us a bit more than that. If I were to guess, though, you made a mistake in your plugin.yml, declaring the namespace.
     
  3. DanielYTK

    DanielYTK Zombie

    Messages:
    227
    plugin.yml:
    Code:
     
    ---
    name: Admin
    author: DanielYTK
    version: 1.0
    api: [2.0.0]
    main: DanielYTK\Coder\code
    commands: 
        eadmin:
           description: "Entrar em modo admin"
           usage: "/eadmin"
           permission: admin.entrar
           aliases: [eadm]
        sadmin:
           description: "Sair do modo admin"
           usage: "/sadmin"
           permission: admin.sair
           aliases: [sadm]
    permissions: 
        admin.entrar:
          default: op
        admin.sair:
          default: op
    
    main:
    PHP:
    <?php
    namespace DanielYTK\Coder\code;

    use 
    pocketmine\command\CommandSender;
    use 
    pocketmine\command\Command;
    use 
    pocketmine\event\Listener;
    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\Server;

     use 
    pocketmine\Player;
     use 
    pocketmine\event\entity\EntityDamageByEntityEvent;
     use 
    pocketmine\event\entity\EntityDamageEvent;
     use 
    pocketmine\entity\Entity;

     use 
    pocketmine\utils\TextFormat as C;
     use 
    pocketmine\utils\Config;
     use  
    pocketmine\network\protocol\DisconnectPacket;
     use 
    pocketmine\Server\ConsoleCommandSender;
     use 
    pocketmine\inventory\PlayerInventory;
     use 
    pocketmine\inventory\Inventory;

     use 
    pocketmine\event\PlayerJoinEvent;
     use 
    pocketmine\event\PlayerQuitEvent;
     use 
    pocketmine\event\PlayerInteractEvent;

     use 
    pocketmine\item\enchantment\Enchantment;
     use 
    pocketmine\item\enchantment\EnchantmentEntry;
     use 
    pocketmine\item\enchantment\EnchantmentList;

     use 
    pocketmine\item\Item;

     use 
    pocketmine\math\Vector3;

     use 
    pocketmine\event\BlockPlaceEvent;


    class 
    code extends PluginBase implements Listener{} 
     
  4. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    Your main in plugin.yml is wrong, or your namespace is. The main should be the path all the way to the file, not just the directory it is in. The namespace should be all the folders from src the file is in.
     
  5. DanielYTK

    DanielYTK Zombie

    Messages:
    227
  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.