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

How to fix class not found?

Discussion in 'Plugin Help' started by GucktubeYT, Dec 29, 2019.

  1. GucktubeYT

    GucktubeYT Spider

    Messages:
    14
    GitHub:
    gucktubeyt
    Please how to fix class not found

    Plugin.yml code
    Code:
    name: BloodFX
    main: hoyinm14mc\bloodfx\BloodFX
    api: [3.0.0]
    version: 1.1.0
    author: hoyinm14mc & CyberCube-HK Team & updated by CupidonSauce173
    
    commands:
      bloodfx:
        usage: /bloodfx help
        permission: bloodfx.command
        description: Command of BloodFX
        aliases: ["blood", "bld"]
    
    permissions:
      bloodfx.command:
        default: op
        children:
          bloodfx.command.set:
            default: op
          bloodfx.command.reload:
            default: op
          bloodfx.command.get:
            default: op
          bloodfx.command.list:
            default: op
          bloodfx.command.on:
            default: op
          bloodfx.command.off:
            default: op
          bloodfx.command.help:
            default: op
    
    
    BloodFX.php Code
    PHP:
    <?php

    namespace hoyinm14mc\bloodfx;

    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\entity\Entity;
    use 
    pocketmine\math\Vector3;
    use 
    pocketmine\level\particle\DestroyBlockParticle;
    use 
    pocketmine\block\Block;
    use 
    hoyinm14mc\bloodfx\EventListener;
    use 
    hoyinm14mc\bloodfx\Commands;
    use 
    pocketmine\utils\Config;

    class 
    BloodFX extends PluginBase{

        private static 
    $instance null;

        public function 
    onEnable(){
            
    self::$instance $this;
            if(
    is_dir($this->getDataFolder()) !== true){
                
    mkdir($this->getDataFolder());
            }
            
    $this->saveDefaultConfig();
            if(
    $this->getConfig()->exists("v") !== true || $this->getConfig()->get("v") != $this->getDescription()->getVersion()){
                
    $this->getLogger()->info($this->colourMessage("&eUpdating configuration.."));
                
    unlink($this->getDataFolder() . "config.yml");
                
    $this->saveDefaultConfig();
            }
            
    $this->reloadConfig();
            
    $this->data = new Config($this->getDataFolder() . "data.yml"Config::YAML, array(
                    
    "entities" => array(
                            
    "chicken" => 152,
                            
    "cow" => 152,
                            
    "creeper" => 152,
                            
    "enderman" => 152,
                            
    "human" => 152,
                            
    "ozelot" => 152,
                            
    "pig" => 152,
                            
    "pigzombie" => 152,
                            
    "player" => 152,
                            
    "sheep" => 152,
                            
    "silverfish" => 152,
                            
    "skeleton" => 152,
                            
    "slime" => 152,
                            
    "spider" => 152,
                            
    "squid" => 152,
                            
    "villager" => 152,
                            
    "wolf" => 152,
                            
    "zombie" => 152
                    
    )
            ));
            
    $this->disabled = new Config($this->getDataFolder() . "disabled_players.txt"Config::ENUM, array());
            
    $this->getCommand("bloodfx")->setExecutor(new Commands($this));
            
    $this->getServer()->getPluginManager()->registerEvents(new EventListener($this), $this);
            
    $this->getLogger()->info($this->colourMessage("&aLoaded Successfully!"));
        }

        public function 
    colourMessage($msg){
            return 
    str_replace("&""ยง"$msg);
        }

        public static function 
    getInstance(){
            return 
    self::$instance;
        }

        public function 
    sprayBlood(Entity $entity$amplifier$name){
            
    $t $this->data->getAll();
            
    $amplifier = (int) round($amplifier 15);
            for(
    $i 0$i <= $amplifier$i ++){
                
    $entity->getLevel()->addParticle(new DestroyBlockParticle(new Vector3($entity->x$entity->y$entity->z), Block::get($t["entities"][$name])));
            }
            return 
    true;
        }

    }
    ?>

     
  2. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    Which class was not found? Please always paste the full error
     
  3. JviguyGamesYT

    JviguyGamesYT Baby Zombie

    Messages:
    113
    GitHub:
    jviguy
    Are You Getting
    [Server thread/ERROR]: Main class for plugin Bloodfx not found
    [21:48:47] [Server thread/CRITICAL]: Could not load plugin 'Bloodfx'
     
  4. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    This post is like half a year old
     
  5. JviguyGamesYT

    JviguyGamesYT Baby Zombie

    Messages:
    113
    GitHub:
    jviguy
    yeah lol im just looking whatever
     
  6. tokoyami ds

    tokoyami ds Spider Jockey

    Messages:
    25
    Hi

    Edit plugin.yml in line 2
    And fix the location main file
     
  7. Taco

    Taco Spider Jockey

    Messages:
    41
    GitHub:
    taconoburrito
    capitalization,
    hoyinm14mc\BloodFX\BloodFX
    Make Sure you have it like src/hoyinm14mc/BloofFX/BloodFX
    make sure main file is called BloodFX
     
  8. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    Hello, check plugin folder names, i guess there is wrong in file names?!;)
     
  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.