概述
此模组/数据包可在世界启动时执行任意命令
判定世界“已启动”的默认方式是:当玩家拾取任意原木时。
所有玩家完成该操作后,命令将被执行,你即可开始游戏!
使用方法
本包适用于整合包或其他项目,这些项目需要在能够正常游玩之前进行特殊设置。
你需要将所有希望执行的命令写入 data/world_start/functions 目录下的 setup.mcfunction 文件中。(将文件复制到桌面,编辑后替换原文件)
为何提供两个版本
我决定为此包制作两个独立的版本。一个非常简单易用,另一个则更花哨。花哨的版本会记录哪些玩家已经“启动”了世界,并在所有玩家完成后进行倒计时,然后“启动”世界。两者功能完全相同,只是根据个人偏好选择简单版还是花哨版。
如何自定义
你需要编辑包或模组以在其中写入命令。以下是详细的分步指南:
模组版本:
- 将模组文件的后缀从
.jar 改为 .zip。
- 按照数据包版本的说明进行操作。
- 完成后,将文件名改回
.jar。
数据包版本:
- 打开
.zip 文件,在 data/world_start/functions 下找到 setup.mcfunction。
- 将该文件复制到你的桌面(移出
.zip 压缩包)。
- 使用任何文本编辑器打开该文件。
- 你应该能看到命令
say setup complete。这是默认的示例命令。
- 对于花哨版本,它还有另外两条仅用于清除一些显示的命令。(请勿删除)
- 删除默认命令并将你需要的命令添加到文件中。不要包含斜杠
/。命令执行顺序为从上到下,但所有命令实际上同时发生。
- 所有命令编写完毕后,保存文件并将其放回
.zip 文件夹中。系统会询问是否替换旧文件,请选择是。
- 包已完成!现在只需将其加载到 Minecraft 中即可开始使用!
- 如果世界已经在运行,你需要执行
/reload 以使更改生效。
设置不同的启动条件
检测玩家是否开始游玩的方式是通过一个不可见的进度(advancement)。它会检测玩家是否获得了任意原木,并在获得时触发函数。当然,这也是可自定义的。如果你希望更改世界的启动方式,我建议阅读关于进度触发器的 wiki 页面。只需替换包中的 world_start 进度即可。
其他
当然,你可以在你的整合包中使用此包。请随意根据你的喜好编辑并包含它。我只是不希望你在只做微小改动后就发布这个确切版本并声称是你自己的作品。
该数据包在某些版本中标记为不兼容,但它应该仍能正常工作。
Overview
This Mod/Datapack can execute any command on starting a world
The default way of the world counting as "started" is, when a player picks up any wooden log.
Once all players have done so, the commands get executed and you're ready to play!
Usage
This pack is intended to use for modpacks or other projects where a special setup has to be done before being able to properly play.
All commands which you want to have executed have to be written in the "setup.mcfunction" under data/world_start/functions. (Copy the file onto desktop, edit it, replace old one)
Why two versions
I've decided to make two seperate versions of this pack. One, which is very simple and easy to use and another, fancier version. The fancy version keeps track of who has already "started" and once all players did, it will count down and then "start" the world. The two function identically, it's just for personal preferrence if you like it simple or fancy.
How to customize
You will have to edit the pack/mod to write the commands into it. Here is a detailed step by step guide for this:
Mod version:
- Rename the mod file from .jar to .zip.
- Follow instructions for datapack version.
- Once you're done, rename it back to .jar
Datapack version:
- Open the .zip file and find the "setup.mcfunction" under data/world_start/functions .
- Copy the file onto your desktop (out of the .zip archive).
- Open the file with any text editor.
- You should find the command "say setup complete". This is the default example command.
- For the fancy version, it has two more commands, which just clear a few displays. (Do not remove)
- Delete the default command and add the commands you need to the file. Don't include the slash. Command execution order is the top command first and bottom one last. All happen at the same time though.
- Once all commands are written down, save it and place it back in the .zip folder. It will ask to if you wish to replace the old file which you do.
- The pack is done! Now you just have to load it into Minecraft and you're ready to go!
- If the world is already running, you will have to do /reload to apply the changes to the game.
Setting a different start
The way of detecting if a player has started to play is by an invisible advancement. It detects if the player has obtained any wooden log and gives a function if they have. This is of course also customizable. I recommend reading the wiki page about advancement triggers if you want to change the way the world starts. Just replace the "world_start" advancement in the pack.
Other
Of course you can use this in your modpack. Feel free to edit this to your liking and include it. I just dont want you to publish this exact version with one tiny change and claim it as your own.
The datapack is marked as incompatible for some versions, but it should still work fine.
评论 0
登录后参与评分
还没有评论,来抢沙发吧