Welcome to the forum! Thanks for taking the time to learn how to post code correctly. If you haven't already, please read this topic
to learn other useful info for new members.
In Java, 'functions' are called methods. Please try to communicate in sentences that clearly communicate the requirements you are trying to code.
I would like the array to be static for the subclasses of Entity, and to not be static for Entity itself.
I think you can accomplish this by creating a static array in a subclass of Entity and then subclass the new class. With some additional code, the parent class Entity could have access to the same array, but I'm not sure it's needed or worth the trouble of keeping it up to date (synchronized).
In the end, I think your imagined design can be simplified to overcome the problems you anticipate, but it is difficult to understand your question, since the requirements are not clearly stated.