开启辅助访问     
收藏本站

站内搜索

搜索

Minecraft(我的世界)苦力怕论坛

[游戏相关] addon交易配方一键自定义网站

 发表于 2025-11-22 21:27:11 来自手机|显示全部楼层|阅读模式 IP:福建省
14铁粒
有没有用于基岩版addon的自定义一键生成配方表的json文本的网站或其他?类似于java这种https://www.gamergeeks.net/可以一键设置生成交易指令的网站

苦力怕论坛,感谢有您~
 发表于 2025-11-23 01:46:54 来自手机|显示全部楼层 IP:江苏省
文档
这个是官方文档,不过目前我也不知道有没有你说的那种工具,遂用ai写了一个
复制下面这一段,放到浏览器运行即可
  1. <!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Minecraft 配方 JSON 生成器</title><style>
  2.     body {
  3.       font-family: Arial, sans-serif;
  4.       margin: 2em;
  5.       background: #f9f9f9;
  6.       color: #333;
  7.     }
  8.     h1, h2 {
  9.       color: #2c3e50;
  10.     }
  11.     .container {
  12.       max-width: 800px;
  13.       margin: auto;
  14.       background: white;
  15.       padding: 2em;
  16.       border-radius: 8px;
  17.       box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  18.     }
  19.     .form-group {
  20.       margin-bottom: 1em;
  21.     }
  22.     label {
  23.       display: block;
  24.       margin-bottom: 0.5em;
  25.       font-weight: bold;
  26.     }
  27.     input, select, textarea {
  28.       width: 100%;
  29.       padding: 0.5em;
  30.       font-size: 1em;
  31.       border: 1px solid #ccc;
  32.       border-radius: 4px;
  33.     }
  34.     textarea {
  35.       height: 100px;
  36.       resize: vertical;
  37.     }
  38.     button {
  39.       padding: 0.75em 1.5em;
  40.       background: #3498db;
  41.       color: white;
  42.       border: none;
  43.       border-radius: 4px;
  44.       font-size: 1em;
  45.       cursor: pointer;
  46.     }
  47.     button:hover {
  48.       background: #2980b9;
  49.     }
  50.     .output {
  51.       margin-top: 2em;
  52.       background: #f1f1f1;
  53.       padding: 1em;
  54.       border-radius: 4px;
  55.       white-space: pre-wrap;
  56.       font-family: monospace;
  57.       border: 1px solid #ddd;
  58.     }
  59.     .hidden {
  60.       display: none;
  61.     }
  62.   </style></head><body><div class="container"><h1>🧱 Minecraft 配方 JSON 生成器</h1><p>填写下方信息,快速生成 Minecraft 食谱(配方)JSON!</p><form id="recipeForm"><!-- 基础信息 --><div class="form-group"><label for="recipeType">配方类型 *</label><select id="recipeType" required><option value="">请选择配方类型</option><option value="shaped">Shaped(有形状配方)</option><option value="shapeless">Shapeless(无形状配方)</option><option value="furnace">Furnace(熔炉配方)</option><option value="potion">Potion Brewing(药水酿造)</option><option value="smithing_transform">Smithing Transform(锻造升级)</option><option value="smithing_trim">Smithing Trim(锻造装饰)</option></select></div><!-- 通用字段 --><div class="form-group"><label for="inputItems">输入物品(用英文逗号分隔,如:minecraft:wood,minecraft:stick)*</label><input type="text" id="inputItems" placeholder="minecraft:oak_log,minecraft:stick" required></div><div class="form-group"><label for="outputItem">输出物品(格式:minecraft:item_id)*</label><input type="text" id="outputItem" placeholder="minecraft:oak_planks" required></div><!-- Shaped 配方特有 --><div id="shapedFields" class="hidden"><div class="form-group"><label for="pattern">图案(3x3,用空格和字符表示,如:ABC\nDEF\nGHI,每行不超过3个字符)</label><textarea id="pattern" placeholder="A B
  63. C D
  64. (每行用换行分隔,字符对应下方Key)"></textarea></div><div class="form-group"><label for="keyMapping">键位映射(格式:A=minecraft:wood,B=minecraft:stone,每行一个)</label><textarea id="keyMapping" placeholder="A=minecraft:oak_log
  65. B=minecraft:stick"></textarea></div></div><!-- Shapeless 配方特有 --><div id="shapelessFields" class="hidden"><div class="form-group"><label for="ingredientsOrder">原料顺序(可选,用逗号分隔,如不关心顺序可不填)</label><input type="text" id="ingredientsOrder" placeholder="minecraft:wood,minecraft:stone (顺序不影响)"></div></div><!-- Furnace 配方特有 --><div id="furnaceFields" class="hidden"><div class="form-group"><label for="furnaceType">熔炉类型(Furnace / Blast Furnace / Smoker,可选)</label><input type="text" id="furnaceType" placeholder="Furnace"></div></div><!-- Potion 配方特有 --><div id="potionFields" class="hidden"><div class="form-group"><label for="reagentItem">药剂材料(和输入分开,比如红石/烈焰粉,格式:minecraft:redstone)</label><input type="text" id="reagentItem" placeholder="minecraft:redstone"></div></div><!-- Smithing Transform 特有 --><div id="smithingTransformFields" class="hidden"><div class="form-group"><label for="baseItem">基础物品(将被保留属性的物品,如铁剑)</label><input type="text" id="baseItem" placeholder="minecraft:iron_sword"></div><div class="form-group"><label for="additionItem">添加物品(用来升级的物品,如钻石)</label><input type="text" id="additionItem" placeholder="minecraft:diamond"></div></div><!-- Smithing Trim 特有 --><div id="smithingTrimFields" class="hidden"><div class="form-group"><label for="trimMaterial">装饰材料(如:minecraft:iron_ingot)</label><input type="text" id="trimMaterial" placeholder="minecraft:iron_ingot"></div><div class="form-group"><label for="trimPattern">装饰图案(如:minecraft:tripwire_hook)</label><input type="text" id="trimPattern" placeholder="minecraft:tripwire_hook"></div></div><!-- 解锁条件(可选) --><div class="form-group"><label for="unlockContext">解锁条件(可选,如:AlwaysUnlocked、PlayerHasManyItems,留空则不设置)</label><input type="text" id="unlockContext" placeholder="AlwaysUnlocked 或 PlayerHasManyItems"></div><button type="button" onclick="generateRecipe()">🎯 生成配方 JSON</button><div class="form-group"><label>生成的配方 JSON:</label><div id="output" class="output">填写信息并点击生成...</div></div></form></div><script>
  66.     // 根据配方类型显示对应字段
  67.     document.getElementById('recipeType').addEventListener('change', function() {
  68.       const type = this.value;
  69.       const fields = ['shapedFields', 'shapelessFields', 'furnaceFields', 'potionFields', 'smithingTransformFields', 'smithingTrimFields'];
  70.       fields.forEach(id => {
  71.         document.getElementById(id).classList.add('hidden');
  72.       });

  73.       if (type === 'shaped') document.getElementById('shapedFields').classList.remove('hidden');
  74.       if (type === 'shapeless') document.getElementById('shapelessFields').classList.remove('hidden');
  75.       if (type === 'furnace') document.getElementById('furnaceFields').classList.remove('hidden');
  76.       if (type === 'potion') document.getElementById('potionFields').classList.remove('hidden');
  77.       if (type === 'smithing_transform') document.getElementById('smithingTransformFields').classList.remove('hidden');
  78.       if (type === 'smithing_trim') document.getElementById('smithingTrimFields').classList.remove('hidden');
  79.     });

  80.     // 生成配方 JSON
  81.     function generateRecipe() {
  82.       const type = document.getElementById('recipeType').value;
  83.       const inputItems = document.getElementById('inputItems').value.trim();
  84.       const outputItem = document.getElementById('outputItem').value.trim();
  85.       const unlockContext = document.getElementById('unlockContext').value.trim();

  86.       if (!type || !inputItems || !outputItem) {
  87.         alert('请至少填写配方类型、输入物品和输出物品!');
  88.         return;
  89.       }

  90.       let recipe = {
  91.         type: `minecraft:${type}_recipe`, // 通常格式,部分类型可能略有不同
  92.         description: {
  93.           identifier: `recipe:example/${type}_${Date.now()}`
  94.         },
  95.         tags: [],
  96.         input: inputItems.split(',').map(s => s.trim()),
  97.         output: outputItem
  98.       };

  99.       // Shaped
  100.       if (type === 'shaped') {
  101.         recipe.pattern = document.getElementById('pattern').value.trim().split('\n').filter(Boolean);
  102.         recipe.key = {};
  103.         const keyMappings = document.getElementById('keyMapping').value.trim().split('\n');
  104.         keyMappings.forEach(line => {
  105.           const [key, value] = line.split('=').map(s => s.trim());
  106.           if (key && value) recipe.key[key] = { item: value };
  107.         });
  108.       }

  109.       // Shapeless
  110.       if (type === 'shapeless') {
  111.         recipe.ingredients = inputItems.split(',').map(s => ({ item: s.trim() }));
  112.       }

  113.       // Furnace
  114.       if (type === 'furnace') {
  115.         recipe.input = inputItems.split(',').map(s => s.trim());
  116.         recipe.output = outputItem;
  117.         recipe.cooking_time = 200; // 默认
  118.         if (document.getElementById('furnaceType').value.trim())
  119.           recipe.type = `minecraft:${document.getElementById('furnaceType').value.trim()}_recipe`;
  120.       }

  121.       // Potion
  122.       if (type === 'potion') {
  123.         recipe.input = inputItems.split(',').map(s => s.trim());
  124.         recipe.reagent = document.getElementById('reagentItem').value.trim();
  125.         recipe.output = outputItem;
  126.       }

  127.       // Smithing Transform
  128.       if (type === 'smithing_transform') {
  129.         recipe.base = document.getElementById('baseItem').value.trim();
  130.         recipe.addition = document.getElementById('additionItem').value.trim();
  131.         recipe.result = outputItem;
  132.       }

  133.       // Smithing Trim
  134.       if (type === 'smithing_trim') {
  135.         recipe.base = inputItems.split(',').map(s => s.trim())[0]; // 假设第一个是基础物品
  136.         recipe.material = document.getElementById('trimMaterial').value.trim();
  137.         recipe.pattern = document.getElementById('trimPattern').value.trim();
  138.         recipe.output = outputItem;
  139.       }

  140.       // 解锁条件
  141.       if (unlockContext) {
  142.         recipe.unlock = unlockContext === 'AlwaysUnlocked' ? { context: 'AlwaysUnlocked' } : { context: unlockContext };
  143.       }

  144.       // 显示结果
  145.       document.getElementById('output').textContent = JSON.stringify(recipe, null, 2);
  146.     }
  147.   </script></body></html>
复制代码
Screenshot_20251123_014354_com.tencent.mobileqq.jpg
2#2025-11-23 01:46:54回复收起回复
苦力怕论坛,感谢有您~
回复

使用道具举报

本版积分规则

本站
关于我们
联系我们
坛史纲要
官方
哔哩哔哩
技术博客
下载
网易版
安卓版
JAVA
反馈
意见建议
教程中心
更多
捐助本站
QQ群
QQ群

QQ群

访问手机版

访问手机版

手机版|小黑屋|系统状态|klpbbs.com

| 由 木韩网络 提供支持 | GMT+8, 2026-2-3 08:45

声明:本站与Mojang以及微软公司没有从属关系

Powered by Discuz! X3.4