Variables
Server owners spend a surprising amount of time repeating coordinates, health values, and player names in commands. Variables is a server-side Fabric mod that fixes that annoyance by introducing a lightweight placeholder system. Define a value once, then drop it into any command or chat message and let the mod fill in the blanks. If you run a hub, a minigame network, or a small survival server with friends, this add-on quietly removes a lot of manual typing.
What Variables Actually Does
At its core, Variables lets you store text or numbers under a name and reference them with the v:name syntax. The mod scans commands and chat messages, finds those references, and swaps in the stored value before the command runs. Everything happens server-side, so vanilla clients can connect without installing anything.
On top of your own custom entries, the mod ships with built-in placeholders under the v!: prefix. These resolve live player data on the fly, which makes them perfect for dynamic messages that would otherwise need a plugin or a pile of scoreboard tricks.
Built-in placeholders worth knowing
- v!:nickname and v!:name for display and raw usernames
- v!:x, v!:y, v!:z for block coordinates, plus v!:world for the current dimension
- v!:health, v!:food, v!:xp, and v!:level for player stats
- v!:gamemode and v!:onlinecnt for quick server status checks
- v!:time, v!:date, and v!:day for timestamps and in-game day counters
Because these resolve per player, a single announcement command can greet everyone with their own coordinates and health without any extra logic.
Managing Your Own Variables
Creating an entry takes one command. Running /variable new hub 0 64 0 stores a spawn point under the name "hub," and from that moment /tp @s v:hub teleports you there. Editing works the same way with /variable edit, and /variable delete removes an entry you no longer need.
Two types are available: text and number. Switching a variable to the number type with /variable type enforces numeric values, which is handy for counters like lives or currency. Tab-completion suggests existing names as you type, and /variable list plus /variable builtins give you a quick overview of everything currently defined. All commands require operator permission at level 2.
Where the data lives
Every variable is saved as a JSON file inside the world folder at <world save>/variable/commands/v/<name>.json. That means values survive restarts and server migrations, and you can hand-edit files while the server is stopped if you prefer working outside the game.
For admins who like a tidy setup process, the foxygame.net launcher can install Variables for Minecraft in a single click, pulling the correct build straight from its add-on catalog so you never have to match file versions by hand.
Practical Use Cases
The obvious win is command automation. Datapack authors can build command templates that reference shared values instead of hardcoding coordinates, and hub servers can point every warp at one central variable that you update once. Dynamic announcements become trivial too: a scheduled /say can include v!:onlinecnt and v!:time so players always see fresh information.
Chat substitution works in the same way. Typing "I'm at v!:x v!:y v!:z in v!:world" in chat resolves to your real position before anyone sees it. The mod also intercepts commands like /say, so broadcasts benefit from placeholders without extra configuration.
Compatibility and Installation
Variables supports Minecraft 1.21 through 1.21.5 and runs exclusively on the Fabric loader, with Fabric API required. There is no Forge or NeoForge build, and since it is server-side, players on unmodded clients can join normally.
To install it, grab the mod file and drop it into your server's mods folder alongside Fabric API, then restart. If you want to download Variables without hunting through mirror sites, the foxygame.net launcher keeps it updated automatically and flags any version mismatch with your server before you launch. Client-side installation works too if you run a singleplayer world with Fabric.
Quick setup checklist
- Install Fabric for your server version and add Fabric API
- Place the mod jar in the mods folder and restart
- Grant yourself operator level 2 to use /variable commands
- Create your first entry and test it with a simple /say command
Final Thoughts
Variables is one of those small mods that changes how you write commands. It replaces repetitive typing with clean, reusable placeholders, handles live player data out of the box, and stores everything in readable JSON files you fully control. For Fabric servers on 1.21 to 1.21.5 that want dynamic chat and smarter command templates without a heavy plugin stack, it is an easy recommendation.