Class ConfigLoadedEvent
java.lang.Object
net.neoforged.bus.api.Event
org.moddingx.libx.event.ConfigLoadedEvent
public class ConfigLoadedEvent
extends net.neoforged.bus.api.Event
Fired whenever a
LibX config is loaded. Is fired on both client and server.
The event is not cancelable.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumA reason for a config to load -
Constructor Summary
ConstructorsConstructorDescriptionConfigLoadedEvent(net.minecraft.resources.Identifier configId, Class<?> configClass, ConfigLoadedEvent.LoadReason reason, boolean clientConfig, Path configPath, Path currentPath) -
Method Summary
Modifier and TypeMethodDescriptionClass<?> Gets the class of the config that was loaded.net.minecraft.resources.IdentifierGets the id of the config that was loaded.Gets the path where the config is stored by default.Gets the path where the config is loaded from for this event.Gets the reason why the config was loadedbooleanGets whether the config is a client config.
-
Constructor Details
-
ConfigLoadedEvent
public ConfigLoadedEvent(net.minecraft.resources.Identifier configId, Class<?> configClass, ConfigLoadedEvent.LoadReason reason, boolean clientConfig, Path configPath, @Nullable Path currentPath)
-
-
Method Details
-
getConfigId
public net.minecraft.resources.Identifier getConfigId()Gets the id of the config that was loaded. -
getConfigClass
Gets the class of the config that was loaded. -
getReason
Gets the reason why the config was loaded -
isClientConfig
public boolean isClientConfig()Gets whether the config is a client config. -
getConfigPath
Gets the path where the config is stored by default. -
getCurrentPath
Gets the path where the config is loaded from for this event. For example, configs can be loaded per world. In that casecurrentPathwill be the path from the world andconfigPathwill be the default path for the config which might still be used for values not present in the world-specific config. The value isnullwhen the current config is loaded from a non-file location (for example on shadowing). It can also be the same asconfigPathwhen the config is loaded from the default path.
-