lan_e2e hands: shoot the cow with a half drawn bow so it lives

A fully drawn bow fires a crit arrow: AbstractArrow.onHitEntity adds
random.nextInt(damage / 2 + 2) to the 6 damage, so one shot in five does 10
and kills the 10 health cow. The off hand bucket then had nothing to milk
("the host's off hand holds minecraft:bucket"), on either side, in any mode.
Under 20 ticks of draw the arrow is no crit and does at most 6. The check
now also asserts the cow is still there after the shot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-23 22:01:32 +02:00
parent 0a36a6d8c6
commit c89695dd93
+6 -1
View File
@@ -3703,13 +3703,18 @@ def check_hands(host, guest, out):
player.raw('select', 'minecraft:bow')
aim_cow()
assert player('looking_at')['kind'] == 'entity', f'the {label} does not aim at the cow'
# Half drawn: a full draw is a crit, up to 10 damage (AbstractArrow.onHitEntity), which
# kills the 10 health cow one shot in five. Under 20 ticks the arrow does at most 6.
player.raw('mouse', 'right', 'down')
player.wait(25)
player.wait(10)
drawn = player('state')['using']
player.raw('mouse', 'right', 'up')
player.wait(20)
assert drawn, f'the {label}\'s bow is not drawn at the cow'
assert counts().get('minecraft:arrow') == 5, f'the {label} shot no arrow: {counts()}'
aim_cow()
cow = player('looking_at').get('entity') or {}
assert cow.get('health', 0) > 0, f'the {label}\'s arrow killed the cow: {cow}'
player('command', command='clear @s')
player('command', command='give @s minecraft:golden_apple')
player.wait(5)