📖 关于
这个数据包真正添加了物理倒下的树木!现在,任何被砍伐的树木都会尝试倒下,对其路径上的所有生物造成伤害。
功能:
- 树木会向较重的一侧倒下,但如果重心位于树干轴线的中心,则树木会朝向玩家倒下。
- 较重的一侧是通过相对于四个基本方向(东、南、西、北)的重量计算得出的。变形的方块权重为 1,其他所有方块的权重为 3。
- 树木造成的伤害取决于其下落速度。
- 如果被砍伐的树上有蜜蜂巢穴,蜜蜂会对您产生敌意。
- 当树木倒下后,模型会保持倒地状态半秒,然后才转化为真实的方块。但如果树木在被砍伐后半秒内就已完成倒下动作,则会瞬间转化。
- 树木会与周围的世界发生碰撞,并在撞击后反弹,然后再稳定下来。
- 树叶会在树木倒下时弯曲并压缩以应对障碍物。
- 倒下的树木重新变为真实方块,原木会根据着陆位置旋转。
以下功能在版本 3.0.0 及更高版本中可用:
- 大型树木在开始倒下前的几个刻钟内进行预处理,以减少延迟。
- 如果同时砍伐多棵小树,它们可以在同一个刻钟内开始倒下。
- 树木可以落在 X 和 Z 轴坐标 ±2147483 之外的区域。
- 模组添加的额外方块在下落后可以保留其保存的方块状态。
▶️ 演示
🧩 附加组件
为您的兼容性附加组件创建单独的数据包。以下示例针对 Minecraft 26.3 版本的 Physical Falling Trees 3.0.0。请将 my_addon 和 example_mod 替换为您自己的命名空间,并在共享标签中保持 "replace": false。
自定义方块
当模组添加的原木和树叶属于 #minecraft:logs 和 #minecraft:leaves 时,会被自动检测。它们使用现有的原木和树叶处理程序,包括原木轴向旋转。
要将附着在树上的额外方块包含在内,请在您的附加组件中将它们添加到 #physical_falling_trees:others:
data/physical_falling_trees/tags/block/others.json
{
"replace": false,
"values": [
"example_mod:tree_fruit",
"example_mod:tree_growth"
]
}
这些方块可以作为连通树的一部分被发现。没有专用处理程序的方块将通过丝袜挖掘掉落物中保存的 minecraft:block_state 属性进行还原。通过这种方式采集时,它们必须掉落自身的方块物品。这并不提供任意方块实体 NBT 的自动还原。
自定义生物群系中的树叶颜色
通过资源包着色物品模型渲染的下落树叶,会使用树木预处理期间选择的颜色。附加组件可以通过 #physical_falling_trees:biome_leaves_color 函数标签提供此颜色。
注册您的函数:
data/physical_falling_trees/tags/function/biome_leaves_color.json
{
"replace": false,
"values": [
"my_addon:leaf_color"
]
}
然后检查当前方块位置的生物群系,将叶子的色调写入 storage midwut:main temp.leaves_color,并返回成功:
data/my_addon/function/leaf_color.mcfunction
execute unless biome ~ ~ ~ example_mod:autumn_forest run return fail
data modify storage midwut:main temp.leaves_color set value 5614131
return 1
颜色是一个打包的 RGB 整数:5614131 代表 #55AA33(R × 65536 + G × 256 + B)。将其替换为您生物群系的叶子颜色。
即使存储的值已经相同,在提供颜色后也请返回 1。对于您的附加组件不处理的生物群系,请返回 fail,以便在没有附加组件提供颜色时运行标准颜色查找。保持当前的执行位置,以便生物群系检查适用于正在转换的树叶。
对于较大的生物群系包,请使用 PFT-Coloring datapack 演示的方法:调度程序检查哪个生物群系组适用,调用其颜色查找,并在匹配成功后返回成功。生物群系组可以在 data/my_addon/tags/worldgen/biome/ 中定义。对于版本 3.0.0,颜色处理程序必须写入 temp.leaves_color。
此钩子为现有物品模型提供色调值。添加新的着色树叶类型还需要匹配的 resource pack 模型定义。
🔗 额外链接
您可以在 PMC 页面上留下评论!
俄罗斯数据包制作者 Discord 服务器 / Русский дискорд сервер датапакеров
如果您是一名数据包制作者,寻找合理的帮助、有用的资源和分享项目的机会,请访问 СвинСоюз: Датапаки! 这是从最初废弃的 ZeroCaty “СвинСоюз” 服务器分支出来的服务器。我们现在与该服务器没有任何关系。
📖 About
So, this datapack really adds physical falling trees! Now, with any felled tree, it will try to fall, causing damage to all living entities in its path.
Features:
- Trees fall to the heavier side, but if the center of gravity is in the center of the tree axis, then the tree falls towards the player.
- The heavier side is calculated by the relative weight for the cardinal directions. The deforming blocks have 1, all the others have 3.
- The tree causes damage depending on it's falling speed.
- If there are bees in the nest of a cut tree, they will get angry at you.
- When the tree has fallen, the model will be lying for half a second before transforming into real blocks. But if a tree has been falling for less than half a second after being cut down, then it transforms instantly.
- Trees collide with the world around them and can rebound on impact before settling.
- Foliage bends and compresses against obstacles as the tree falls.
- Fallen trees become real blocks again, with logs rotated to match their landing.
The following features are available in version 3.0.0 and later:
- Large trees are prepared over several ticks to reduce lag before they start falling.
- If several small trees are cut down at the same time, they can start falling in the same tick.
- Trees can fall beyond coordinates ±2147483 on the X and Z axes.
- Additional blocks in modded trees can keep their saved block states after falling.
▶️ Demonstration
🧩 Add-ons
Create a separate datapack for your compatibility add-on. The examples below target Physical Falling Trees 3.0.0 for Minecraft 26.3. Replace my_addon and example_mod with your own namespaces, and keep "replace": false in shared tags.
Custom blocks
Modded logs and leaves are detected automatically when they belong to #minecraft:logs and #minecraft:leaves. They use the existing log and leaf handlers, including log-axis rotation.
To include additional blocks attached to a tree, add them to #physical_falling_trees:others in your add-on:
data/physical_falling_trees/tags/block/others.json
{
"replace": false,
"values": [
"example_mod:tree_fruit",
"example_mod:tree_growth"
]
}
These blocks can be discovered as part of a connected tree. Blocks without a dedicated handler are restored with the minecraft:block_state properties saved in their Silk Touch drops. They must drop their own block item when harvested this way. This does not provide automatic restoration of arbitrary block-entity NBT.
Leaf colors in custom biomes
Falling leaves rendered through the pack's tinted item model use a color selected during tree preparation. An add-on can supply this color through the #physical_falling_trees:biome_leaves_color function tag.
Register your function:
data/physical_falling_trees/tags/function/biome_leaves_color.json
{
"replace": false,
"values": [
"my_addon:leaf_color"
]
}
Then check the biome at the current block position, write the foliage tint to storage midwut:main temp.leaves_color, and return success:
data/my_addon/function/leaf_color.mcfunction
execute unless biome ~ ~ ~ example_mod:autumn_forest run return fail
data modify storage midwut:main temp.leaves_color set value 5614131
return 1
The color is a packed RGB integer: 5614131 represents #55AA33 (R × 65536 + G × 256 + B). Replace it with the foliage color of your biome.
Return 1 after supplying a color, even if the stored value was already the same. Return fail for biomes your add-on does not handle, allowing the standard color lookup to run when no add-on supplies a color. Keep the current execution position so the biome check applies to the leaf being converted.
For larger biome packs, use the approach demonstrated by PFT-Coloring datapack: a dispatcher checks which biome group applies, calls its color lookup, and returns success after a match. Biome groups can be defined in data/my_addon/tags/worldgen/biome/. For version 3.0.0, color handlers must write to temp.leaves_color.
This hook supplies tint values for the existing item model. Adding a new tinted leaf type also requires a matching resource-pack model definition.
🔗 Extra Links
You can leave a comment on the PMC page!
Russian discord server of datapackers / Русский дискорд сервер датапакеров
Если вы датапакер, ищите адекватной помощи, полезных ресурсов и возможности поделиться проектами, то вам на СвинСоюз: Датапаки! Это сервер-ответвление от изначального заброшенного сервера ZeroCaty "СвинСоюз". Сейчас мы не имеем к нему никакого отношения.
下载 Physical Falling Trees
下载 Physical Falling Trees
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Physical Falling Trees
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Physical Falling Trees
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Physical Falling Trees
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Physical Falling Trees
下载 Physical Falling Trees
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Physical Falling Trees
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Physical Falling Trees
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Physical Falling Trees
- 使用 Minecraft 26.3 的数字提供程序重新实现了下落、旋转和树叶变形计算。
- 将移动和枢轴坐标迁移至浮点数计算,移除了之前约 ±2147483 个方块的坐标限制。
- 引入了异步树木准备机制,以减少砍伐大型树木时的刻时间峰值。
- 添加了准备队列,允许多棵小型树木在同一刻内开始下落。
- 优化了树木检测以及从方块到显示实体的转换过程。
- 改进了具有复杂基座的树木的枢轴选择。
- 修复了同时切割多个方块时的对齐问题,并修正了原木材质的保留逻辑。
- 为没有专门处理逻辑的方块(包括模组添加的方块)添加了保存方块状态的还原功能。
- 在树木准备阶段添加了树干开裂音效。
- 重命名命名空间:
physics_of_falling_trees->physical_falling_trees。 - 标准化记分板、实体标签和翻译键前缀:
poft->pfts。
- 自版本 1.21.6 起,树木现在会对所有“新”生物造成伤害;
- 支持最高至 26.2。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
模组
AE2:一款流行的自动化与存储模组
模组
那是什么?一个 Waila/Hwyla 的分支。

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