Imagine you have something like cities, defined by x and y coordinates. Everytime a Player goes into a city, there should be a message, informing him that he has jhust entered / left city X.
So without crawling thorugh docs, I know that there is something like a onPlayerMove event, which fires if the player’s / entitiy’s location changes.
Normally I would get the new coordinates / location from the event and validate, if they are inside a certain area, that is also defined by x and y (of course) - probably I would have a list, containing Location objects and everytime a player moves I would have to loop through and check every object’s coordinates to know, if a player is inside it.
If so, a message shows up (I think I made my idea clear).
The thing is, that I’m very concerned, if this is the right way to implement it. Unfortunately, I can’t think of another possible way of realizing this feature.
So is it fine to do this like I initially wanted to, or are there way better solutions?