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

Bot can attack through blocks #52

Open
AidenRaaphorst opened this issue Jul 10, 2022 · 0 comments
Open

Bot can attack through blocks #52

AidenRaaphorst opened this issue Jul 10, 2022 · 0 comments

Comments

@AidenRaaphorst
Copy link

The bot can still hit me when encased in blocks like this.
image

Even when adding another layer on the sides and on top and closing the hole, the bot still hits me through the blocks.
image

This is the code, it's the same as the example in the readme, but I added semicolons and changed bot to this.bot because it's in a class.

this.bot.on('chat', (username, message) => {
  if (message === 'fight me') {
    const player = this.bot.players[username];
    
    if (!player) {
      this.bot.chat("I can't see you.");
      return;
    }
  
    this.bot.pvp.attack(player.entity);
  }
  
  if (message === 'stop') {
    this.bot.pvp.stop();
  }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant