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

how to fix mapping values are not allowed in this context

Discussion in 'Plugin Help' started by Ayush, Mar 20, 2021.

  1. Ayush

    Ayush Witch

    Messages:
    62
    Hello,
    I am making a plugin and a error occurred
    I tried to fix it but it doesn't
    So I think to take help from pmmp forums because like u here alot of best devs in the world.
    So the error is:
    PHP:
    Could not load '/storage/emulated/0/Android/data/io.scer.pocketmine/files/PocketMine-MP/plugins/testing some more.phar' in folder '/storage/emulated/0/Android/data/io.scer.pocketmine/files/PocketMine-MP/plugins/'yaml_parse(): scanning error encountered during parsingmapping values are not allowed in this context (line 2column 8)
    2021-03-20 [15:16:59] [Server thread/CRITICAL]: ErrorException"yaml_parse(): scanning error encountered during parsing: mapping values are not allowed in this context (line 2, column 8)" (EXCEPTIONin "pmsrc/src/pocketmine/plugin/PluginDescription" at line 95
    And here is the code:
    PHP:
        public function onBlockBreak(BlockBreakEvent $event){
            
    $player $event->getPlayer();
            
    $block $event->getBlock();
            if(
    $block->getLevel()->getName("world")){
     
    /**Here is the error I think*/    if($block->getId() === Block::get(597)){
                    foreach (
    $event->getDrops() as $drop) {
                        
    $event->getPlayer()->getInventory()->addItem($drop);
                    }
                    
    $event->setDrops([]);
                    
    $player->addXp($event->getXpDropAmount());
                    
    $event->setCancelled();
                    
    $event->setXpDropAmount(0);
                    
    $block->getLevelNonNull()->setBlock($block->asVector3(), Block::get(Block::AIR));
                    
    $this->getScheduler()->scheduleDelayedTask(new DelayTask($this$block), 20);
                }
    If u able to fix this please help because I need this plugin so much.
    Thank u in advance:D
     
    minijaham likes this.
  2. Ayush

    Ayush Witch

    Messages:
    62
     
  3. Primus

    Primus Zombie Pigman

    Messages:
    749
    It states that your plugin.yml is malformed. Can you post it here?
     
    minijaham and Ayush like this.
  4. Ayush

    Ayush Witch

    Messages:
    62
    Yahi can
     
    minijaham likes this.
  5. Ayush

    Ayush Witch

    Messages:
    62
    PHP:
    name:true gate redo farm
    version
    1
    main
    aotgamer\Dungeon\Main
    api
    3.0.0
    Here is the plugin.yml
     
    minijaham likes this.
  6. Ayush

    Ayush Witch

    Messages:
    62
    Ohhhhhhhhh I forgot to add space after ":" in plugin.yml :oops:
     
    minijaham likes this.
  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.