Your issue seems to big. Can you try to simplify it and explain what exactly you need after so much discussion?
I still get the same issue as the the title, I don't know how to fix it and I've tried re-reading the links you have posted multiple times.
Load data using yaml_parse_file($file). Store data using yaml_emit_file($file). Don't assume you are using Config class. yaml_parse_file() returns an associative array. But I think using objects are better than using associative arrays. https://php.net/yaml
They've been telling you this whole time how to fix it. This: PHP: $this->mininglevel = $this->plugin->getDataFolder() . "mininglevel.yml"; defines your $this->mininglevel variable as a string. Note that the arrow (->) is only used when calling a variable or method inside an object. A string is not an object! This: PHP: $this->mininglevel = new Config($this->plugin->getDataFolder() . "mininglevel.yml"); defines your $this->mininglevel variable as a config object. Now you can use the arrow (->) to call the methods that you want. All config methods here: https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/utils/Config.php What is an object? http://php.net/manual/en/language.types.object.php What is a string? http://php.net/manual/en/language.types.string.php
Ignore the last 2 posts, now I'm getting a set() on integer error, Updated Mining.php: PHP: <?phpnamespace MCMMOPE\Skills;use pocketmine\Player;use pocketmine\plugin\PluginBase;use pocketmine\utils\TextFormat as c;use pocketmine\Server;use pocketmine\event\Cancellable;use pocketmine\event\Listener;use pocketmine\event\block\BlockBreakEvent;use pocketmine\utils\Config;use pocketmine\command\CommandExecutor;use pocketmine\command\CommandSender;use pocketmine\command\Command;use MCMMOPE\Loader;use pocketmine\entity\Effect;class Mining extends PluginBase implements Listener{ public function dataPath() { return $this->getDataFolder(); } public $mining; public function __construct(Loader $plugin){ $this->loader = $plugin; } public function getPlugin() { return $this->plugin; } public function onBreak(BlockBreakEvent $event){ $player = $event->getPlayer(); $name = $player->getName(); $this->PlayerFile = new Config($this->loader->getDataFolder()."Users/".$player->getName().".yml", Config::YAML); $data = $this->PlayerFile->get("MiningEXP"); if($event->getBlock()->GetId() == 1){ $data->set(+1); $this->PlayerFile->save();}} public function onCommand(CommandSender $sender, Command $cmd, $label, array $args){ if(strtolower($cmd->getName()) === "activate_mining"){ $dataFile = $this->loader->getDataFolder() . strtolower($sender->getName()); $name = $sender; if(is_file($dataFile)) { $data = yaml_parse_file($dataFile); $lastTime = $data["last-execute-command"][$cmd->getName()]; } else { $lastTime = 0; } if(time() - $lastTime < 5) { $sender->sendMessage("You execute too frequently!"); return true; }else if(time() - $lastTime > 5) { $sender->SendMessage("Skill Activated"); ##if($name->) ##$name->addEffect(Effect::getEffect(20)->setDuration($duration)->setAmplifier(1)); }$data["last-execute-command"][$cmd->getName()] = time(); yaml_emit_file($dataFile, $data); // handle command return true;}}}
What do you think you are doing? $data is the value for MiningXP. It is not a Config object, nor any reference to the config. If you are going to increment it, modify it normally like how you do with variables, and set() the new value into the config similar to how you get() it.