介绍
Craft items with commands !
Fully customizable command recipe mod!
For players
To craft, do /craft or /c, then put the recipe id. They will be suggested.
To check a recipe’s resources, do /seeRecipe, /resourcesFor or /sr, then the recipe id. They will be suggested.
For server owners
The recipe making system is really technical. Here is an exemple recipe :
{
"id": "normal:milk_bucket",
"result": {
"id": "minecraft:bucket",
"count": 1
},
"ingredients": [
{
"id": "minecraft:milk_bucket",
"count": 1
}
]
}
This takes a milk bucket and turns it into an empty bucket. It ignores the orginial bucket data.
Here is an exemple with the same bucket, but with a custom name (how to add minecraft data) :
{
"id": "normal:milk_bucket",
"result": {
"id": "minecraft:milk_bucket",
"count": 1,
"components": {
"minecraft:custom_name": {
"text": "",
"extra": [
{
"text": "M",
"color": "#424242",
"italic": false
},
{
"text": "i",
"color": "#818181",
"italic": false
},
{
"text": "l",
"color": "#C0C0C0",
"italic": false
},
{
"text": "k",
"color": "white",
"italic": false
}
]
}
}
},
"ingredients": [
{
"id": "minecraft:milk_bucket",
"count": 1
}
]
}
Then, you have the custom items, like this one :
{
"id": "osc:fixed_stab",
"result": {
"id": "custom:stab_fixed",
"extra": {}
},
"ingredients": [
{
"id": "minecraft:tnt",
"count": 500
},
{
"id": "minecraft:fishing_rod",
"match": {
"forbidden": [
"components.minecraft:custom_data.oc_type"
]
}
}
]
}
This does two things. First, the ‘custom:’ for the result item will be explained in the For developpers section. The ‘match’ is what is interesting here : ‘forbidden’ means that the ingredient should not have ‘components.minecraft:custom_data.oc_type’ (whatever it’s data is). If it was ‘required’, then the item would have to have this data. This is used to restrain which items can be used (here, don’t use orbitals fishing rods to craft other orbitals)
For developpers
Here, we’ll speak about our ‘custom:’ flag. It means the mod will take the other part of the id (for custom:myitem it will take myitem) and pass it to all executors registered. You register it by giving a modid and a BiFunction<Recipe.ResultContainer, ServerPlayerEntity, ItemStack> to the registerExecutor method in the Registry class. The result container gives you access to that id and the extra data (empty in our previous exemple) which can be used for extra customization, the player is the crafter and the itemstack is what you return (given to player).
The mod applies the recipe container to all mod’s functions and returns the first non-null stack found. So, if your executor recieves an unknown id, you should return null. To avoid duped id (where the same mod would return it’s stack, depending on who is first in the map), consider using somthing like custom:mymod_myitem. Avoid using two colons.
常见问题
CraftByCommand 支持哪些 Minecraft 版本?
CraftByCommand 支持 Minecraft Java 版 1.21.11,可用的加载器:Fabric。下载时注意选择和你游戏版本一致的文件。
CraftByCommand 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。
minheur2000 的其他作品
查看全部 →TechnoMastery
A Modpack based on Create
MinheurModding Bits’n’bobs
Craft spawn eggs, spawners and more !
Minheur’s cosmetics
Add craftable cosmetics in the game
WitherStorm Aventure
Just a way to install the wither storm mod with some other cool stuff
评论
登录后评论和评分