Advice on making an efficient plugin to catch dupers and find dupe stashes?

Hello everyone! So I started a server about a month ago, and prior to that I had never programmed any plugins at all, but I already have experience programming from teaching myself C++ for 3 years, then learning java for a couple classes I had where I needed to learn Java’s syntax. I made my first custom plugin the other day, and it was surprisingly easy. See, my server was being raided by a large group on discord who were sending 50+ people in to spam the chat and try to crash the server, so I created a simple plugin that my staff can use to kick everyone who doesn’t have a rank, and to whitelist the server to only allow Donators for a short time period while they go through and IP ban everyone who was raiding the server, and spamming in chat. It was a really fun exercise actually, and I’d like to get more into making plugins.

I take the security on my server extremely seriously, I feel like I take it more seriously than some bigger servers. I always see these videos on Youtube of people destroying servers by duping and making dupe stashes all across the map, and I decided that my next plugin will be to catch these people. The way I want it to work is by basically finding any chests/containers, or player’s inventories/echests with an unusually large amount of items, and if it finds one - let’s say there is a chest somewhere on the map that has like an entire stack of crate keys - then it will log that, alert staff to the location of it, and then you can catch the duper before they even have a chance to distribute the items. There could also be a command like /finddupes and it will list off a bunch of possible places where there could be duped items, such as, “Player could possibly have duped items in their echest,” or, “Chest with possible duped items at (coordinates)”.

I’m worried about the performance of a plugin like this, I know that there are plugins like CoreProtect which store all of the data that would be needed for something like this in an efficient manner, but the main ways that I can think to do it are just by searching every player’s inventory at a set interval, and also searching every container each time a player opens one. I think this would be quite difficult, if someone could point me in the right direction or give me ideas on how I could make this plugin work efficiently, that would be great! Thank you.