关于模组 / About the Mod
VariableMod 是一款适用于 Fabric 的客户端模组,为命令和聊天添加了变量系统。通过 /variable 创建变量,并使用 v:名称 语法将其插入到任何命令或消息中。内置变量 v!: 会自动解析玩家数据——坐标、生命值、昵称、时间等。
适用场景:命令自动化、动态公告、数据包命令模板、服务器大厅以及任何需要文本替换的场景。
VariableMod is a local-side Fabric mod that adds a variable system for commands and chat. Define variables via /variable and insert them anywhere using v:name syntax. Built-in variables v!: automatically resolve player data — coordinates, health, nickname, time, and more.
Use cases: command automation, dynamic announcements, datapack command templates, server hubs, and any scenario where text substitution is needed.
主要功能 / Key Features
[ RU ]
- 在游戏中通过
/variable new命令直接创建变量 - 在任何命令或聊天消息中使用
v:名称—— 值会自动代入 - 内置变量
v!:—— 坐标、生命值、饱食度、昵称、维度、时间等 - 两种变量类型:
text(文本)和number(数字,会校验数值类型) - 变量以 JSON 文件形式保存在世界文件夹中 —— 重启后依然保留
- 命令中支持变量名自动补全
- 支持在
/say、聊天消息以及所有被拦截的命令中使用
[ EN ]
- Create variables in-game via
/variable new - Use
v:namein any command or chat message — value is substituted automatically - Built-in variables
v!:— coordinates, health, food, nickname, dimension, time, and more - Two variable types:
textandnumber(number enforces numeric values) - Variables saved as JSON files in the world folder — persist across restarts
- Tab-completion for variable names in commands
- Works in
/say, chat messages, and any intercepted command
命令 / Commands
所有命令都需要操作员权限(等级 2)。 / All commands require operator permission (level 2).
| 命令 / Command | 描述 / Description |
|---|---|
/variable new <name> <value> |
创建变量 / Create a variable |
/variable edit <name> <value> |
修改变量值 / Edit a variable's value |
/variable delete <name> |
删除变量 / Delete a variable |
/variable type <name> text|number |
设置变量类型 / Set variable type |
/variable cfg <name> |
显示值和类型 / Show value and type |
/variable list |
列出所有变量 / List all variables |
/variable builtins |
列出内置变量 v!: / List built-in variables |
内置变量 / Built-in Variables
| 变量 / Variable | 描述 / Description |
|---|---|
v!:nickname |
玩家的显示名称 / Player's display name |
v!:name |
原始用户名(无格式) / Raw username |
v!:gamemode |
当前游戏模式 / Current game mode |
v!:world |
当前维度 / Current dimension |
v!:x / v!:y / v!:z |
方块坐标 / Block coordinates |
v!:health |
当前生命值 / Current health |
v!:food |
饱食度 / Food level |
v!:xp |
总经验点数 / Total experience points |
v!:level |
经验等级 / Experience level |
v!:time |
游戏内时间 时:分 / In-game time HH:mm |
v!:date |
真实日期 年-月-日 / Real-world date yyyy-MM-dd |
v!:day |
游戏内天数 / In-game day number |
v!:onlinecnt |
在线玩家数量 / Players online |
使用示例 / Example Workflow
[ RU ]
- 创建变量:
/variable new hub 0 64 0 - 在命令中使用:
/tp @s v:hub - 在聊天中播报坐标:
Я нахожусь на v!:x v!:y v!:z в v!:world - 修改值:
/variable edit hub 100 64 -200 - 创建数值型变量:
/variable type lives number→/variable edit lives 3
[ EN ]
- Create a variable:
/variable new hub 0 64 0 - Use it in a command:
/tp @s v:hub - Announce coordinates in chat:
I'm at v!:x v!:y v!:z in v!:world - Change the value:
/variable edit hub 100 64 -200 - Make a numeric variable:
/variable type lives number→/variable edit lives 3
支持的版本 / Supported Versions
| 版本 / Version | 支持情况 / Support |
|---|---|
| 1.21 — 1.21.8 | ✅ 支持 |
仅限 Fabric — 需要 Fabric API
数据存储 / Storage
[ RU ]
变量以 JSON 文件格式保存在世界文件夹中:
<world save>/variable/commands/v/<name>.json
在服务器停止运行时,可以手动编辑这些文件。
[ EN ]
Variables are saved as JSON files inside the world folder:
<world save>/variable/commands/v/<name>.json
Files can be edited manually while the server is stopped.
语言 / Language
俄语 • 英语
你是这个资源的作者?登录后可认领此资源。
相似资源
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
查看物品与配方
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
添加区块认领和玩家组队功能,并与 Xaero's Minimap 和 World Map 集成
添加全屏世界地图,显示你在世界中已探索的区域。与 Xaero's Minimap 搭配使用效果极佳。


评论 0
登录后参与评分
还没有评论,来抢沙发吧