Where am I going wrong? look: PHP: public function aoEntrar(PlayerJoinEvent $ev){ $player = $ev->getPlayer(); $nick = $player->getName(); if(!$this->dados->exists($nick)){ $this->dados->set($nick, [ "Acrobacia" => [ "XP" => 0, "Level" => 0, ], "Espada" => [ "XP" => 0, "Level" => 0, ], "Mineracao" => [ "XP" => 0, "Level" => 0, ], ]); } $this->dados->save(); } and: (this is EntityDamageEvent) PHP: $cfg = $this->dados->getAll();if($ev->getDamage() >= 20){ $this->dados->set([$nick]["Acrobacia"]["XP"], $cfg[$nick]["Acrobacia"]["XP"] + 10); $entity->sendMessage("§eForam adicionados §a+10§e pontos a sua §aEXPERIÊNCIA §eem §aAcrobacia"); $this->dados->save(); return;
Is the event being called correctly? If it isn't, please share the code for the entire event listener.
It is not possible to set the value to [$ nick] ["Acrobat"] ["XP"], instead of setting the value in [$ nick] ["Acrobat"] [XP] Line ("") with its value
i dont think you can do ->set(["array"]["array2"],value) that's now how this config class works, you may need to build your own if you insist you need to use that method hint: read the config class, there's another way around but i aint telling you
use this in the EntityDamageEvent PHP: $this->dados->setNested($nick.".Acrobacia.XP", $cfg[$nick]["Acrobacia"]["XP"] + 10);