A simple and modular system for triggering game behavior using external .json mods.
This system lets you define custom mod behaviors that respond to named events in your game, using external JSON files.
TriggerEvent(string)
)ModManager
ModAPI
.json
files in Mods/Addons/
Component | Description |
---|---|
ModManager |
Loads and stores all .json files, groups them by eventName |
ModDefinition |
One mod defined in JSON: action, parameters, event name |
ModAPI |
Executes the actual logic nammed โactionโ (teleport, print, healโฆ) |
TriggerEvent |
Called to trigger mods listening to a specific event |
Game Starts
โ TriggerEvent("OnGameStart")
โ ModManager finds matching mods
โ Each mod is passed to ModAPI
โ ModAPI executes the desired behavior
{
"modName": "SendToHospital",
"eventName": "OnPlayerDead",
"action": "TeleportPlayer",
"message": "You have been sent to hospital.",
"position": [5.0, 1.0, 3.0]
}
{
"modName": "ArrestedFine",
"eventName": "OnPlayerArrested",
"action": "TakeMoney",
"message": "You paid {amountInt} to the state.",
"amountInt": 1500
}