Interface ModContext


@NonExtendable public interface ModContext
What ZomboidForge provides to one mod. Mods reach it through the methods of Mod; ZomboidForge implements it.
  • Method Details

    • id

      String id()
      The mod's id from mod.toml.
    • version

      String version()
      The mod's version from mod.toml.
    • gameVersion

      GameVersion gameVersion()
      The running Project Zomboid version.
    • logger

      System.Logger logger()
      Logger whose messages go into the Project Zomboid log, marked with the mod's id.
    • directory

      Path directory()
      The mod's folder, <forge>/mods/<id>.
    • config

      ModConfig config()
      The mod's settings from config.toml.
    • events

      Events events()
      Event listener registration.
    • main

      MainThread main()
      The server's main thread, for everything that touches game objects.
    • modThread

      ModThread modThread()
      The mod's own platform thread, zf-mod-<id>: one task at a time, in order.
    • async

      AsyncExecutor async()
      Virtual threads for blocking work such as HTTP calls or file I/O.
    • storage

      ModStorage storage()
      The mod's tables in the world's zomboidforge.db.
    • commands

      Commands commands()
      Admin command registration.
    • clientCommands

      ClientCommands clientCommands()
      Server commands to clients, received by their Lua mods.