How would you go about counting how many blocks a certain player has broken. Like if player "x" broke 18 stone and wanted to check it then they could do /collection stone. How would i got about making the function to count player broken blocks.
You can make it so that the data saves in a config when they leave and loads then adds in an array when they join. and in the BlockBreakEvent, check if block is stone for example, then add one to their data every time they mine a block
It's discouraged to use a Config utility as a database. PHP: $data = (new Config($this->getDataFolder()."data.yml", Config::YAML))->getAll();// or$data = yaml_parse_file($this->getDataFolder()."data.yml"); It is not just about the length of the code, but using things as intended and avoiding unnecessary stuff.