MinecraftServer - getWorlds NoSuchMethodError
PoloLacoste opened this issue ยท 8 comments
I'm trying to create a simple mod that run on a FabricMC server. And I need to get all the worlds present, but I'm having an exception "NoSuchMethodError".
public class Main implements ModInitializer {
@Override
public void onInitialize() {
ServerLifecycleEvents.SERVER_STARTED.register(server -> {
server.getWorlds().forEach(world -> {
});
});
}
}
Thanks for your help !
Sorry !
I'm on a real server with Minecraft 1.16.3. Yes Fabric API is installed on the server.
Actually the exception occured on the server object when I call the function getWorlds
.
I tested the mod on a dev server and it's working just fine.
Will need some extra info here: is this a real server or in a dev environment, is fabric api installed on the server (since you are using an event from it), etc.
Some more information !
I'm trying to use a jetty server in the mod (it's for a server).
I tried to build the mod as a "fatJar" and when I do a get this error.
If I build the mod normally (without the "fatJar") I get an error from Jetty, telling me java.lang.ClassNotFoundException: org.eclipse.jetty.server.Server
.
Closing since this is not an issue with Fabric API and lack of feedback. If you need further assistance, please join the Fabric discord https://discord.gg/v6v4pMv