? 关于
此数据包添加了一个手电筒,其光线可沿整个光束路径投射照明。
重要信息:
- 为了使光线在逻辑上能够穿过未完全填充的方块(例如台阶),你需要安装 MIDWUT(click) 库数据包;
- 欢迎协助翻译为其他语言,目前仅提供:俄语、英语以及改革前的俄语版本。
特性:
- 使用红石粉作为能源;
- 利用光源方块实现真实光照效果;
- 即使手电筒不在手持状态,也会消耗电量;
- 手电筒向前照射 20 个方块的距离,覆盖整个光束路径。
玩家可以通过合成制作手电筒,或使用指令 /function energy_flashlight:give/flashlight 给予玩家。
- 当玩家获得红石灯或红石粉时,将解锁该配方。
- 配方可视化查看地址:点击
充电说明会始终显示在电量为零的手电筒描述中,但在此重复一遍:玩家必须主手持有手电筒,副手持有红石粉,潜行并使用手电筒进行充电。
手电筒的最大充能上限为 10 份红石粉,每份红石粉可增加 6 分钟的真实运行时间,因此手电筒最长可充电 1 小时。如果手电筒处于开启状态,电量耗尽后再次拾取时,电池状态将会更新;若超过一小时未拾取,手电筒将立即关闭。这是通过将游戏时间存储在物品数据中实现的,当玩家手持手电筒时,数据包会将保存的时间与当前时间进行比较。
? 附加组件与技术信息
自定义光束
如果你想添加自定义光束,你可以做到这一点,但首先需要了解:为了优化性能,此数据包的光线 tick 函数以 2-tick 的频率运行,因此我添加了 #energy_flashlight:tick 函数标签。你可以将自己的生成光束的函数添加到该标签中。
为什么需要这样做?
1) 优化光源,确保其生命周期仅由本数据包处理;
2) 为避免 Bug,光源的生命周期必须在它们生成和更新之后进行处理。
因此,要生成光束,你需要设置其长度并运行相应函数。
长度以 0.5 个方块为单位测量,即射线检测长度为 10 等于 (<=) 5 个方块的实际距离。
# 基础长度为 20 个方块。
scoreboard players set #raycast main_score 40
execute anchored eyes positioned ^ ^ ^ run function energy_flashlight:other/raycast/loop
自定义充电物品
充电手电筒默认只接受原版红石粉,不包含任何自定义组件。但如果你在物品的 minecraft:custom_data 组件中添加 energy_flashlight.energy_for_flashlight:true NBT 标签,则该物品也可用作充电器。
? 链接
你可以在 PMC 页面上留言!
俄罗斯数据包作者 Discord 服务器 / Русский дискорд сервер датапакеров
如果你是一名数据包作者,正在寻找合理的帮助、有用的资源以及分享项目的机会,请加入 СвинСоюз: Датапаки! 这是从最初被遗弃的 ZeroCaty 创建的 "СвинСоюз" 服务器分支出来的独立服务器。我们现在与其没有任何关联。
? About
This datapack adds a flashlight that casts light across the entire beam path.
Important information:
- In order for light to logically pass through incomplete blocks (slabs for example), you need to install the MIDWUT(click) library datapack;
- Help with translation into other languages is welcome, currently only available: Russian, English and pre-reformation Russian.
Features:
- Using redstone dust as energy;
- Real lighting using light blocks;
- Charge reduction even if the flashlight is not in your hand;
- The flashlight shines 20 blocks ahead, covering the entire beam path.
The player can craft a flashlight or give using a function /function energy_flashlight:give/flashlight
- The player will receive a recipe if he receives a redstone lamp or redstone dust.
- Recipe visualization on the misode generator website: Click
Instructions for charging a flashlight will always be in the description of the flashlight at zero energy, but I'll repeat it here: the player must hold the flashlight in the main hand, the redstone dust in the off hand, sneak and use the flashlight.
The maximum possible charge for a flashlight is 10 redstone dusts, each redstone dust adds 6 minutes of real-time operation, as a result, the flashlight can be charged for 1 hour. If the flashlight is on, the energy is used up and the next time you pick it up, the battery status will be updated, if more than an hour has passed, the flashlight will turn off immediately. This is achieved by storing the gametime in an item, and when the player holds a flashlight, the datapack compares the saved time with the current one.
? Add-ons & Technical info
Custom light beams
If you want to add custom light beam, you can do it, but first you need to know: the datapack tick function runs on a 2-tick schedule for optimization, so I added the #energy_flashlight:tick functions tag. You can add your own functions for the spawn light beam to this tag.
Why is this necessary?
1) To optimize the light sources so that their life is handled only in this datapack;
2) To avoid bugs, the life of light sources must be processed after they are spawned and updated.
So, to spawn a light beam, you need to set its length and run the function.
The length is measured in 0.5 blocks, that is, the length of the raycast 10 is equal to (<=)5 blocks.
# The base length is 20 blocks.
scoreboard players set #raycast main_score 40
execute anchored eyes positioned ^ ^ ^ run function energy_flashlight:other/raycast/loop
Custom charging item
The charging flashlight always accepts only vanilla redstone dust without any custom components, but if you add the energy_flashlight.energy_for_flashlight:true nbt tag to the minecraft:custom_data component, then this item can be used as a charger.
? Links
You can leave a comment on the PMC page!
Russian discord server of datapackers / Русский дискорд сервер датапакеров
Если вы датапакер, ищите адекватной помощи, полезных ресурсов и возможности поделиться проектами, то вам на СвинСоюз: Датапаки! Это сервер-ответвление от изначального заброшенного сервера ZeroCaty "СвинСоюз". Сейчас мы не имеем к нему никакого отношения.
下载 Energy Flashlight
下载 Energy Flashlight
下载 Energy Flashlight
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Energy Flashlight
下载 Energy Flashlight
下载 Energy Flashlight
下载 Energy Flashlight
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Energy Flashlight
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Energy Flashlight
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Energy Flashlight
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
- 仅支持最高版本 26.3。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
资源包
这是 EMF Player Animation 资源包。它为玩家实体添加了精美的动画。兼容其他模组的动画,例如 Quark 的表情动作、Parcool 的技巧以及 Not Enough Animations。
资源包
原汁原味的 Minecraft 质感,分辨率翻倍,乐趣也翻倍!
资源包
为 Minecraft 带来清新而熟悉的 16x16 像素艺术风格
资源包
一款 Minecraft 附加组件,实现附魔光效着色。 适用于原版与模组客户端。
资源包
新增了一个名为“Excalibur's Shrine”的结构,在这里你可以最终解放 Excalibur,并让它为你所用。
资源包
为你的服务器获取最酷炫的强力能力!

评论 0
登录后参与评分
还没有评论,来抢沙发吧