Overflow drops, and later mob or chest drops, use __builtin:item, which is picked up relative to the hidden player body (the camera). Override the item entity so it stays on the plane and flies to any avatar within ~3 blocks, then into the inventory.
Overflow drops, and later mob or chest drops, use `__builtin:item`, which is picked up relative to the hidden player body (the camera). Override the item entity so it stays on the plane and flies to any avatar within ~3 blocks, then into the inventory.
claude
added this to the v0.2 Core Feel milestone 2026-11-07 18:27:43 +00:00
__builtin:item is re-registered with a wrapped on_step. Items are kept on the plane (drops from the wall layer or the camera land where they can be reached). The nearest avatar within 3 nodes whose inventory has room pulls the item in with physics off and takes it within 0.6 nodes, with a short pickup sound. What doesn't fit stays in the world and falls again.
core.item_drop now throws items out of the avatar in its facing direction instead of from the camera, and they can't be picked up for 1.5 s, so a dropped item doesn't jump straight back.
Tests: 5 selftest cases (tests/pickup.lua): items off the plane fall back onto it, magnet range and inventory-room rules, an item flies into an avatar's inventory, partial pickup leaves the rest, the drop delay. A mutation with the magnet disabled fails the pickup case. Full suite 60/60, zero ERROR lines; CI run 19864 green.
Note for tests: item entities are static-saved, so on a headless server (no players to keep blocks active) they deactivate after a moment. The test forceloads its blocks; that's documented in DESIGN.md.
Hand check: how the pull feels (acceleration 40 n/s², max 12 n/s), and Q-dropping from the hotbar.
Done in 25a06e8.
**What changed** (`mods/strata_player/pickup.lua`)
- `__builtin:item` is re-registered with a wrapped `on_step`. Items are kept on the plane (drops from the wall layer or the camera land where they can be reached). The nearest avatar within 3 nodes whose inventory has room pulls the item in with physics off and takes it within 0.6 nodes, with a short pickup sound. What doesn't fit stays in the world and falls again.
- `core.item_drop` now throws items out of the avatar in its facing direction instead of from the camera, and they can't be picked up for 1.5 s, so a dropped item doesn't jump straight back.
**Tests**: 5 selftest cases (`tests/pickup.lua`): items off the plane fall back onto it, magnet range and inventory-room rules, an item flies into an avatar's inventory, partial pickup leaves the rest, the drop delay. A mutation with the magnet disabled fails the pickup case. Full suite 60/60, zero ERROR lines; CI run 19864 green.
**Note for tests**: item entities are static-saved, so on a headless server (no players to keep blocks active) they deactivate after a moment. The test forceloads its blocks; that's documented in DESIGN.md.
**Hand check**: how the pull feels (acceleration 40 n/s², max 12 n/s), and Q-dropping from the hotbar.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Overflow drops, and later mob or chest drops, use
__builtin:item, which is picked up relative to the hidden player body (the camera). Override the item entity so it stays on the plane and flies to any avatar within ~3 blocks, then into the inventory.Done in
25a06e8.What changed (
mods/strata_player/pickup.lua)__builtin:itemis re-registered with a wrappedon_step. Items are kept on the plane (drops from the wall layer or the camera land where they can be reached). The nearest avatar within 3 nodes whose inventory has room pulls the item in with physics off and takes it within 0.6 nodes, with a short pickup sound. What doesn't fit stays in the world and falls again.core.item_dropnow throws items out of the avatar in its facing direction instead of from the camera, and they can't be picked up for 1.5 s, so a dropped item doesn't jump straight back.Tests: 5 selftest cases (
tests/pickup.lua): items off the plane fall back onto it, magnet range and inventory-room rules, an item flies into an avatar's inventory, partial pickup leaves the rest, the drop delay. A mutation with the magnet disabled fails the pickup case. Full suite 60/60, zero ERROR lines; CI run 19864 green.Note for tests: item entities are static-saved, so on a headless server (no players to keep blocks active) they deactivate after a moment. The test forceloads its blocks; that's documented in DESIGN.md.
Hand check: how the pull feels (acceleration 40 n/s², max 12 n/s), and Q-dropping from the hotbar.