What You’ll Build
In this quickstart, you’ll create a simple but functional Dalamud plugin that:- Registers a custom slash command (
/hello) - Displays a configuration window using ImGui
- Sends messages to the game chat
- Demonstrates proper plugin lifecycle management
This guide assumes you’ve already completed the Installation setup. If not, do that first!
Step 1: Create the Plugin Class
Every Dalamud plugin must implement theIDalamudPlugin interface. This is the entry point for your plugin.
Understand the Code
Let’s break down what’s happening:
Dalamud automatically injects services into your constructor. These are the APIs you’ll use to interact with the game.
This registers the
The
Critical: Always clean up registered commands, event handlers, and windows in
Service Injection (Constructor)
Service Injection (Constructor)
IDalamudPluginInterface: Core interface for plugin metadata, configuration, and UIICommandManager: Registers custom slash commandsIChatGui: Sends messages to the game chat
Command Registration
Command Registration
/hello command. When a player types it, the OnCommand method is called.UI System
UI System
WindowSystem manages all windows in your plugin. You hook into Dalamud’s draw loop to render your UI.Resource Cleanup (Dispose)
Resource Cleanup (Dispose)
Dispose(). This allows hot-reloading during development.Step 2: Create the Configuration Window
Now let’s create the UI window that appears when you run/hello.
Understand the Window Code
Window Properties
Window Properties
ImGuiCond.FirstUseEver means the size is only set on first display—users can resize it afterward.ImGui Drawing
ImGui Drawing
Draw() method is called every frame. Use ImGui functions to render UI elements:ImGui.Text()- Display textImGui.InputText()- Text input fieldImGui.Button()- Clickable buttonImGui.TextColored()- Colored text
Step 3: Build and Test
Load the Plugin In-Game
- Launch FFXIV via XIVLauncher (not the official launcher)
- Press
Escapeand click Plugin Installer, or type/xlplugins - Go to the Dev Plugins tab
- If your plugin isn’t listed, click Add and browse to
bin\Debug\ - Click Load next to your plugin
Test the Command
In the game chat, type:You should see:
- A chat message: “Hello from your plugin!”
- Your configuration window appears with a text input and clickable button
Step 4: Add Configuration Persistence
Let’s save the counter value so it persists between game sessions.What’s Next?
Congratulations! You’ve built a fully functional Dalamud plugin. Here’s where to go from here:Plugin Development Guide
Learn advanced plugin patterns and best practices
UI & ImGui
Master custom UI development with ImGui
Game Integration
Access player state, targets, and game data
IPC System
Enable inter-plugin communication
Common Patterns
Here are some useful patterns you’ll use frequently:Accessing Player Information
Handling Chat Messages
Querying Game Data
Troubleshooting
Plugin won't load
Plugin won't load
Check the logs:Type Common issues:
/xllog in-game or check:- Missing
IDalamudPluginimplementation - Constructor parameter types don’t match available services
- Exception thrown during initialization
Command doesn't work
Command doesn't work
Make sure:
- The command starts with
/ - You called
AddHandler()before the plugin finished loading - You’re not removing the handler too early
- The command name doesn’t conflict with existing commands
Window doesn't appear
Window doesn't appear
Verify:
UiBuilder.Drawevent is subscribedwindowSystem.Draw()is called in the handler- Window’s
IsOpenproperty is set totrue - No exceptions are being thrown in
Draw()
For more help, join the Dalamud Discord and ask in the
#plugin-dev channel!