VampireCommandFramework
Command framework for developers to easily create universal commands for their plugins.
Screenshots 1 screenshots
About this mod Author’s original text
VampireCommandFramework
A comprehensive framework for V Rising mod developers to easily build commands with advanced features like command overloading, history, smart matching, and plugin-specific execution.
Usage
For Server Operators
This plugin should be installed into the BepInEx/plugins folder and be kept up to date. It is required by other plugins for commands.
For Plugin Developers
How to use
- Add a reference to the plugin
dotnet add package VRising.VampireCommandFramework
- Add the plugin as a dependency by setting this attribute on your plugin class
[BepInDependency("gg.deca.VampireCommandFramework")]
- Register your plugin when you're done loading:
CommandRegistry.RegisterAll()
- Write commands
[Command("foo")]
public void Foo(ICommandContext ctx, int count, string orValues = "with defaults", float someFloat = 3f)
=> ctx.Reply($"You'd do stuff here with your parsed {count} and stuff");
This command would execute for:
-.foo 5
-.foo 5 works
-.foo 5 "or really fancy" 3.145
But if you typed.foo 5.123 you'd see a generated usage message like:.foo (count) [orValues="with defaults"] [someFloat=3]
This simple example provides
- Automatic help listings - your command appears in.help
- Parameter parsing - count, orValues, and someFloat are automatically converted
- Usage text generation - help shows (count) [orValues="with defaults"] [someFloat=3]
- Default parameter handling - optional parameters work seamlessly
- Type conversion - strings become integers, floats, etc.
More Examples
The framework handles these additional command patterns:
Command with parameters:
[Command("give")]
public void GiveItem(ICommandContext ctx, string item, int count = 1)
=> ctx.Reply($"Gave {count} {item}");
- Executes with:.give sword,.give sword 5
Command groups:
[CommandGroup("admin")]
public class AdminCommands
{
[Command("ban")]
public void Ban(ICommandContext ctx, string player)
=> ctx.Reply($"Banned {player}");
}
- Executes with:.admin ban PlayerName
Remainder Parameters
For commands that take free-form text (a message, a reason, a timezone ID), mark the final string parameter with [Remainder] to capture everything the user typed after the preceding arguments, with spacing and quotes preserved.
[Command("say")]
public void Say(ICommandContext ctx, string channel, [Remainder] string message)
=> ctx.Reply($"[{channel}] {message}");
-.say global hello everyone → channel = "global", message = "hello everyone"
-.say global "hello, friends!" → message = "\"hello, friends!\"" (quotes kept as typed)
Rules:
- Must be the last parameter. Violations are rejected at registration time.
- Must be of type string.
- Captures the rest of the raw input verbatim, including quotes, whitespace, and special characters.
- Can be optional with a default value: [Remainder] string reason = null.
- Parameters before the remainder are parsed normally: type conversion, defaults, and custom converters all still apply.
- Composes with overloading: the framework picks a remainder variant when enough preceding arguments are present.
Auto-generated.help output renders a remainder parameter as `, distinct from (name) for required and [name=default] for optional, so users get a visual cue for free, unless you supply a manual usage: string on [Command]`.
Command Overloading
You can now create multiple commands with the same name but different parameter types:
[Command("teleport")]
public void TeleportToPlayer(ICommandContext ctx, string playerName)
=> ctx.Reply($"Teleporting to {playerName}");
[Command("teleport")]
public void TeleportToCoords(ICommandContext ctx, float x, float y)
=> ctx.Reply($"Teleporting to {x}, {y}");
When there's ambiguity, players will be presented with options and can select using.1,.2, etc.
Middleware
All commands execute through a middleware pipeline. You can add your own middleware by implementing ICommandMiddleware and adding it to the CommandRegistry.Middlewares list.
Middleware is perfect for imple
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.
Install these first, or the mod will not work: