Bees live in hives and nests: they go home, come out in the morning and make honey (#208)

BeehiveBlockEntity (crate::beehive): up to three bees stored as entity
tags, out when their time is up (not at night, in the rain or through a
blocked front unless in an emergency), honey for nectar, the flower they
knew; vanilla's bees / flower_pos save format. Bees find a hive with room
(BeeLocateHiveGoal), fly home and go in (BeeEnterHiveGoal through
MobEvent::EnterHive). In the game hives tick, breaking one lets the bees
out angry unless smoked, fire empties it, dispensers release them.

mob_ai: bee_hive_night, _rain, _morning and _honey match vanilla.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-15 09:14:21 +02:00
parent b5a2afb71e
commit 111b237b6d
13 changed files with 1105 additions and 47 deletions
+12 -2
View File
@@ -250,6 +250,13 @@ def scenarios():
add('bee_rain', 300, [FLOWERS, 'mob minecraft:bee 0.5 -58 0.5 0 157 persistent'], 'rain')
add('bee_pool', 200, ['fill -3 -63 -3 3 -61 3 minecraft:water', 'mob minecraft:bee 0.5 -62 0.5 0 158 persistent'])
add('bee_sting', 400, ['player 4.5 -60 0.5', 'mob minecraft:bee 0.5 -58 0.5 0 159 persistent', 'hurt 20 0'])
# Bees and their hive: home at night and in the rain (BeeLocateHiveGoal, BeeGoToHiveGoal,
# BeeEnterHiveGoal), out again once the morning comes, and nectar turned into honey.
HIVE = 'block 4 -60 0 minecraft:beehive[facing=west,honey_level=0]'
add('bee_hive_night', 300, [HIVE, 'mob minecraft:bee 0.5 -58 0.5 0 161 persistent'], 'time=13000')
add('bee_hive_rain', 300, [HIVE, 'mob minecraft:bee 0.5 -58 0.5 0 162 persistent'], 'rain')
add('bee_hive_morning', 1000, [HIVE, 'mob minecraft:bee 0.5 -58 0.5 0 163 persistent'], 'time=22900 daycycle')
add('bee_hive_honey', 2600, [HIVE, 'mob minecraft:bee 0.5 -58 0.5 0 164 persistent nectar'])
return s
@@ -304,6 +311,9 @@ def parse(path):
if parts[1] == 'heart':
cur.setdefault('hearts', {}).setdefault(t, []).append(line.split(' ', 2)[2])
continue
if parts[1] == 'hive':
cur.setdefault('hives', {}).setdefault(t, []).append(parts[2])
continue
if parts[1] == 'chest':
cur.setdefault('chests', {}).setdefault(t, []).append(parts[2])
continue
@@ -400,8 +410,8 @@ def compare(vanilla, rust, fields=None):
report.append(f'{name}: hearts differ at tick {t}: vanilla {v.get("hearts", {}).get(t)} | horizon {r.get("hearts", {}).get(t)}')
clean = False
break
# Sounds, watched block changes and chest contents: first differing tick.
for kind in ('sounds', 'blocks', 'chests'):
# Sounds, watched block changes, chest contents and hives: first differing tick.
for kind in ('sounds', 'blocks', 'chests', 'hives'):
va, ra = v.get(kind, {}), r.get(kind, {})
for t in sorted(set(va) | set(ra)):
if va.get(t, []) != ra.get(t, []):