Class ConfigLoadedEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
org.moddingx.libx.event.ConfigLoadedEvent

public class ConfigLoadedEvent extends net.minecraftforge.eventbus.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 Classes
    Modifier and Type
    Class
    Description
    static enum 
    A reason for a config to load

    Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event

    net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
  • Constructor Summary

    Constructors
    Constructor
    Description
    ConfigLoadedEvent(net.minecraft.resources.ResourceLocation configId, Class<?> configClass, ConfigLoadedEvent.LoadReason reason, boolean clientConfig, Path configPath, Path currentPath)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the class of the config that was loaded.
    net.minecraft.resources.ResourceLocation
    Gets 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 loaded
    boolean
    Gets whether the config is a client config.

    Methods inherited from class net.minecraftforge.eventbus.api.Event

    getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getConfigId

      public net.minecraft.resources.ResourceLocation getConfigId()
      Gets the id of the config that was loaded.
    • getConfigClass

      public Class<?> getConfigClass()
      Gets the class of the config that was loaded.
    • getReason

      public ConfigLoadedEvent.LoadReason getReason()
      Gets the reason why the config was loaded
    • isClientConfig

      public boolean isClientConfig()
      Gets whether the config is a client config.
    • getConfigPath

      public Path getConfigPath()
      Gets the path where the config is stored by default.
    • getCurrentPath

      @Nullable public Path getCurrentPath()
      Gets the path where the config is loaded from for this event. For example, configs can be loaded per world. In that case currentPath will be the path from the world and configPath will be the default path for the config which might still be used for values not present in the world-specific config. The value is null when the current config is loaded from a non-file location (for example on shadowing). It can also be the same as configPath when the config is loaded from the default path.