Passing a variable vs. Storing that variable

Just as a general question I was wondering which method would be the best practice. Passing the variable containing the game world in the update function during every update of an entity, or, upon creation of the entity, store it as a variable in the entity class. I’ve used the second method before and it worked just fine. If I recall correctly minecraft uses the former of the two. What is your opinion on which is better?