配方修改
这是什么?
这个模组本身不会执行任何操作,相反,它是一个供 整合包作者、数据包作者、其他模组开发者 或任何喜欢折腾的人使用的工具。 它允许你通过数据资源包中的 JSON 文件或 Java API,以简单的方式在运行时自动对任意类型的配方应用任意修改。
这意味着,你无需手动覆盖多个现有配方,而是定义一组配方修饰器(recipe modifiers),它们会在游戏启动时应用。这也意味着修改会应用于所有其他模组添加的任何配方,而不会因为多个模组尝试覆盖同一配方而导致任何不兼容或奇怪的问题。
一些示例:
例如,如果你想让所有按钮的配方都制作出 8 个按钮而不是仅仅 1 个,因为你认为否则按钮配方太坑了,你可以轻松地在几行 JSON 中实现!
{
"target_recipes": "#minecraft:buttons",
"modifiers": [
{
"type": "modify_result_item",
"function": "set_count",
"count": 8
}
]
}
其他用例包括,例如,如果某些模组的配方由于未正确使用标签(或者相关物品没有标准化的标签)而无法正确兼容,你可以轻松地使它们兼容 (无需手动覆盖每一个配方!万岁!)。
假设,例如,一个名为 "mod_xyz" 的模组在其配方中没有使用正确的铜粒标签,导致这些配方与其他模组的铜粒不兼容。 使用 Recipe Modification,你可以像这样修复它:
{
"target_recipes": {
"type": "namespace_equals",
"namespace": "mod_xyz"
},
"modifiers": [
{
"type": "add_alternative",
"ingredients": "mod_xyz:copper_nugget",
"alternative": {
"tag": "c:copper_nuggets"
}
}
]
}
我该如何使用它?
通常,与该模组交互的首选方式是通过 JSON 文件,但同时也提供了 Java API。
查看 JSON 语法文档 以获取有关如何编写这些 JSON 文件以及可以使用此模组做什么的更多信息。 还有一些(虽然无意义但能正常运行)测试修饰器,你可以从中获得灵感。
对于 Java API,只需查看 api 包,特别是 主 RecipeModification 类 中的方法。
更详细的说明和使用信息即将推出™。
如果你有任何问题或需要帮助,随时可以在 Discord 上联系我 或提交 GitHub Issue。
Recipe Modification
What is this?
This mod on its own doesn't do anything, instead, it's a tool for mod pack creators, data pack creators, other mod developers or anyone who likes tinkering. It allows you to automatically apply arbitrary modifications to any type of recipe at runtime in a simple way, either by using JSON files in a datapack or using the Java API.
This means, instead of manually overriding multiple existing recipes, you define a set of recipe modifiers, which are applied when the game is starting. This means that modifications are applied to any recipes added by all other mods as well, without causing any incompatibilities or weird issues in case of multiple mods overriding the same recipe.
Some examples:
For example, if you wanted to make it so that all button recipes create 8 buttons instead of just 1 because you think the button recipe is a scam otherwise, you can easily do that in just a few lines of JSON!
{
"target_recipes": "#minecraft:buttons",
"modifiers": [
{
"type": "modify_result_item",
"function": "set_count",
"count": 8
}
]
}
Other use cases would be, for example, if some mod's recipes are not properly compatible because they don't utilise tags correctly (or there are no standardised tags for the relevant items), you can easily make them compatible (without having to manually override every single recipe! yay!).
Say, for example, a mod named "mod_xyz" doesn't use the right tag for copper nuggets in their recipes, which makes these incompatible with copper nuggets from other mods. Using Recipe Modification, you can fix it like this:
{
"target_recipes": {
"type": "namespace_equals",
"namespace": "mod_xyz"
},
"modifiers": [
{
"type": "add_alternative",
"ingredients": "mod_xyz:copper_nugget",
"alternative": {
"tag": "c:copper_nuggets"
}
}
]
}
How can I use this?
Generally, the preferred way to interact with this mod is via JSON files, however, there is also a Java API available.
Check out the document about JSON Syntax for more information on how to write these JSON files and what you can do with this mod. There are also some (nonsensical, but working) test modifiers that you can take inspiration from.
For the Java API, just take a look at the api package, especially the methods in the main RecipeModification class.
More detailed instructions & usage information coming soon™.
If you have any questions or need help, always feel free to message me on discord or open a GitHub issue.
下载 Recipe Modification library
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Recipe Modification library
下载 Recipe Modification library
下载 Recipe Modification library
下载 Recipe Modification library
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Recipe Modification library
下载 Recipe Modification library
下载 Recipe Modification library
下载 Recipe Modification library
下载 Recipe Modification library
移植到 26.1.2。无其他更改。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
AE2:一款流行的自动化与存储模组
评论 0
登录后参与评分
还没有评论,来抢沙发吧