[SOLVED] Get all chests on the map

Hello!
I creating Battle Royale Server.
And I have chest on the map.
How I can get all chest on the map?

Do you know the bonds of your battle royal map?

Also why do you need to know all the locations of chests?

You could get all TileEntity in the world that are Chest (world.getTileEntities()) and then cast them to the appropriate class.

Just be aware that this only returns tile entities in loaded areas of the world. You’ll probably want to make sure the entire arena is loaded if it’s large enough.