Half and half actually, both the server and the client has to do certain things inorder for this treasure hunt event to work, the entire process is a bit complicated and weird so to keep it short and simple:
First the server you are on reaches the designated time where it has to do a certain action, which in this case is spawning treasures for people to find.
Said server takes the amount of players that is connected to it and then uses that info in some mathematical equations to find out how many treasures it needs to spawn.
Then it uses more mathematical equations to find out where it should put each individual treasure (we will return to this point in a moment).
Now the server has done all it needs inorder to be able to do said treasure event, which means now the event will start, best thing about all of this is that nowdays the parts in the servers that makes these kind of things possible have become so powerful that all of these things are done in mere fractions of a second.
paragraph splitter
.
.
.
.
.
paragraph splitter
Now the client (Your computer) will also join the process that is going on:
The server will send out a broadcast to all the connected players that says that treasure has just washed up on the beaches.
The players go to the beach and start searching for treasure, meanwhile the server is telling the computer where on the beach the tresure chest are located and how many treasures there are, the player doesn’t see get to see this info.
When a player finds a treasure the computer tells the server that the player collected a chest that was at where ever said chest was, the server will despawn the chest and change the value on the “treasures left” counter because it was programmed to, the server will tell the computer that it acknowledges what it has been told, and then it will give the player a item as a reward for finding a chest because it was programmed to do that.
paragraph splitter
.
.
.
.
.
paragraph splitter
That’s the only parts you need to know about at the moment of how the system works,
Changing the treasures to being client side wont change much in this process, other than that now the server would be telling the clients of treasure locations only a specific player would be able to find, which means you wouldn’t be able to go over to where another person is standing and take their treasure, because the client hasn’t been told anything is there.
And the reason as to why it might be a big stress on the server if we don’t limit how many treasure it would give each client if we made the treasures client side is because the insane increase it processing that the server would need to do.
Imagine if we just changed it so that every player would be able to find the amount of treasures that usually spawn on a 30 player server, for each and every player.
Instead of just calculating and updating the position of 90 treasure chest in total it would end up having to do that with 2700 treasures since it would be giving each player 90 treasures to find.