Barrel Harvest v1.4.0
打开设置菜单(书籍界面)
/trigger bh_trigger set 1
这会给你一本可点击的撰写过的书——右键单击即可打开。点击任意按钮以切换该设置。关闭书本时,聊天栏会显示一行反馈信息。不再像旧版 90 行菜单那样刷屏。
这本书共有 5 页:
- 主要控制 — 启用/禁用、间隔预设、概率预设、微调按钮
- 选择木材类型 — 选择要配置掉落物的木材
- 掉落物开关 — 针对所选木材启用/禁用原木、木板、去皮原木、木棍、树苗、树叶、苹果
- 架子升级 — 解释架子升级系统
- 帮助 — 快速参考和卸载命令
如果你的背包已满,书本会掉落在地上——捡起它并右键单击打开。
服务器说明: 本书使用 /give 命令,这需要 function-permission-level ≥ 2(默认值)。如果你的服务器将其设置为更低,书本将不会出现——请使用下面的触发快捷方式。
错误
- 如果花盆位于扫描半径之外(每个玩家周围默认的 10×10×4 体积),可能会遗漏它们。
- 桶必须有空间存放掉落物;当桶满时,收割会被跳过。
命令
触发菜单快捷方式(非 OP 权限)
这些与菜单书中的可点击按钮相匹配。
/trigger bh_trigger set 1 打开菜单书
/trigger bh_trigger set 2 切换数据包启用/禁用状态
# 间隔预设(收割尝试的频率)
/trigger bh_trigger set 7 间隔快速 (100 tick / 5秒)
/trigger bh_trigger set 24 间隔中等 (400 tick / 20秒)
/trigger bh_trigger set 8 间隔缓慢 (1200 tick / 60秒)
/trigger bh_trigger set 3 增加间隔 (+20 tick)
/trigger bh_trigger set 4 减少间隔 (-20 tick)
# 概率预设(每次收割尝试的成功率)
/trigger bh_trigger set 25 概率快速 (100%)
/trigger bh_trigger set 26 概率中等 (50%)
/trigger bh_trigger set 27 概率缓慢 (20%)
/trigger bh_trigger set 5 增加概率 (+5%)
/trigger bh_trigger set 6 减少概率 (-5%)
# 掉落物开关(影响当前选择的木材类型)
/trigger bh_trigger set 9 切换原木掉落物
/trigger bh_trigger set 10 切换木板掉落物
/trigger bh_trigger set 11 切换去皮原木掉落物
/trigger bh_trigger set 12 切换木棍掉落物
/trigger bh_trigger set 13 切换树苗掉落物
/trigger bh_trigger set 14 切换树叶掉落物
/trigger bh_trigger set 15 切换苹果掉落物
# 木材类型选择
/trigger bh_trigger set 16 选择橡木
/trigger bh_trigger set 17 选择云杉
/trigger bh_trigger set 18 选择白桦
/trigger bh_trigger set 19 选择红树林
/trigger bh_trigger set 20 选择丛林
/trigger bh_trigger set 21 选择金合欢
/trigger bh_trigger set 22 选择深色橡木
/trigger bh_trigger set 23 选择樱花
卸载(OP/管理员)— 在移除数据包之前运行
/function barrelharvest:uninstall
这会停止数据包并删除三个记分板目标(bh_timer、bh_config、bh_trigger),以免在世界中残留。运行后,禁用/删除数据包:
/datapack disable barrelharvest
直接配置函数(OP/管理员)
/function barrelharvest:uninstall
/function barrelharvest:config/menu
/function barrelharvest:config/toggle_enabled
# 间隔预设和微调
/function barrelharvest:config/fast_preset
/function barrelharvest:config/medium_preset
/function barrelharvest:config/slow_preset
/function barrelharvest:config/interval_up
/function barrelharvest:config/interval_down
# 概率预设和微调
/function barrelharvest:config/chance_fast
/function barrelharvest:config/chance_medium
/function barrelharvest:config/chance_slow
/function barrelharvest:config/chance_up
/function barrelharvest:config/chance_down
# 掉落物开关
/function barrelharvest:config/toggle_log
/function barrelharvest:config/toggle_planks
/function barrelharvest:config/toggle_stripped_log
/function barrelharvest:config/toggle_stick_generic
/function barrelharvest:config/toggle_sapling
/function barrelharvest:config/toggle_leaves
/function barrelharvest:config/toggle_apple_generic
# 木材类型选择器
/function barrelharvest:config/select_oak
/function barrelharvest:config/select_spruce
/function barrelharvest:config/select_birch
/function barrelharvest:config/select_mangrove
/function barrelharvest:config/select_jungle
/function barrelharvest:config/select_acacia
/function barrelharvest:config/select_dark_oak
/function barrelharvest:config/select_cherry
间隔与概率预设
间隔和概率是独立控制的。为每一项选择一个预设,或使用 +/- 按钮进行微调。
间隔预设(收割尝试的频率)
| 预设 |
间隔 |
实际时间 |
| 快速 |
100 tick |
5 秒 |
| 中等 |
400 tick |
20 秒 |
| 缓慢 |
1200 tick |
60 秒 |
微调:每次点击 +/- 20 tick(最小 100,最大 4000)。
概率预设(每次收割尝试的成功率)
| 预设 |
概率 |
| 快速 |
100%(每次尝试都会收割) |
| 中等 |
50% |
| 缓慢 |
20% |
微调:每次点击 +/- 5%(最小 5%,最大 100%)。
组合预设
由于间隔和概率是独立的,你可以混合搭配:
- 快速间隔 + 快速概率 — 每 5 秒收割一次,始终成功(产量极高)
- 缓慢间隔 + 快速概率 — 每 60 秒收割一次,始终成功(稳定,维护成本低)
- 快速间隔 + 缓慢概率 — 每 5 秒尝试一次,仅 20% 成功(频繁但不可靠)
- 中等间隔 + 中等概率 — 平衡的默认设置
架子升级(Minecraft 26.2+)
将 架子 方块(任意木质变体:橡木、云杉木、白桦木、丛林木、金合欢木、深色橡木、红树木、樱桃木、苍白橡木、竹、绯红木、诡异木)直接放置在桶的北侧、南侧、东侧或西侧。将升级物品放入架子的 3 个槽位中。数据包会在每次收割时读取架子上的内容并应用加成效果:
| 物品 |
效果 |
| 钻石 |
双倍掉落 — 收割会产生一次掷骰结果的额外副本 |
| 荧石粉 |
额外原木 — 保证每次收割额外掉落一个原木(如果该木材启用了原木掉落) |
| 骨粉 |
50% 概率复制掉落的物品 — 每个收割周期产出更多 |
| 青金石 |
额外树叶 — 保证每次收割额外掉落一个树叶(如果启用了树叶掉落) |
工作原理
- 数据包会检查每个桶的四个水平侧面是否有架子方块(
#minecraft:wooden_shelves 标签)。
- 它会读取架子的
Items[] NBT 数据以检测其中包含哪些升级物品。
- 多种升级效果可以叠加 — 同时放置钻石和荧石粉的架子会提供双倍掉落 AND 额外原木。
- 你可以在多个架子上混合放置不同的物品(例如:北侧架子放钻石,东侧架子放青金石)。
- 升级功能仅在拥有“架子”方块的 Minecraft 版本中生效(快照版 25w31a / 26.2+)。在旧版本中,由于不存在架子方块,升级会被静默跳过 — 数据包仍可正常工作。
设置示例
[架子: 钻石] [桶] [花盆: 橡树苗]
[架子: 荧石粉]
此桶在每个收割周期都会获得双倍掉落 + 额外橡树木材。
兼容性
- 适用于 Java 版 1.21.4 至 26.2(
pack_format 107,supported_formats 48–107)。
- 该数据包不会召唤任何实体(无盔甲架、标记实体或显示实体),因此世界中无需清理任何内容 — 仅涉及三个计分板目标,可通过运行
barrelharvest:uninstall 进行移除。
- 在 26.2 版本上测试过的语法表面包括:
random、loot insert、data get block ... Items、potted_* 方块 ID、written_book_content 组件、SNBT 文本组件、计分板、return。
- 如果在 26.2 版本中出现异常行为,请先禁用数据包(执行
/datapack disable barrelharvest),然后在它仍加载时运行 /function barrelharvest:uninstall,最后再删除文件夹。
备注
- 大多数设置通过菜单书更改最为便捷。
- 收割尝试针对每位玩家独立进行,并扫描每位玩家周围 10×10×4 体积范围内的区域。
- 调试模式可通过命令
/scoreboard players set #debug bh_config 1 切换,以便在聊天栏中查看收割尝试记录。
- 一个仅生成粒子效果的扫描函数(
detect/scan_5x5_area)每 100 刻为每位玩家运行一次,用于在有效的花盆+桶组合处产生闪烁特效。如果你希望在繁忙服务器上追求极致性能,可以通过将其绑定到 #debug 条件来禁用此视觉反馈(参见 tick.mcfunction)。
- 也请看看 WASD Bonsai pots,这是一个非常酷的整合包,拥有自己的模型;我目前使用的是原版风格。
许可证
© pnksounds。根据 知识共享署名-非商业性使用 4.0 国际许可协议 (CC BY-NC 4.0) 授权。
您可以出于非商业目的分享、复制、改编并基于此数据包进行二次创作,前提是适当标注原作者(pnksounds)。未经明确许可,禁止商业用途。
本数据包按“原样”提供,不提供任何形式的担保。
支持作者
Barrel Harvest v1.4.0
Open the settings menu (Book UI)
/trigger bh_trigger set 1
This gives you a clickable written book — right-click to open it. Click any button to toggle that setting. Feedback appears as a single line in chat when you close the book. No more chat spam from the old 90-line menu re-print.
The book has 5 pages:
- Main Controls — enable/disable, interval presets, chance presets, fine-tune buttons
- Select Wood Type — pick which wood you want to configure loot for
- Loot Toggles — enable/disable log, planks, stripped log, stick, sapling, leaves, apple for the selected wood
- Shelf Upgrades — explains the shelf upgrade system
- Help — quick reference and uninstall command
If your inventory is full, the book drops on the ground — pick it up and right-click to open.
Server note: The book uses /give, which requires function-permission-level ≥ 2 (the default). If your server has it set lower, the book won't appear — use the trigger shortcuts below instead.
Bugs
- May miss pots if they are outside the scan radius (default 10×10×4 volume around each player).
- Barrel must have space for loot; harvests are skipped when full.
Commands
Trigger menu shortcuts (non-OP)
These match the clickable buttons in the menu book.
/trigger bh_trigger set 1 Open menu book
/trigger bh_trigger set 2 Toggle datapack enabled/disabled
# Interval presets (how often harvest attempts happen)
/trigger bh_trigger set 7 Interval Fast (100 ticks / 5s)
/trigger bh_trigger set 24 Interval Medium (400 ticks / 20s)
/trigger bh_trigger set 8 Interval Slow (1200 ticks / 60s)
/trigger bh_trigger set 3 Increase interval (+20 ticks)
/trigger bh_trigger set 4 Decrease interval (-20 ticks)
# Chance presets (odds per harvest attempt)
/trigger bh_trigger set 25 Chance Fast (100%)
/trigger bh_trigger set 26 Chance Medium (50%)
/trigger bh_trigger set 27 Chance Slow (20%)
/trigger bh_trigger set 5 Increase chance (+5%)
/trigger bh_trigger set 6 Decrease chance (-5%)
# Loot toggles (affect the currently selected wood type)
/trigger bh_trigger set 9 Toggle Log loot
/trigger bh_trigger set 10 Toggle Planks loot
/trigger bh_trigger set 11 Toggle Stripped Log loot
/trigger bh_trigger set 12 Toggle Stick loot
/trigger bh_trigger set 13 Toggle Sapling loot
/trigger bh_trigger set 14 Toggle Leaves loot
/trigger bh_trigger set 15 Toggle Apple loot
# Wood type selection
/trigger bh_trigger set 16 Select Oak
/trigger bh_trigger set 17 Select Spruce
/trigger bh_trigger set 18 Select Birch
/trigger bh_trigger set 19 Select Mangrove
/trigger bh_trigger set 20 Select Jungle
/trigger bh_trigger set 21 Select Acacia
/trigger bh_trigger set 22 Select Dark Oak
/trigger bh_trigger set 23 Select Cherry
Uninstall (OP/admin) — run BEFORE removing the pack
/function barrelharvest:uninstall
This stops the pack and removes the three scoreboard objectives (bh_timer, bh_config, bh_trigger) so nothing lingers in the world. After running it, disable/delete the datapack:
/datapack disable barrelharvest
Direct config functions (OP/admin)
/function barrelharvest:uninstall
/function barrelharvest:config/menu
/function barrelharvest:config/toggle_enabled
# Interval presets and fine-tune
/function barrelharvest:config/fast_preset
/function barrelharvest:config/medium_preset
/function barrelharvest:config/slow_preset
/function barrelharvest:config/interval_up
/function barrelharvest:config/interval_down
# Chance presets and fine-tune
/function barrelharvest:config/chance_fast
/function barrelharvest:config/chance_medium
/function barrelharvest:config/chance_slow
/function barrelharvest:config/chance_up
/function barrelharvest:config/chance_down
# Loot toggles
/function barrelharvest:config/toggle_log
/function barrelharvest:config/toggle_planks
/function barrelharvest:config/toggle_stripped_log
/function barrelharvest:config/toggle_stick_generic
/function barrelharvest:config/toggle_sapling
/function barrelharvest:config/toggle_leaves
/function barrelharvest:config/toggle_apple_generic
# Wood type selectors
/function barrelharvest:config/select_oak
/function barrelharvest:config/select_spruce
/function barrelharvest:config/select_birch
/function barrelharvest:config/select_mangrove
/function barrelharvest:config/select_jungle
/function barrelharvest:config/select_acacia
/function barrelharvest:config/select_dark_oak
/function barrelharvest:config/select_cherry
Interval and Chance Presets
Interval and chance are controlled independently. Pick a preset for each, or fine-tune with the +/- buttons.
Interval presets (how often harvest attempts happen)
| Preset |
Interval |
Real time |
| Fast |
100 ticks |
5 seconds |
| Medium |
400 ticks |
20 seconds |
| Slow |
1200 ticks |
60 seconds |
Fine-tune: +/- 20 ticks per click (min 100, max 4000).
Chance presets (odds per harvest attempt)
| Preset |
Chance |
| Fast |
100% (every attempt harvests) |
| Medium |
50% |
| Slow |
20% |
Fine-tune: +/- 5% per click (min 5%, max 100%).
Combining presets
Since interval and chance are independent, you can mix them:
- Fast interval + Fast chance — harvests every 5 seconds, always succeeds (very high output)
- Slow interval + Fast chance — harvests every 60 seconds, always succeeds (steady, low maintenance)
- Fast interval + Slow chance — attempts every 5 seconds, only 20% succeed (frequent but unreliable)
- Medium interval + Medium chance — balanced default
Shelf Upgrades (Minecraft 26.2+)
Place a Shelf block (any wood variant: oak, spruce, birch, jungle, acacia, dark oak, mangrove, cherry, pale oak, bamboo, crimson, warped) directly adjacent to the barrel — north, south, east, or west side. Put upgrade items into the shelf's 3 slots. The datapack reads the shelf contents during each harvest and applies bonuses:
| Item |
Effect |
| Diamond |
Double drops — the harvest produces a second copy of whatever was rolled |
| Glowstone Dust |
Extra log — guarantees one additional log drop per harvest (if logs are enabled for that wood) |
| Bone Meal |
50% chance to duplicate the dropped item — more output per harvest cycle |
| Lapis Lazuli |
Extra leaves — guarantees one additional leaves drop per harvest (if leaves are enabled) |
How it works
- The pack checks all 4 horizontal sides of each barrel for shelf blocks (
#minecraft:wooden_shelves tag).
- It reads the shelf's
Items[] NBT to detect which upgrade items are present.
- Multiple upgrades stack — a shelf with both diamond and glowstone gives double drops AND an extra log.
- You can mix items across multiple shelves (e.g. diamond on the north shelf, lapis on the east shelf).
- Upgrades only work on Minecraft versions that have the Shelf block (snapshot 25w31a / 26.2+). On older versions, shelves simply don't exist and upgrades are silently skipped — the pack still works normally.
Setup example
[Shelf: Diamond] [Barrel] [Pot: Oak Sapling]
[Shelf: Glowstone Dust]
This barrel would get double drops + an extra oak log every harvest cycle.
Compatibility
- Targets Java Edition 1.21.4 through 26.2 (
pack_format 107, supported_formats 48–107).
- The pack never summons entities (no armor stands, markers, or display entities), so there is nothing to clean up in the world itself — only the three scoreboard objectives, which
barrelharvest:uninstall removes.
- Tested syntax surface on 26.2:
random, loot insert, data get block ... Items, potted_* block IDs, written_book_content component, SNBT text components, scoreboard, return.
- If anything behaves oddly on 26.2, disable the pack before removing it (
/datapack disable barrelharvest), then run /function barrelharvest:uninstall while it's still loaded, then delete the folder.
Notes
- Most settings are easiest to change via the menu book.
- Harvest attempts are per-player and scan a 10×10×4 volume around each player.
- Debug mode can be toggled with
/scoreboard players set #debug bh_config 1 to see harvest attempts in chat.
- A particle-only scan (
detect/scan_5x5_area) runs every 100 ticks per player to sparkle on valid pot+barrel combos. If you want maximum performance on a busy server, you can disable this visual feedback by gating it behind #debug (see tick.mcfunction).
- check out WASD Bonsai pots also, very cool pack with its own models, mine is just vanilla
License
© pnksounds. Licensed under Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0).
You may share, copy, adapt, and build upon this datapack for non-commercial purposes, provided you give appropriate credit to the original author (pnksounds). Commercial use is prohibited without explicit permission.
This is provided “as is”, without warranty of any kind.
Support me
评论 0
登录后参与评分
还没有评论,来抢沙发吧