<commit_before>/*
 * Jumping is fun. Riding pigs is even funnier!
 *
 * Learn how to make your bot interactive with this example.
 *
 * This bot can move, jump, ride vehicles, attack nearby entities and much more.
 */
var mineflayer = require('../');

if(process.argv.length < 4 || process.argv.length > 6) {
  console.log("Usage : node jumper.js <host> <port> [<name>] [<password>]");
  process.exit(1);
}

var bot = mineflayer.createBot({
  host: process.argv[2],
  port: parseInt(process.argv[3]),
  username: process.argv[4] ? process.argv[4] : "jumper",
  password: process.argv[5],
  verbose: true,
});

var target = null;

bot.on('chat', function(username, message) {
  if(username === bot.username) return;
  target = bot.players[username].entity;
  var entity;
  switch(message) {
    case 'forward':
      bot.setControlState('forward', true);
      break;
    case 'back':
      bot.setControlState('back', true);
      break;
    case 'left':
      bot.setControlState('left', true);
      break;
    case 'right':
      bot.setControlState('right', true);
      break;
    case 'sprint':
      bot.setControlState('sprint', true);
      break;
    case 'stop':
      bot.clearControlStates();
      break;
    case 'jump':
      bot.setControlState('jump', true);
      bot.setControlState('jump', false);
      break;
    case 'jump a lot':
      bot.setControlState('jump', true);
      break;
    case 'stop jumping':
      bot.setControlState('jump', false);
      break;
    case 'attack':
      entity = nearestEntity();
      if(entity) {
        bot.attack(entity, true);
      } else {
        bot.chat('no nearby entities');
      }
    case 'mount':
      entity = nearestEntity("object");<commit_msg>add missing break; in jumper.js<commit_after>/*
 * Jumping is fun. Riding pigs is even funnier!
 *
 * Learn how to make your bot interactive with this example.
 *
 * This bot can move, jump, ride vehicles, attack nearby entities and much more.
 */
var mineflayer = require('../');

if(process.argv.length < 4 || process.argv.length > 6) {
  console.log("Usage : node jumper.js <host> <port> [<name>] [<password>]");
  process.exit(1);
}

var bot = mineflayer.createBot({
  host: process.argv[2],
  port: parseInt(process.argv[3]),
  username: process.argv[4] ? process.argv[4] : "jumper",
  password: process.argv[5],
  verbose: true,
});

var target = null;

bot.on('chat', function(username, message) {
  if(username === bot.username) return;
  target = bot.players[username].entity;
  var entity;
  switch(message) {
    case 'forward':
      bot.setControlState('forward', true);
      break;
    case 'back':
      bot.setControlState('back', true);
      break;
    case 'left':
      bot.setControlState('left', true);
      break;
    case 'right':
      bot.setControlState('right', true);
      break;
    case 'sprint':
      bot.setControlState('sprint', true);
      break;
    case 'stop':
      bot.clearControlStates();
      break;
    case 'jump':
      bot.setControlState('jump', true);
      bot.setControlState('jump', false);
      break;
    case 'jump a lot':
      bot.setControlState('jump', true);
      break;
    case 'stop jumping':
      bot.setControlState('jump', false);
      break;
    case 'attack':
      entity = nearestEntity();
      if(entity) {
        bot.attack(entity, true);
      } else {
        bot.chat('no nearby entities');
      }
      break;
    case 'mount':
      entity = nearestEntity("object");
{'fraction_non_alphanumeric': 0.15369146796897443, 'fraction_numerical': 0.004596380350474002, 'mean_word_length': 2.8992161254199327, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4694847', 'n_tokens_mistral': 1119, 'n_tokens_neox': 1086, 'n_words': 284}