How It Works
- Clone the target player's inventory and save them in an ItemStack[]
- Store that somewhere (e.g., in an inventory of a dummy entity)
- Update when changes are made to either entity
- Voila! (there are actually more steps involved but feel free to check it out yourself)
You can check it out here: https://www.curseforge.com/minecraft-bedrock/addons/invsee
Very cool!