目前还没有模组能做到这一点,至少我没见过。这可能不太实用,但在我看来它很有用,特别是对于那些读过文档的人只需几分钟即可阅读。今天我介绍 Jcraft (Json Craft),这是一个用于在 Json 配置文件中利用 Fabric API 的模组/库。我觉得它有点鸡肋,但我不知道能做什么,于是就想到了这个点子。你可以用极少的编程就能添加方块和物品!当然,纹理除外,为此请使用资源包。我很快会解决这个问题,并且很快也会有改进!
使用方法
jcraft 在游戏目录中创建一个名为 'jcraft' 的文件夹,在这个文件夹内还有两个子文件夹 'blocks' 和 'items',在这些文件夹中添加 json 文件,文件名不重要,重要的是结构。对于物品来说,重要的是添加 name 和 namespace 值,你也可以添加 settings 等更多设置。一个 json 物品的示例如下:
{
"name": "myItem",
"namespace": "myMod",
"settings":{
"fireproof": true
}
}
fireproof: true 的值使其防火,而 name 和 namespace 配置基本值,如物品名称和命名空间(例如模组名称)。
如何添加方块
方块的情况类似,它们也有 name 和 namespace,除此之外,它们还包含 item 值,除了方块本身外,还会添加该方块的物品。在 settings 中最容易配置的是 parent,示例如下:
{
"name": "myBlock",
"namespace": "myMod",
"settings":{
"parent": "BEDROCK"
}
}
parent 的作用是继承已配置方块的配置,请务必使用大写字母,如本例中的 BEDROCK。
There is no mod that does this so far,at least I haven't seen any,
it may not be very useful but it seems to me that it is useful,
at least for those who have read the documentation WHICH ONLY TAKES A FEW MINUTES TO READ, today I present Jcraft (Json Craft) is a mod/library to be able to use the fabric API in Json configuration files, I would consider it a bit useless but I didn't know what to do so this occurred to me, you can add blocks and items with very little programming!, except the texture, for that use Texture Packs, I will soon solve that, and soon there will also be improvements!
How to use
jcraft creates a folder in the game directory called 'jcraft', inside this folder there are two other 'blocks' and 'items', inside these folders the json are added, it doesn't matter the name, the important thing is the structure, in the case For the items, the important thing is to add the values name and namespace, you can also add the settings and more, an example of json item would be:
{
"name": "myItem",
"namespace": "myMod",
"settings":{
"fireproof": true
}
}
with the value fireproof: true makes it fire resistant, while name and namespace configure the basic values, such as the item name and the namespace (such as the mod name)
How to add a block
Something similar happens with the blocks, these have the name and the namespace, but apart from that they also contain the item value that adds the item of the block in addition to the block itself, in settings the easiest thing to configure is the parent , An example:
{
"name": "myBlock",
"namespace": "myMod",
"settings":{
"parent": "BEDROCK"
}
}
The parent does what it inherits the configuration of the block that has already been configured, it is important to put it in capitals as in this case the BEDROCK
评论 0
登录后参与评分
还没有评论,来抢沙发吧