Soncresity Industries Wiki

Configuration Types

A list of configuration Types in the cnfg format for the Configuration API of SI: Essentials

Cnfg

CLIENT

The CLIENT configuration Type is mostly used for client-side settings that are not related to gameplay. (e.g. UI settings)

  • Will only generate on the client side in mcRoot/config/.
  • Configuration Instance will be null on dedicated servers.

Registering this type of config is recommended to be done in the Mod's client classes:

Fabric

MyModClient

MyModClient.java
public class MyModClient implements ClientModInitializer {
    @Override
    public void onClientInitialize() {
        MyCnfg.init();
    }
}

fabric.mod.json

fabric.mod.json
{
  "entrypoints": {
    "client": [
      "com.example.mymod.MyModClient"
    ]
  }
}

NeoForge

MyModClient

MyModClient.java
@Mod(value = MyMod.MODID, dist = Dist.CLIENT)
@EventBusSubscriber(modid = MyMod.MODID, value = Dist.CLIENT)
public class MyModClient {
    @SubscribeEvent
    static void onClientSetup(FMLClientSetupEvent event) {
        MyCnfg.init();
    }
}

COMMON

The COMMON configuration Type is used for general configurations that apply globally on a client and dedicated server.

  • Will generate in mcRoot/config/.
  • When a client joins a dedicated server, the configuration of the server will be used.

SERVER

The SERVER configuration Type is used for world-specific configurations that can be set for each world.
A configuration with the SERVER type will still be created on both the client and server, but only on world load!

  • Will generate in mcRoot/saves/<world>/ (Client) or <serverRoot>/<world>/ (Server).

Objt

Currently in development

On this page