EveryExport

模组

· 作者 qaptivator

将物品和配方数据导出为 JSON。

0 本站下载 0 关注 更新于 1 年前

最新 1.0.2 · 1.20.1 · Fabric

一键开服(送7天)

EveryExport (everyexport)

将物品和配方数据导出为 JSON 格式。

专为希望直接操作实际物品数据的爱好者设计,避免花费大量时间在网上寻找相关数据。

基于 Fabric 1.20.1 制作,较新版本或 Forge 版本可能短期内不会获得支持。
趣闻:这是我的第一个 Fabric 模组。(而且我意识到用 Java 编写代码真是痛苦得要命)

需要 Fabric API!!!

使用方法

/everyexport <type>,其中 type 可以是 all、items 或 recipes。
注:未来会添加更多导出选项。如果你现在非常急需某个功能,欢迎为本项目贡献代码并自行实现!这并没有你想象的那么难。

它会将每种类型的数据分别保存到一个独立的 JSON 文件中,位于 .minecraft/config/everyexport/<type>.json(或你的 Minecraft 实例所在目录)。
如需查看其使用的格式,请参阅下文。

更多信息请参见 GitHub 仓库中的 README.md

导出的数据格式

EveryExport 会在游戏目录的 config/everyexport/ 下生成结构化的 JSON 文件。以下是这些导出文件的结构文档。

1. 物品 (items.json)

导出的物品文件是一个字典,每个键对应物品的唯一 Minecraft ID(命名空间)。

各物品的属性:

  • id (String): 完整的物品标识符(例如 "minecraft:apple")。
  • namespace (String): 模组标识符(例如 "minecraft")。
  • path (String): 物品的系统名称(例如 "apple")。
  • translation_key (String): 游戏内部的翻译键。
  • display_name (String): 游戏中显示的名称。
  • max_stack_size (Integer): 单个物品栏位可容纳的最大数量。
  • max_durability (Integer): 最大耐久度(如果不可损坏则返回 0)。
  • is_damageable (Boolean): 该物品是否会损坏(如工具/护甲)。
  • is_fireproof (Boolean): 该物品是否抗火(如在岩浆/火焰中不燃烧,类似下界合金)。
  • recipe_remainder (String, Optional): 合成后留在网格中的剩余物品(例如空瓶子)。仅在适用时出现。
  • food (Object or Boolean): 如果物品可食用,则包含其营养统计信息;否则设为 false。
    • food_hunger (Integer): 恢复的饥饿值点数(1 点 = 半根鸡腿)。
    • food_saturation (Float): 饱和度修正值。
    • can_always_eat (Boolean): 即使饥饿条已满也能食用的物品设为 true。
    • fast_to_eat (Boolean): 快速消耗的物品(如干海带)设为 true。

items.json 示例

{
  "minecraft:honey_bottle": {
    "id": "minecraft:honey_bottle",
    "namespace": "minecraft",
    "path": "honey_bottle",
    "translation_key": "item.minecraft.honey_bottle",
    "display_name": "Honey Bottle",
    "max_stack_size": 16,
    "max_durability": 0,
    "is_damageable": false,
    "is_fireproof": false,
    "recipe_remainder": "minecraft:glass_bottle",
    "food": {
      "food_hunger": 6,
      "food_saturation": 0.6,
      "can_always_eat": true,
      "fast_to_eat": false
    }
  },
  "minecraft:diamond_sword": {
    "id": "minecraft:diamond_sword",
    "namespace": "minecraft",
    "path": "diamond_sword",
    "translation_key": "item.minecraft.diamond_sword",
    "display_name": "Diamond Sword",
    "max_stack_size": 1,
    "max_durability": 1561,
    "is_damageable": true,
    "is_fireproof": false,
    "food": false
  }
}

### 2. 配方 (recipes.json)
配方文件导出了注册表中所有活跃的配方。其结构会动态适配不同的配方格式(有形状网格合成、无形状合成或熔炉烹饪)。

#### 共享属性:
 * **id** *(String)*: 唯一的配方 ID。
 * **type** *(String)*: 系统配方类型(例如 `"minecraft:crafting_shaped"`)。
 * **group** *(String)*: 创意模式菜单中的配方组,如果有的话。
 * **output** *(Object)*: 配方的产出结果。包含:
   * **item** *(String)*: 产出的物品 ID。
   * **count** *(Integer)*: 产出数量。
 * **cook** *(Object or Boolean)*: 烹饪相关的属性(适用于熔炉/高炉/烟熏炉)。如果该配方不是烹饪配方,则为 false。
   * **time** *(Integer)*: 烹饪时间(以刻为单位)。
   * **experience** *(Float)*: 玩家获得的经验值。

#### 配方布局:
 * **如果 shaped 为 true(有形状网格配方):**
   * **width** & **height** *(Integer)*: 使用的合成台网格尺寸。
   * **pattern** *(Array of Strings)*: 合成台各行的视觉表示。
   * **key** *(Object)*: 将 pattern 中的符号映射到实际物品 ID 的字典。
 * **如果 shaped 为 false(无形状/烹饪配方):**
   * **ingredients** *(Array of Arrays)*: 原料列表,其中每个原料由一个可满足该槽位的合法物品列表表示。

#### recipes.json 示例
```json
{
  "minecraft:diamond_pickaxe": {
    "id": "minecraft:diamond_pickaxe",
    "type": "minecraft:crafting_shaped",
    "group": "",
    "output": {
      "item": "minecraft:diamond_pickaxe",
      "count": 1
    },
    "cook": false,
    "shaped": true,
    "width": 3,
    "height": 3,
    "pattern": [
      "###",
      " A ",
      " A "
    ],
    "key": {
      "#": { "item": "minecraft:diamond" },
      "A": { "item": "minecraft:stick" }
    }
  },
  "minecraft:pumpkin_pie": {
    "id": "minecraft:pumpkin_pie",
    "type": "minecraft:crafting_shapeless",
    "group": "",
    "output": {
      "item": "minecraft:pumpkin_pie",
      "count": 1
    },
    "cook": false,
    "shaped": false,
    "ingredients": [
      ["minecraft:pumpkin"],
      ["minecraft:sugar"],
      ["minecraft:egg"]
    ]
  },
  "minecraft:baked_potato": {
    "id": "minecraft:baked_potato",
    "type": "minecraft:smelting",
    "group": "misc",
    "output": {
      "item": "minecraft:baked_potato",
      "count": 1
    },
    "cook": {
      "time": 200,
      "experience": 0.35
    },
    "shaped": false,
    "ingredients": [
      ["minecraft:potato"]
    ]
  }
}

许可证

保留所有权利。

虽然你完全可以在整合包中使用此模组,但请在某处注明我的名字(不过你可能不会这么做,因为这个模组非常技术性,且主要仅供一次性使用)。

你是这个资源的作者?登录后可认领此资源。

评论 0

0.0
暂无评分
5 星
0
4 星
0
3 星
0
2 星
0
1 星
0
我的评分

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源