Plugin seen as non-mod

I just started making a plugin and I noticed my mod was not being loaded when I started Minecraft:

[01:46:32] [Client thread/INFO] [FML]: FML has found a non-mod file GymProject-1.0.0.jar in your mods directory. It will now be injected into your classpath. This could severe stability issues, it should be removed if possible.

I googled around for a bit and the answer I seem to have gotten was that it was version incompatability, but I am under the impression that it is fine? According to docs, API 7.2 is made for Forge 1.12.2.

This is my Gradle build:

plugins {
    id 'java'
    id 'org.spongepowered.plugin' version '0.9.0'
    id "de.schablinski.activejdbc-gradle-plugin" version "1.2"
}


// This may not be required, but has solved issues in the past
compileJava.options.encoding = 'UTF-8'

// TODO: Change the following to match your information
group = 'com.gym'
version = '1.0.0'
description = 'Gym Leader Plugin for Pixelmon'

repositories {
    jcenter()
}

dependencies {
    compile 'org.spongepowered:spongeapi:7.2.0'
    compile 'org.javalite:activejdbc:2.2'
}

My forge version is 1.12.2-14.23.5.2838. I am using Eclipse and Gradle and using the build button to assemble my project.

image

I put the jar file into mods folder and thought that is all I need to do. For extra reference I will also include my main class.

package GymProject;

import org.spongepowered.api.plugin.Plugin;
import org.spongepowered.api.event.Listener;
import org.spongepowered.api.event.game.state.GameInitializationEvent;
import org.spongepowered.api.event.game.state.GameStartedServerEvent;
import org.javalite.activejdbc.Base;
import org.spongepowered.api.text.Text;

// Imports for logger
import com.google.inject.Inject;
import org.slf4j.Logger;

// Import packages
import commands.CommandBuilder;
import db_entities.*;

@Plugin(id = "GymPlugin", name = "Gym Leader Plugin", version = "1.0", description = "Gym Leader Plugin for Pixelmon")
public class GymMain {

    @Inject
    private Logger logger;

    public static void main(String[] args) {
    		// Open up DB
    		Base.open("com.mysql.jdbc.Driver", "jdbc:mysql://localhost/test", "user1", "xxxxx");
    	}

    
    @Listener
    public void onServerStart(GameStartedServerEvent event) {
        logger.info("GymPlugin is running.");
    }
    
    @Listener
    public void onInitialization(GameInitializationEvent event) {
    	// Test DB, delete later
    	new GymLeader().set("id", "123").saveIt();
    	
    	CommandBuilder.buildCommands(this);
    }

}

To go even further, I was decompiling my previous projects since I lost my code and I realized I did not have mcmod.info on the newer project like I do the old one. This is perhaps making me think that maybe I am not building this correctly.

Please let me know if I am making a dumb mistake or something.

EDIT
Here is the full log file:

And report given by my friend:

https://hastebin.com/eqesawuxeb.http

You are correct that 7.X is for 1.12.2.
The mcmod.info file will not prevent the boot of your plugin, however you will get a message saying “this is fine for testing purposes”. In API 7, for a plugin to boot it requires Sponge to boot (IE, not crash on startup) and any class needs the @Plugin annotation.

So while this may sounds stupid, but could you check that Sponge is actually loading as we can see your plugin has attempted to load via forge and thanks to you decompiling we can see you have the @plugin

To add some clarity, the code provided is what I am writing and not from what I decompiled. I have another mod that is loading up properly so I am assuming that means Sponge is loading but I could be incorrect. To go off what you said, do I just add @Plugin to every other class? Or do I just need the 1 as I am importing all the other classes internally and think that it shouldn’t require it.

If you also want, this current project is uploaded onto Github and I can PM you the link.

The @plugin goes on just your main class.
As for your code, sure shoot the github link, ill see if it works on my end

It would also be helpful if you can share the whole log. I believe that if the constructor for the plugin throws an exception on accident or such, sponge might not load it at all. A log will help prove that one way or another.

I edited my post to include the entire log file. Please let me know if you require any other details that could be helpful.

Why didnt I think of that before. Thanks @d4rkfly3r

The issue is on your @plugin the “id” is not allowed uppercased letters

I have set it to be:

@Plugin(id = "gymplugin", name = "GymLeaderPlugin", version = "1.0", description = "Gym Leader Plugin for Pixelmon")

However, my issue still persists. I tried removing lower case from “name” as well as reducing the text size to no avail. Were you perhaps able to get it working on your end?

Yet to try it. Should be able to test in the next hour

Edit:
Tested. I have sent you a private message

1 Like