Skip to content
Michael Zangl edited this page Jan 4, 2016 · 10 revisions

Minebot will chose a tool that is suitable for the block it attempts to destroy. Preferences can be changed using the settings file.

Tool use algorithm

To select the tool the bot should use, a factor for each property of the tool is used. The factors are all multiplied. The tool with the highest rating is used.

Properties of the tool include:

Name Description
takes_damage Tools with this property can take damage. The default is to give a factor of .99 to them to prefer undamagable items.
matches Tool matches the material.
is_enchanted The tool is enchanted. We give those tools a factor of .95 to prefer unenchanted tools.
depleted The tool has a damage value of 1 and might be destroyed on the next use.
efficiency_present Applied once if efficiency is present. Only for matching tools.
efficiency¹ Applied for each efficiency level. Only for matching tools.
silk_touch
unbreaking_present
unbreaking¹
fortune_present
fortune¹
hand The empty hand
wood Tool is made out of wood
stone Tool is made out of stone
gold Tool is made out of gold
iron Tool is made out of iron
diamond Tool is made out of diamond
sword
axe
pickaxe
shovel
fishingrod
bow
hoe
shears

Properties can be given in any boolean formula. We can use depleted&is_enchanted to rate enchanted tools down when they are depleted.

¹ When used in a boolean formula, the value will be applied as many times as the enchantment has levels.

You can edit the settings file using /minebot settings edit. Feel free to add your own rules. Here are some notes on the default rules.

{
  "takes_damage": { "defaultValue" : 0.99 },

If we have the choice beween using a normal item and a tool that would take damage, we take that normal item. So we do not use the axe to mine a stone but use the hand instead.

  "matches": {
    "defaultValue" : 2,
    "values": { 
      "minecraft:leaves" : 0.99,
      "minecraft:leaves2" : 0.99
    }
  },

If we have a matching tool we use that tool. For leaves, we do not use the matching tool. This assumes that you hold a sword in your hand and do not want it to be used.

  "is_enchanted": { "defaultValue" : 0.9 },

Enchanted tools are not used by default. They only get used if we have an advantage from using them (see below).

  "depleted&is_enchanted": { "defaultValue" : 0.1 },

An enchanted tool that is depleted (durability is 1) is not used.

  "matches&fortune": {
    "defaultValue" : 0.95,
    "values": { 
      "minecraft:emerald_ore" : 2,
      "minecraft:diamond_ore" : 2,
      "minecraft:quartz_ore" : 2,
      "minecraft:coal_ore" : 1.5,
      "minecraft:redstone_ore" : 1.5
    }
  },

Fortune tools are only used for ores. Mind that we do not use fortune_present but use the plain fortune here. This means that for a Fortune III pickaxe and diamond ore, we get a factor of 2³=8.

  "unbreaking&matches": {
    "defaultValue": 1.01
  },

We slightly prefer unbreaking tools.

  "silk_touch": {
    "defaultValue": 1.0,
    "values": {
      "minecraft:monster_egg": 100.0
    }
  },

For monster eggs, we force a use of silk touch to avoid siverfish spawning. Mind that easter eggs are normally not destroyed, you need to add it to the list of destroyable blocks for mining so that it gets destroyed.

  "silk_touch&matches": {
    "defaultValue" : 1.0,
    "values": { 
      "minecraft:dirt" : [1, 1, 1.5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
    }
  }

We use silk touch for special dirt.

}
Clone this wiki locally