So the problem was that I had 2 projects, a core project and which is a mod and another project which is also a mod.
The second project needs the first mod to work so I added the "compile project(":NAME")" in the dependencies section of the second mod but when I run "gradlew build" on the second project it seems to compile the first core project as a normal java application jar and just skips every forge task, so I ran "build" on every project separately and it worked fine.
I don't know if that's a bug in ForgeGradle or what, but thank you!