VariableMod

模组

· 作者 OrangeFaHTA

这个项目添加了一些变量,可以简化地图制作。

0 本站下载 0 关注 更新于 5 个月前

最新 1.0.0 · 1.21.8 · Fabric

一键开服(送7天)

Modrinth CurseForge GitHub

关于模组 / 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:name in any command or chat message — value is substituted automatically
  • Built-in variables v!: — coordinates, health, food, nickname, dimension, time, and more
  • Two variable types: text and number (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 ]

  1. 创建变量:/variable new hub 0 64 0
  2. 在命令中使用:/tp @s v:hub
  3. 在聊天中播报坐标:Я нахожусь на v!:x v!:y v!:z в v!:world
  4. 修改值:/variable edit hub 100 64 -200
  5. 创建数值型变量:/variable type lives number → /variable edit lives 3

[ EN ]

  1. Create a variable: /variable new hub 0 64 0
  2. Use it in a command: /tp @s v:hub
  3. Announce coordinates in chat: I'm at v!:x v!:y v!:z in v!:world
  4. Change the value: /variable edit hub 100 64 -200
  5. 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

俄语 • 英语

你是这个资源的作者?登录后可认领此资源。

评论 0

0.0
暂无评分
5 星
0
4 星
0
3 星
0
2 星
0
1 星
0
我的评分

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源