[solved] Get chest from inventory

Hi! I want to track taken items from a chest for a small protection-plugin. I thought about going into the InteractInventoryEvent, but I only get the inventory / container from it and the player from the cause.

How can I get the related chest from the event or inventory to store the transaction with the chests coordinates, or is there even a better way to solve this? Thanks!

Check if the inventory/container is a CarriedInventory then check for a BlockCarrier.