11-05-2016, 09:11 PM
Your code is a total unreadable mess.
But the main issue I see is that you're opening a DB file and trying to read data from it, although you have no guarantee that the DB file even has the table you're reading. And it doesn't. When you open a file without any path, you're opening it in "current folder", which normally is right next to the Cuberite executable. The sqlite3 file that you have in your plugin folder doesn't get touched at all.
For testing purposes, you can manually fill the DB file next to the Cuberite executable with data. But for a well-behaved plugin, your code should, in its final version, check the file and do any adjustments (create tables, add missing columns) that it needs before further using that file.
But the main issue I see is that you're opening a DB file and trying to read data from it, although you have no guarantee that the DB file even has the table you're reading. And it doesn't. When you open a file without any path, you're opening it in "current folder", which normally is right next to the Cuberite executable. The sqlite3 file that you have in your plugin folder doesn't get touched at all.
For testing purposes, you can manually fill the DB file next to the Cuberite executable with data. But for a well-behaved plugin, your code should, in its final version, check the file and do any adjustments (create tables, add missing columns) that it needs before further using that file.