Carpet

Carpet

2M Downloads

`player('*')` can be confusing for new coders

altrisi opened this issue ยท 2 comments

commented

Even though the docs specify * means all players in the source's dimension, the asterisk notation is widely considered to "get all players", and from just looking at Scarpet code it seems like that's what it would do.

When people see that in examples or other apps they use, most directly consider that to get all players online, without knowing it will limit the result to the current dimension and without checking the docs for what seems such a simple thing that is used everywhere.

My proposal:

  • Deprecate player('*') NOT for removal (given it is and has been widely used)
  • Create a new player('dimension') (or similar) as the suggested way to replace it

Open to suggestions and comments.

commented

well, maybe I shouldn't be so stingy on limit entity API calls and add a proper player_list(.. args) instead

commented

Altrisi told me to come here and comment, because I agree. I'd expect '*' to mean "all", rather than "all in the current world".