Mineuniverse
Log in Register
Mods

Variable Commands

Allows use of variables in commands.
by coldlavalamp
Claim this project
288 downloads
0 likes
Updated Jun 30, 2026
0 hypes

This project is deprecated and will not be maintained or updated. Unless I feel like it. But I probably won't.

This is a server-side Fabric mod that adds variables to commands. You can set a value to a variable and reference it in any command.

 

To set a value to a variable: /var set <variable name> <value>

The value is always stored as text (a string), as commands are inherently text-based, but converted to a number as needed.

 

To reference a variable in a command, write $<variable>. e.g., /gamemode $my_mode

 

Variables can also be used in the 'if' execute subcommand e.g., /execute if var my_num = 5 run kill

You can also operate on variables: e.g., /var operation my_num + 13

 

FABRIC API REQUIRED

No files available for download.

More from coldlavalamp

Vertical Repeaters
8,371
Chromatic Blocks
8,223
Never Full
7,226
Easy Zillagers
618
No Beacon Beams
602
Linear XP
50,396

You Might Also Like

APTweaks: Items (11.x Classic)
Item clustering (fallen blocks, experience orbs, ...) and garbage cleanup.
9,884,514
VanillaDeathChest (Fabric)
Places containers when players die that contain their items.
994,762
Styled Nicknames
Simple, but configurable nicknaming mod allowing your server's players (and admins) to change their nickname with full formatting support
989,499
Tiquality
Make server lag the problem of the source player.
99,489
Blame (Fabric)
Those gosh darn crashlogs not saying which worldgen feature is crashing!
99,012
Weathering with You
Forecast Minecraft weather with a radar or a hat!
98,579