Nutlet 是一款轻量级、以实用功能为核心的数据包,旨在简化多功能块机器(Multi-block machines)的创建。
主要特性
? 咒语书
一本拥有自定义附魔的书。玩家在其第一页写入特定的“词”或“短语”,然后左击方块或攻击实体以触发相应的“函数”。
这使创作者能够捕获方块/实体交互,而无需依赖进度系统或射线检测。其原理类似于 GregTech 模组中软锤的功能。
通过 #nutlet:spells 函数标签轻松注册。
⏰ 增强版 /schedule
扩展了原版 /schedule 命令,允许你通过命令存储(Command Storage)向延迟执行的函数传递 NBT 数据。
?️ 结构图显示
召唤会在设定时间后消失的方块、物品或文本显示实体——即使区块被卸载也是如此。非常适合预览多功能块结构或提供视觉反馈。消失功能依赖于上述增强版的 /schedule。
可以指定变换、方块属性、物品组件或文本 JSON。
可选的有效性检查:如果投影出的方块与预期状态不符,则会显示警告文本。
? 方向辅助工具
根据方块的朝向或命令执行旋转来调整命令执行上下文的函数。
-
nutlet:-m/facing/block
获取方块的朝向和方向(如高炉、活塞、发射器、合成器等)。
-
nutlet:-m/facing/entity
从命令执行旋转中获取朝向方向。
-
nutlet:-m/facing/block_axis_align & nutlet:-m/facing/entity_axis_align
将执行角度对齐到朝向方向后运行一个函数,使多功能块机器不再受朝向限制。
? UUID 转换
将 UUID 数组(例如来自实体的 UUID 标签)转换为带连字符的十六进制字符串,可直接用于目标选择器(例如 /execute as 2ed128ed-5e7b-4a13-b3e0-a49b2749dbd7 run ...)。
☀️ 亮度
计算执行位置的光照等级,如果方块本身阻挡光线,则会将相邻方块考虑在内。
⚙️ 游戏内配置
注册配置选项,玩家可以使用咒语书在游戏内修改这些选项。
两种存储后端:计分板(用于整数)或命令存储(用于任意 NBT)。
可以定义描述、有效范围或可接受值的白名单。
首次加载世界时会自动注入默认值。
只有第一个获得咒语书的玩家才能更改设置(防止滥用)。
? 其他实用工具
nutlet:-m/schematic/tick
召唤一个盔甲架,每刻运行一次函数(具有可变冷却时间和可更改的函数),用于简单的周期性任务。
面向数据包创作者
通过 #nutlet:spells 函数标签注册咒语。
通过 #nutlet:configs 函数标签注册配置选项。
在 nutlet:-m/... 命名空间下调用实用函数。
查看以下两个示例数据包以更详细地了解如何使用 Nutlet:
Roost, Rock Generator
安装方法
数据包部分
- 打开 Minecraft。
- 选择要安装数据包的世界,点击“编辑”,然后“打开世界文件夹”。
- 打开名为“datapacks”的文件夹,并将数据包(应为类似“Nutlet_V1.2.zip”的文件)放入其中。
- 重新进入世界,聊天栏中将显示数据包版本信息。
你可以使用咒语书禁用重新进入世界时打印的数据包版本信息。
资源包部分,用于本地化翻译
- 打开 Minecraft,选择“选项”,然后“资源包”,然后“打开包文件夹”。
- 将数据包(该数据包文件既是数据包也是资源包)放入其中。
- 返回 Minecraft,选择新添加的资源包并点击“完成”。
Nutlet is a lightweight, utility‑focused data pack designed to easyly creating Multi-block machines.
Key Features
? Spell Book
A book with a custom Enchantment. Players write a specific Word or Phrase on its first page, then left-click a block or attack an entity to trigger a corresponding Function.
This lets creators capture Block/Entity Interactions without relying on advancements or raycasting. Just like the function of Soft Mallet in GregTech mod.
Easy registration via the #nutlet:spells function tag.
⏰ Enhanced /schedule
Extends the vanilla /schedule command by allowing you to pass NBT data to the delayed function via Command Storage.
?️ Schematic Displays
Summon Block, Item, or Text Display entities that vanish after a set time—even if the chunk is unloaded. Perfect for previewing multiblock structures or giving visual feedback. The vanish function depends on the enhanced /schedule mentioned earlier.
Can specify transformation, block properties, item components, or text JSON.
Optional validity check: if the projected block doesn't match the intended state, a warning text display appears instead.
? Orientation Helpers
Functions that adjust Command Execution Context based on a block's facing direction or Command Execution Rotation.
-
nutlet:-m/facing/block
Get Facing and Orientation of a block (furnace, piston, dispenser, crafter, etc.).
-
nutlet:-m/facing/entity
Get the Facing Direction from Command Execution Rotation.
-
nutlet:-m/facing/block_axis_align & nutlet:-m/facing/entity_axis_align
run a function after aligning Execution Angle to the faced direction, making Multi-Block Machines orientation‑agnostic.
? UUID Conversion
Converts a UUID Array (e.g., from an entity's UUID tag) into a hyphenated hexadecimal string that can be used directly in Target Selectors (e.g., /execute as 2ed128ed-5e7b-4a13-b3e0-a49b2749dbd7 run ...).
☀️ Brightness
Calculates the light level at the Executing Position, taking into account adjacent blocks if the block itself is light‑blocking.
⚙️ In‑Game Configuration
Register configuration options that players can Modify at In-Game using the Spell Book.
Two storage backings: scoreboard (for integers) or command storage (for any NBT).
Can define a description, valid range, or a whitelist of acceptable values.
Default values are automatically injected on first load world.
Only the First Player to obtain a Spell Book can Change settings (prevents abuse).
? Additional Utilities
nutlet:-m/schematic/tick
Summon an Armor Stand that runs a Function every tick (with mutable cooldown and changable functions) for simple periodic tasks.
For Datapack Creators
Register spells via the #nutlet:spells function tag.
Register configuration options via the #nutlet:configs function tag.
Call utility functions under the nutlet:-m/... namespace.
Look at these two sample Datapacks to get a more detailed understanding of how to use Nutlet:
Roost, Rock Generator
How to install
Datapack part
- Open Minecraft.
- Select the world you want to install the Datapack for, click on "Edit", then "Open world folder".
- Open the folder named "datapacks", and put the Datapack(It should like "Nutlet_V1.2.zip") into it.
- Relogin the world, you will see the version of Datapack on chats.
You can use Spell Book disable print version of Datapack when relogin.
Resourcepack part, for Localization translation
- Open Minecraft, select "Options", then "Resource Packs", then "Open Pack Folder".
- Put the Datapack(The Datapack file is both datapack and resourcepack) into it.
- Back the Minecraft, select new one and Click "Done".
评论 0
登录后参与评分
还没有评论,来抢沙发吧