🧩 Modding System Overview

This system allows you to create .json files that define mods reacting to game events, triggering actions, and optionally referencing shared parameters.


📁 File Structure

pgsql
CopierModifier
/Mods
  ├── /Addons
  │   └── TeleportOnArrest.json
  └── /Parameters
      └── positions.json


🔁 Mod Execution Flow

  1. The game triggers an event like "OnPlayerArrested".
  2. ModManager.TriggerEvent("OnPlayerArrested") is called.
  3. All mods linked to this event are executed via ModAPI.TryExecute(...).
  4. The action is resolved from a registry and executed with the provided args.

📄 ModDefinition Example

json
CopierModifier
{
  "modName": "TeleportOnArrest",
  "eventName": "OnPlayerArrested",
  "action": "TeleportPlayer",
  "args": {
    "x": "@prisonX",
    "y": "@prisonY",
    "z": "@prisonZ",
    "chatMessage": "You have been arrested and moved."
  }
}


🧰 Common Args (args block)

Arg Name Type Description
x, y, z float Position/Scale/Rotation axis
chatMessage string Message to display in in-game chat
message string Log or console message
amount int or float Used for money, health, damage, etc.
soundName string Audio clip to play (not implemented yet)
targetPlayer int ID of the targeted player
delaySeconds float Delay before executing action (future feature)

📝 Note: Any value starting with @ (like "@prisonX") will be resolved from the global parameters.


📂 Parameter Example (/Mods/Parameters/positions.json)