HMCL-docs/launcher/datapack.html
2026-03-15 12:44:04 +00:00

23 lines
9.2 KiB
HTML

<!doctype html><html lang="zh" class="no-js"><head><meta charset="utf-8"><title>数据包制作指南 - HMCL 文档</title><meta name="description" content="制作可以由 HMCL 导入的数据包"><meta property="og:type" content="article"><meta property="og:locale" content="zh"><meta property="og:site_name" content="HMCL 文档"><meta property="og:title" content="数据包制作指南"><meta property="og:url" content="https://docs.hmcl.net/launcher/datapack.html"><meta property="og:description" content="制作可以由 HMCL 导入的数据包"><meta property="article:published_time" content="2021-08-22T23:18:02+08:00"><link rel="canonical" href="https://docs.hmcl.net/launcher/datapack.html"><link href="/feed.xml" type="application/atom+xml" rel="alternate" title="HMCL 文档 Feed"><meta name="viewport" content="width=device-width, initial-scale=1.0"> <script> document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g, '') + ' js '; window.enable_copy_code_button = true; </script><link rel="stylesheet" href="/assets/css/main.css"><link rel="stylesheet" href="/assets/lib/fontawesome/css/all.min.css"> <noscript><link rel="stylesheet" href="/assets/lib/fontawesome/css/all.min.css"></noscript> <script src="/assets/js/settings.js"></script> <script src="/assets/js/theme.js"></script><link rel="shortcut icon" href="/favicon.ico"><link rel="stylesheet" id="skin"></head><body class="layout--document" dir="ltr"><nav class="skip-links"><ul><li><a href="#site-nav" class="screen-reader-shortcut">转到主导航栏</a></li><li><a href="#main" class="screen-reader-shortcut">转到内容</a></li><li><a href="#footer" class="screen-reader-shortcut">转到底部</a></li></ul></nav><div class="masthead"><div class="masthead__inner-wrap"><div class="masthead__menu"><nav id="site-nav" class="greedy-nav"> <a class="site-logo" href="/"><img src="/assets/img/hmcl.png" alt="HMCL 文档"></a> <a class="site-title" href="/"> HMCL 文档 </a><ul class="visible-links"><li class="masthead__menu-item"> <a href="/settings.html" >设置</a></li></ul><button class="greedy-nav__toggle hidden" type="button"> <span class="visually-hidden">切换菜单</span><div class="navicon"></div></button><ul class="hidden-links hidden"></ul></nav></div></div></div><div class="initial-content"><div id="main" role="main"><div class="sidebar sticky"><nav class="nav__list"> <input id="ac-toc" name="accordion-toc" type="checkbox" /> <label for="ac-toc">切换菜单</label><ul class="nav__items"><li> <span class="nav__sub-title">问题集合</span><ul><li><a href="/faq.html">常见问题</a></li><li><a href="/launcher/">启动器使用相关</a></li><li><a href="/modpack/">整合包帮助</a></li><li><a href="/multiplayer/">多人联机帮助</a></li></ul></li><li> <span class="nav__sub-title">使用者帮助</span><ul><li><a href="/launcher/isolation.html">版本隔离</a></li><li><a href="/launcher/offline-skin.html">设置离线皮肤</a></li><li><a href="/launcher/auto-installing.html">HMCL 的自动安装使用教程</a></li><li><a href="/launcher/shader.html">安装光影</a></li><li><a href="/launcher/set-item-details.html">设置项详解</a></li></ul></li><li> <span class="nav__sub-title">开发者帮助</span><ul><li><a href="/launcher/datapack.html" class="active">制作 HMCL 格式的数据包</a></li><li><a href="/modpack/serverpack.html">制作整合包</a></li><li><a href="/launcher/authlib-injector.html">添加默认 authlib-injector 验证服务器</a></li></ul></li><li> <span class="nav__sub-title">更新日志</span><ul><li><a href="/changelog/stable.html">稳定版</a></li><li><a href="/changelog/dev.html">开发版</a></li></ul></li><li> <span class="nav__sub-title">其他</span><ul><li><a href="/eula/hmcl.html">用户协议</a></li><li><a href="/contribution.html">贡献指南</a></li><li><a href="https://hmcl.huangyuhui.net">项目官网</a></li><li><a href="https://github.com/HMCL-dev/HMCL">项目仓库</a></li><li><a href="https://github.com/HMCL-dev/HMCL-docs">文档仓库</a></li></ul></li></ul></nav></div><article class="page" itemscope itemtype="https://schema.org/CreativeWork"><meta itemprop="headline" content="数据包制作指南"><meta itemprop="description" content="制作可以由 HMCL 导入的数据包"><meta itemprop="datePublished" content="2021-08-22T23:18:02+08:00"><div class="page__inner-wrap"><header><h1 id="page-title" class="page__title" itemprop="headline"> <a href="https://docs.hmcl.net/launcher/datapack.html" itemprop="url">数据包制作指南 </a></h1></header><section class="page__content" itemprop="text"><aside class="sidebar__right sticky"><nav class="toc"><header><h4 class="nav__title"><i class="fas fa-file-alt"></i> 目录</h4></header><ul class="toc__menu"><li><a href="#建议">建议</a></li><li><a href="#多数据包">多数据包</a></li><li><a href="#单数据包">单数据包</a></li></ul></nav></aside><img src="https://hits.zkitefly.eu.org/?tag=https%3A%2F%2Fdocs.hmcl.net%2Flauncher%2Fdatapack.html" alt="Hits" decoding="async"><div class="notice--info"><p>本文由 huanghongxun 创建。</p></div><p>本指南只介绍如何制作一个 HMCL 可导入的数据包压缩包。</p><h2 id="建议">建议</h2><p>始终建议你使用多数据包格式制作数据包压缩包,因为 HMCL 会删除重名的数据包,因此可以借此完成更新功能,只要直接导入新的多数据包格式的压缩包就可以完成更新你制作的数据包。</p><h2 id="多数据包">多数据包</h2><p>如果你的数据包被分离成多个部分供玩家选择是否启用,或者需要自带资源包,那么你需要制作多数据包格式的压缩包。</p><p>多数据包文件(只能是一个 <code class="language-plaintext highlighter-rouge">.zip</code> 文件)格式例子如下:</p><div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>crafting++.zip
\
* datapacks
|\
| * block_sky_domain (一个合法的数据包)
| * crafting_machine
| * craftingpp
| * tradepp
| * utilitypp
|
* resources.zip (如果你的数据包需要附带材质)
\
* assets
\
* ...
</code></pre></div></div><p>其中,<code class="language-plaintext highlighter-rouge">datapacks</code> 下的文件格式和 <code class="language-plaintext highlighter-rouge">.minecraft/saves/New World/datapacks</code> 的一样,因此可直接手动打包你本地的 <code class="language-plaintext highlighter-rouge">datapacks</code> 文件夹, 就可以直接导入 HMCL 了。如果还需要资源文件,请在压缩包内附带上。</p><p>此外,<code class="language-plaintext highlighter-rouge">resources.zip</code> 文件的格式和 <code class="language-plaintext highlighter-rouge">.minecraft/saves/New World/resources.zip</code> 的格式一样, 导入数据包时,启动器将会合并世界附带的默认资源包和你的数据包附带的资源包,如果有重复的文件,旧的文件将被覆盖。 如果你的服务器使用了包含资源包的数据包,那么请在服务器上完成这个操作,接着玩家下载服务器资源包即可。</p><h2 id="单数据包">单数据包</h2><p>如果你的数据包不需要资源文件,那么你直接打包 <code class="language-plaintext highlighter-rouge">datapacks/&lt;你的数据包名称&gt;</code> 文件夹,即可直接导入 HMCL。</p><p>单数据包文件(只能是一个 <code class="language-plaintext highlighter-rouge">.zip</code> 文件)格式例子如下:</p><div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>RealisticGlassPane.zip
\
* pack.mcmeta
* data
\
* 一些文件
</code></pre></div></div><p>HMCL 将会将你打包好的数据包压缩包直接复制到 datapacks 文件夹,不会解压(因为原版游戏支持读取压缩包)。</p></section><footer class="page__meta"><p class="page__date"><strong><i class="fas fa-fw fa-calendar-alt" aria-hidden="true"></i> 更新时间:</strong> <time class="dt-published" datetime="2021-08-22T23:18:02+08:00">2021-08-22</time></p></footer><nav class="pagination"> <a href="/launcher/authlib-injector.html" class="pagination--pager" title="Authlib-Injector 服务器设置指南">上一页</a> <a href="/launcher/isolation.html" class="pagination--pager" title="全局版本隔离">下一页</a></nav></div></article></div></div><div id="footer" class="page__footer"><footer><div class="page__footer-follow"><ul class="social-icons"><li><strong>关注:</strong></li><li><a href="https://github.com/HMCL-dev/HMCL" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-github" aria-hidden="true"></i> Github</a></li><li><a href="https://beian.miit.gov.cn" rel="nofollow noopener noreferrer"><i class="fas fa-link" aria-hidden="true"></i> 粤ICP备18071565号</a></li><li><a href="/feed.xml"><i class="fas fa-fw fa-rss-square" aria-hidden="true"></i> Feed</a></li></ul></div><div class="page__footer-copyright">&copy; 2026 <a href="mailto:hmcl@huangyuhui.net">huanghongxun</a>. 技术来自于 <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/jekyll-themes/minimal-mistakes/" rel="nofollow">Minimal Mistakes</a>.</div></footer></div><script src="/assets/js/main.min.js"></script> <script src="/assets/js/plugins/jquery.auto-redirect.js"></script></body></html>