关于
你可以将 ModpackUtilities 视为你作为整合包开发者的工具箱。复制文件与文件夹、在世界加入时执行命令,以及更多即将推出的功能!这是一款简单实用的模组,助你逐步实现你一直梦想的整合包!
功能
复制文件与文件夹
类似于 Configured Defaults 或 Your Options Should Be Respected (YOSBR),此功能允许你将放入 copy 目录中的任何文件或文件夹复制到游戏目录下。
示例:
- 如果你想复制
options.txt 而不覆盖它,请将其放置在 /config/modpackutilities/copy/options.txt,它将最终出现在 /options.txt,即正确的位置!
- 现在假设你想在用户已有配置文件的情况下强制覆盖其配置。首先在配置中将
overwriteOnCopy 设置为 true,然后只需按照你希望它们在用户游戏目录中的样子放置文件和文件夹即可!例如,路径可能看起来像 /config/modpackutilities/copy/config/fancymenu,这最终会变为 /config/fancymenu。
你可以复制的文件和文件夹数量没有限制,完全取决于你的需求!无论你放入什么,都会被复制。
在世界加入时执行命令
顾名思义。在配置中,executionContext 决定了命令由谁执行。设置为 client 表示模拟玩家输入命令,而设置为 server 表示模拟从服务器控制台输入命令。请注意权限问题。
示例:
- 如果
executionContext 设置为 client,如果你尝试使用需要管理员权限的命令(如 /give),且玩家并非管理员,则命令会静默失败。
- 如果
executionContext 设置为 server,命令将以管理员身份执行,因此 /give 等命令可以正常工作。但是,由于无法通过经典的 @ 参数目标玩家,你可以改用特殊的 @player 来定位玩家。
executionFrequency 决定命令是在玩家每次加入世界时运行,还是仅在第一次加入时运行一次,之后不再运行。不需要例子 我希望如此。
commands 是你实际输入命令的地方。它们将从右向左依次执行,因此如果顺序重要,请牢记这一点。
它们必须以 / 开头,并且必须用双引号括起来,位于已有的方括号内。
示例:
"commands": ["/give @s minecraft:diamond 64", "/tell @player Hello world!"] 将首先运行 /tell 命令,然后运行 /give 命令。你可以注意到同时使用了 @s 和 @player。
如何配置此模组?
几乎所有配置都在 modpackutilities.json 中进行,该文件位于 /config/modpackutilities/modpackutilities.json。
按顺序,你会找到:
overwriteOnCopy: true 或 false
executionContext: client 或 server
executionFrequency: once 或 everytime
commands: 任何有效的 Minecraft 命令。可以使用 @player 获取玩家的用户名
享受吧 :)
About
You can think of ModpackUtilities as your toolbox as a modpack developer. Copy files & folders, execute commands on world join, and much more to come! A single, simple mod to help you make the modpack you've always dreamed of, one feature at a time!
Features
Copy files & folders
Kinda like Configured Defaults or Your Options Should Be Respected (YOSBR), this allows you to copy any file or folder you put inside the copy directory to the game's directory.
Example:
- If you want to copy the
options.txt without overriding it, place it in /config/modpackutilities/copy/options.txt and it will end up in /options.txt, right where it should be!
- Now let's say you want to overwrite the user's config even if he already has one. First set
overwriteOnCopy to true in the config, then simply put your files and folders however you want them to be inside the user's game directory! It could look something like /config/modpackutilities/copy/config/fancymenu that will end up in /config/fancymenu for example.
And there is no limit to the files and folders you can copy. It's up to your needs! Whatever you put will be copied.
Execute commands on world join
As the name suggests. In the config, executionContext will be from who the commands will be executed. client will make it as if the player typed the commands, and server will make it as if they were typed from the server's console. Keep in mind that permissions matter.
Example:
- If
executionContext is set to client, if you try commands like /give that require administrator permission and the player isn't one, thne the command will silently fail.
- If
executionContext is set to server, the commands will be executed as an administrator, so /give commands and others will work. However, since you can't target the player via the classic @ parameters, you can use a special @player one instead to target the player.
executionFrequency will run the commands either everytime the player joins the world, either once the first time, then never again. No example needed I hope.
commands is where you actually type the commands. They will be executed from right to left, so keep that in mind if order matters.
They have to start with a / and must be between double quotes, inside the already present square brackets.
Example:
"commands": ["/give @s minecraft:diamond 64", "/tell @player Hello world!"] will first run the /tell command, then the /give command. You can note the use of @s and @player together.
How do I configure this mod?
Almost everything happens in modpackutilities.json, which is located at /config/modpackutilities/modpackutilities.json.
In order, you'll find:
overwriteOnCopy: true or false
executionContext: client or server
executionFrequency: once or everytime
commands: any valid Minecraft commands. @player can be used to get the player's username
Enjoy :)
评论 0
登录后参与评分
还没有评论,来抢沙发吧