Entity automation
Use entity.capability(host, &ENTITY_AUTOMATION, side) to access the inventory an
entity exposes to hoppers and droppers. This is NeoForge's
Capabilities.Item.ENTITY_AUTOMATION, distinct from the broader
ENTITY_ITEMS capability.
Register a provider with
r.entity_capability(&ENTITY_AUTOMATION, "mymod:robot", |host, robot, side| …).
Use r.entity_capability_before_game to answer ahead of the game's provider for
a minecart or boat. The context is Option<Direction>; None means no particular side.
Game providers and transfers
- Chest and hopper minecarts and chest boats expose their container slots.
- Players and chested donkeys, mules and llamas have no game-provided automation handler.
- A pushing hopper requests the side it reaches the entity from (
Upwhen the hopper is above it). A pulling hopper requestsDownfrom the entity above it. A dropper requests the side it drops onto. - At a target, automation chooses randomly among the game's container entities
and entities whose mod providers answer this capability, using vanilla's
getEntityContainerselection draw. - A mod handler takes the container's place. Automation moves one item per
transfer in a transaction, as it does through a block's
ITEMShandler.