So basically, when I deploy an item, I'd like to be able to check if it was a codelock or a keylock, and if so, put all that information - kind (CodeLock/KeyLock), who put it down, and the timestamp - into the cache/stored data. Then, every minute or so, the plugin will go through all the codelocks/keylocks on the server, and based on the settings (time to decay), it will unlock those that have exceeded the maximum amount of minutes between the timestamp (which gets updated every time someone succesfully accesses the container / opens the door with the lock on) and the current timestamp.
I haven't even started on the cache/data/config yet, before all that, I just want to make sure I can get consistent results. I thought InstanceID might be it. Apparently it's not. I wanted to see what the InstanceID of the Deployer object was. Instantly after dealing with it, in the "test" section, its InstanceID won't show up later in the foreach statement.
Is my only option basically taking the Vector3 position of the entity and use that as a Hash key for the cache/stored data? What would that key look as plain text when JSON-ised to stored? Position is the only thing that I can think of that would stay consistent at all times, even when removed/placed again. Let me know if you got better ideas, thanks!