Thanks very much for the reply it helped me a lot and I fixed the problem now and I'm sorry that you had to look at the terrible code I wrote.
I tried addressing the problems you mentioned. I now added comments to everything so it's not confusing anymore. I cleaned the code from all unused code, for example, the BASICI_ITEM line which wasn't supposed to be there.
But I still have a question: I'm currently using this project for testing code and then copy it into my real project. There my ModID is "gamechanger" and the reason why the other project has the short ModID "em" is that it is faster to type. So my question is: is there a specific reason why the ModID has to be long?