When an emerald is placed inside any item frame, it collects nearby items within a 33×33×33 area to its own location.
When an item frame containing an emerald is attached to a chest, barrel, or shulker box, it will only collect item types that already exist in the attached container. If attached to an empty container, no items will be collected.
If multiple "universal CollectEmeralds" exist around an item entity, the item will be collected by the nearest CollectEmerald. If multiple valid "container CollectEmeralds" exist, the item will split into several item entities and be evenly collected by them.
If both a "universal CollectEmerald" and a "container CollectEmerald" exist around an item entity, the item will first be collected by the former, then redistributed by the latter.