I would imagine that part of the validate statement saying whether or not we are ready to execute involves making sure the character is within a certain area which means the area and objects should have loaded.
Those videos and tutorials don't really touch what I think is important most times. What one should really focus on is learning methodologies of software development, learning how to gauge software quality, learning how to conduct software tests, project management, etc.
I can confirm this issue similarly as well. In order to consistently NOT get NPE I null check the name, and definition using stream.
So something like:
objects.getAll().stream().filter(w -> w.getDefinition() != null && w.getDefinition().getName() != null)
Then you can obviously add something to the effect of
w.getDefinition.getName().equalsIgnoreCase("your filter")
From there you can use .sorted() and a good lamda expression to sort by distance however you may like.
Hope that helps.
PM me with the details. Depending if I'm on or not, you might have to wait a couple of hours.
By details do you mean the account details or object ids and such? Do you want us to leave it in there for you to solve?