๐ŸŽฎ Event-Based Modding System

A simple and modular system for triggering game behavior using external .json mods.


๐Ÿ“ฆ System Overview

This system lets you define custom mod behaviors that respond to named events in your game, using external JSON files.


๐Ÿงฑ Core Components

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

๐Ÿ” Flow Example

Game Starts
โ†’ TriggerEvent("OnGameStart")
โ†’ ModManager finds matching mods
โ†’ Each mod is passed to ModAPI
โ†’ ModAPI executes the desired behavior

๐Ÿงฉ Example JSON Mod

{
  "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
}