What is Modding?
Friday Night Funkin’ features a powerful modding system that allows you to customize nearly every aspect of the game. From replacing assets to creating entirely new gameplay mechanics with scripts, the modding framework gives you extensive control over your game experience.Powered by Polymod
FNF uses Polymod, an atomic modding framework for Haxe games that provides asset replacement, merging, and scripting capabilities.
Polymod Architecture
The modding system is built on Polymod, a robust framework that handles:- Asset Loading: Automatic detection and loading of mod files from the
modsfolder - Asset Replacement: Override any game asset by placing a replacement in your mod
- Asset Merging: Append or merge data into existing text files
- Script Execution: Run custom HScript code to extend game functionality
- Mod Management: Load multiple mods with priority ordering
Core Components
The modding system consists of several key components:PolymodHandler
Main interface for loading and managing mods. Located in
funkin/modding/PolymodHandler.hxIScriptedClass
Interfaces defining callbacks for scripted classes. Located in
funkin/modding/IScriptedClass.hxModule System
Global scripts that receive events from any game state. Located in
funkin/modding/module/ScriptEvent System
Event dispatching system for scripts. Located in
funkin/modding/events/What You Can Mod
Assets
Replace or modify any game asset:- Images - Character sprites, backgrounds, UI elements
- Audio - Music, sound effects, voice lines
- Data Files - Charts, character data, stage configurations
- Text Files - Dialogue, intro text, credits
Gameplay
Modify game behavior with scripts:- Custom Characters - Create new characters with unique behaviors
- Custom Stages - Design new stages with interactive elements
- Note Types - Add new note mechanics
- Song Events - Create custom chart events
- UI Modifications - Change menus, HUD elements, transitions
Scripts
Write custom code using HScript:- Modules - Global scripts that run across all game states
- Scripted Classes - Extend base classes like FlxSprite, FlxState
- Event Handlers - React to gameplay events (notes, beats, state changes)
- Custom Logic - Implement entirely new mechanics
API Version
Friday Night Funkin’ uses semantic versioning for mod compatibility:api_version in their _polymod_meta.json file. The game only loads mods that match the version rule.
Mod Detection
Mods are loaded from themods folder:
- Windows/Linux
- macOS
- Mobile
_polymod_meta.json files.
Security & Sandboxing
For security, the modding system restricts access to sensitive functionality:- File System: Limited to sandboxed operations via
FileUtilSandboxed - Newgrounds API: Read-only access, no score/medal manipulation
- System Commands: No access to
Sys,cpp.Lib, native processes - Reflection: Restricted via
ReflectUtilto prevent blacklist bypass - Save Data: No direct score manipulation
Scripts cannot execute malicious code or access system resources outside the game’s sandbox.
Next Steps
Installing Mods
Learn how to install mods on your platform
Creating Mods
Start building your first mod
Scripting Guide
Write custom scripts with HScript
Polymod Deep Dive
Advanced Polymod features and techniques
