Jump to content

[1.14.3] Can't get player list on the server


Recommended Posts

Hello, I'm having an issue getting the player list server-side.
I am calling: ServerLifecycleHooks.getCurrentServer().getPlayerList()
But once I build the jar file and run it on a server, when the function gets called, it results in: java.lang.NoSuchMethodError: net.minecraft.server.MinecraftServer.getPlayerList()
I'm have tried multiple older versions of forge to no avail, I'm currently on the latest available build as of this post. (1.14.3-27.0.57)

Any help on the issue would be greatly appreciated! Thank You

Link to comment
Share on other sites

You are most likely correct having it being an issue related to building.
I am using a shadowJar as I require some external dependencies, which is something I've never touched until recently.
As far as I have learned, everything needs to be re-obfuscated including the dependencies but I'm probably doing something wrong in my build.gradle
Speaking of, if a copy of my build.gradle is required, would it be more convenient to send it as plain text or an attachment in a reply? Thanks

Link to comment
Share on other sites

Here you go: https://pastebin.com/JBKQ6pYC
There's probably many things wrong with it as I've been trying a lot of things for hours now.
Also, as this is a test mod as of now, I haven't named the mod yet so I'm currently using temporary names which is something I plan on changing as soon as it starts working.

Edited by FearsomePhobia
Link to comment
Share on other sites

I've resolved the issue, this is what I get for not properly researching into how shadowJar works and what Forge does when building a mod.
It turns out that I was previously having issues with executing 'build' so I executed 'shadowJar' which output a jar that loaded with only some features working. (super dumb mistake, I know)
Ever since I added that the build depends on shadowJar, I didn't even think to simply run 'buid' again.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

By using this site, you agree to our Terms of Use.