小天吖~ 发表于 2022-6-20 23:29:19

【资源包】玩家生命值显示 - 其他资源 - Minecraft(我的世界)苦力怕论坛

本人自制..技术力原因目前只显示玩家血量<br />后续会纳入全原版生物(除boss级)<br /><br />废话不说...效果图:<br /><br /><br />本人第一次发帖..<br />感谢观贴<a href="https://klpbbs.com/forum.php?mod=attachment&amp;aid=MTQ1OTkyfDUxN2Q4YzE2fDE3MTkzMTc4Mjl8MHw0NjQzNg%3D%3D" onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" id="aid145992" target="_blank">heart_value.mcpack</a><br>来源:<a href="https://klpbbs.com/thread-46436-1-2.html" target="_blank">https://klpbbs.com/thread-46436-1-2.html</a><br>免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!

小天吖~ 发表于 2022-6-23 12:55:06

教程:<br />&nbsp;&nbsp;编写工具 :mt管理器(推荐) <br />&nbsp;&nbsp;建模工具:blockbench(推荐)<br />&nbsp;&nbsp;贴图绘画:blockbench自带<br />&nbsp;&nbsp;源文件包:Minecraft 1.19 解包<br />(resource_packs)<br />&nbsp;&nbsp;使用molang : Query.health(语法是 query.health == 取值)<br /><br /><br /> 1.新建文件夹 并在里面新建以下文件夹<br /> *render_controllers*&nbsp;&nbsp;*models(*entity*)* *entity*<br /><br />2.在entity里面添加最新的玩家实体文件(player.entity.json)<br /><br />3.在render_controllers里面添加render:<br />示例<br />{<br />&nbsp;&nbsp;&quot;format_version&quot;: &quot;1.8.0&quot;,<br />&nbsp; &nbsp; &quot;render_controllers&quot;: {<br />&nbsp; &nbsp; &quot;controller.render.heart_value_1&quot;: {<br />&nbsp; &nbsp;&nbsp; &nbsp;&quot;geometry&quot;: &quot;Geometry.heart_value&quot;,//用于显示生命值的模型<br />&nbsp; &nbsp;&nbsp; &nbsp;&quot;materials&quot;: [ { &quot;*&quot;: &quot;Material.default&quot; } ],//默认material<br />&nbsp; &nbsp;&nbsp; &nbsp;&quot;textures&quot;: [ &quot;Texture.heart_value_1&quot; ]//将在显示生命值的模型中替换的材质<br />&nbsp; &nbsp; }<br />&nbsp;&nbsp;}<br />}<br />render可以集中一个文件内<br />查询多少生命 写多少render<br />注:命名不冲突<br /><br />4.在player.entity.json中找到第11行(不同字体行数可能不同)<br />&quot;textures&quot;: {<br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&quot;default&quot;: &quot;textures/entity/steve&quot;,<br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&quot;cape&quot;:&quot;textures/entity/cape_invisible&quot;<br />}<br />添加与刚刚写的render中确定的材质<br />&quot;textures&quot;: {<br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&quot;default&quot;: &quot;textures/entity/steve&quot;,<br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&quot;cape&quot;:&quot;textures/entity/cape_invisible&quot;,<br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&quot;heart_value_1&quot;: &quot;材质文件路径&quot;<br />}<br /><br />5.在player.entity.json中找到<br />&nbsp; &nbsp;&nbsp; &nbsp;&quot;geometry&quot;: {<br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&quot;default&quot;: &quot;geometry.humanoid.custom&quot;,<br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&quot;cape&quot;: &quot;geometry.cape&quot;<br />&nbsp; &nbsp;&nbsp; &nbsp;}<br />添加render中确定模型<br />&nbsp; &nbsp;&nbsp; &nbsp;&quot;geometry&quot;: {<br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&quot;default&quot;: &quot;geometry.humanoid.custom&quot;,<br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&quot;cape&quot;: &quot;geometry.cape&quot;,<br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&quot;heart_value&quot;: &quot;geometry.heart_value&quot;<br />&nbsp; &nbsp;&nbsp; &nbsp;}<br /><br />6.在文件尾端,找到<br />&nbsp; &nbsp;&nbsp; &nbsp;&quot;render_controllers&quot;: [<br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;{ &quot;controller.render.player.first_person&quot;: &quot;variable.is_first_person&quot; },<br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;{ &quot;controller.render.player.third_person&quot;: &quot;!variable.is_first_person &amp;&amp; !variable.map_face_icon&quot; },<br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;{ &quot;controller.render.player.map&quot;: &quot;variable.map_face_icon&quot; }<br />]<br />在里面添加刚刚写好的render,并用上molang(检测满足条件时触发render)<br />&nbsp; &nbsp;&nbsp; &nbsp;&quot;render_controllers&quot;: [<br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;{ &quot;controller.render.player.first_person&quot;: &quot;variable.is_first_person&quot; },<br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;{ &quot;controller.render.player.third_person&quot;: &quot;!variable.is_first_person &amp;&amp; !variable.map_face_icon&quot; },<br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;{ &quot;controller.render.player.map&quot;: &quot;variable.map_face_icon&quot; }<br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;{ &quot;controller.render.heart_value_1&quot;: &quot;query.health == 1&quot; }//释义:当玩家生命值为1时启用该render<br />]<br /><br />7.制作显示生命值用的模型(模型命名要与在player.entity.json刚刚写的模型重名 例如geometry.heart_value) 制作完后加入到文件夹models/entity里<br /><br />8.制作贴图 并加入到player.entity.json中刚刚写的材质路径中<br /><br />以上内容可能对初学者不友好 见谅

桃子起泡酒 发表于 2022-6-21 00:06:45

若有漏洞..请在评论区留言 <br />不胜感激

小天吖~ 发表于 2022-6-21 06:42:53

哇偶~<br />加油~<br />其实如果能发个制作此包的教程。再好不过了

春物叙事曲 发表于 2022-6-21 07:03:48

<br />原理:利用玩家entity文件附加模型(render).并用molang(query.health)查询生命值将附加模型显示

月光刻本 发表于 2022-6-21 19:26:48

作者太厉害啦!!<br />bug的话…就是…<br />如果玩家皮肤是角色创建器创建出来的话…用了材质包之后皮肤会变成史蒂夫<br />不过这也不算是材质的bug啦<br />因为这个bug是基岩版老bug…Mojang一直都没修<br /><br />

心动警告 发表于 2022-6-21 23:23:47

<br />毕竟mojang的角色编辑器弄出来的相当于修改玩家的附加骨骼 这个除非用行为包绕过否则都会显示错误

树上有只熊 发表于 2022-6-23 08:47:02

.这能不能出个教程

奶气丫头自然萌i 发表于 2022-6-24 11:57:09

我要看看

焦糖布丁 发表于 2022-8-2 19:38:01

这个好,这个新人必是人才
页: [1]
查看完整版本: 【资源包】玩家生命值显示 - 其他资源 - Minecraft(我的世界)苦力怕论坛