Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting players from Tablist using nameOnTablist() #3404

Open
PeterTTTW opened this issue Jun 21, 2024 · 0 comments
Open

Getting players from Tablist using nameOnTablist() #3404

PeterTTTW opened this issue Jun 21, 2024 · 0 comments
Labels
possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f

Comments

@PeterTTTW
Copy link

PeterTTTW commented Jun 21, 2024

Detailed description of a problem

Hello, i wanted to use the provided code for getting players from the tablist. The code i used was from (https://github.com/u9g/mineflayer-docs/blob/main/common-tasks/reading-the-tab-list.md). As soon as i ran the code this issue came up. I used it in bot.on("spawn"), so thats not the problem.
const name = player.nameOnTablist()
^
TypeError: player.nameOnTablist is not a function

What did you try yet?

tried writing it a bit differnt, changed player.nameOnTablist(), to bot.players.OnTablist, gave error to.String() cant read properties of to.String

Your current code

for (const player of Object.values(bot.players)) {
  const name = player.nameOnTablist()
  if (!name) continue
  console.log(name.toString())
}
@PeterTTTW PeterTTTW added possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f labels Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f
Projects
None yet
Development

No branches or pull requests

1 participant