I’m new to Fabric mod development and I’ve come across an interesting issue. I need a World instance for certain actions within my mod, but I don’t know how to get it. I tried the solutions for Forge but the class names are different and I can’t find the appropriate ones in Fabric. I also checked the wiki but they only write about creating custom worlds.
Is there a way of getting a world instance by the world’s name? Or just for getting the list of worlds?
There is no way to get any world instance on the client. This has 2 pretty obvious reasons:
You can however get a certain world instance: the client’s currently loaded dimension. You can access it via
MinecraftClient.getInstance().world, which points to a