Unknown Error

This is the first time I’ve developed a plugin using the Sponge API and I encountered this error when trying to test it;

Caused by: java.lang.ClassCastException: org.spongepowered.common.plugin.SpongeApiContainer cannot be cast to org.spongepowered.api.plugin.PluginContainer

Here is my main class; Main Class

What sponge server build are you running?
And we frown on using the full word Sponge in plugin names, unless it’s to do with the literal block Sponge or it’s a plugin that also has a Spigot version.

Good to know about the name thing, I had no idea.

Using Sponge Vanilla 1.8.9-4.2.0-BETA-352

That’s, uh, very much unsupported. API 6 is current stable and API 7 is current unstable. You might get some help with API 5. But API 4? Naw.

There are still servers that refuse to update. I was commissioned to make a plugin for 1.8.9, I figured I’d come here since I have no idea what that error means and googling it didn’t wield any results that were of help to me.

I see this github issue but I don’t know how to make a plugin without using the sponge api as a dependency.

Guess that means you have to update then.

Do you know what commissioning is?

What I’m saying is that the purpose of newer versions is to provide bugfixes that exist in older versions.
I did however misunderstand the original post. This is your testing version, I thought you meant it was the version that was being run as the server.
Now, the entire swath of 1.8.9 versions can’t possibly be completely unloadable, so a downgrade might work just as well.
But, no, you can’t make a Sponge plugin that doesn’t use the Sponge API. If the server owner already has a sponge server which works just fine, get the version he’s using and use that to test.

1 Like

What you can do (until updating to 1.10.2 or later) is remove the “spongeapi” dependency from the mcmod.info file. It’ll still load.

Oh, I misunderstood ‘dependency’ there. I thought you meant just as a general Java construct.