A minecraft bot that can do many things.
Supports minecraft 1.11.2
Youtube demos :
- dig
- move to any not too far away position thanks to mineflayer-navigate
- repeat
- sequence
- dig a spiral staircase
- inventory management : equip,toss,list
- attack : mobs, players
- build
- find and get a block
- activate an item (shoot and arrow for example)
- follow
- build a shelter
- dig a tunnel
- raise chicken
- move by building and digging
- building things : watch then replicate
- craft
- Doing more complicated things :
- crafting things : get or craft the needed items
- getting anywhere even if it's hard (lava, water)
- building more things
- Integrate other mineflayer functionnality :
- using chests, dispensers and enchantment tables
- use vehicle
- activate block
- React to the world : for example if a mob attack the bot, the bot should defend itself
- Improve/simplify the code
First, you need to install node , you might want to read this
npm install -g rbot
or
- git clone https://github.com/rom1504/rbot.git
- cd rbot
- npm install
- If you specify a master the bot will only obey to him
rbot <host> <port> <name> <password> [<master>]
If you cloned the repo, run node rbot.js
instead.
repeat <action> done
stop repeat <action> done
do <action1> then <action2> done
: do first action then do the second oneif <condition> do <task> done
if <condition> do <task1> else <task2> done
repeat <task> until <condition> done
dig <position>
move <position>
look for <entity>
look for <block>
pos <player>
: say the position of the other player if he is not too far awaymove to <position>
: use mineflayer-navigate to get to<position>
stop move to
equip <emplacement> <item>
: equip item at emplacement (for example hand)unequip <emplacement>
toss <number> <nameItem>
toss everything
list
: list all items of the botattack <entity>
say <message>.
activate item
deactivate item
wait <milliseconds>
stop raise chicken
look at <position>
build <position>
: build at position with the equipped blockcraft <number> <nameItem>
: will craft this item if you have the required itemsup
: jump and build under the bot (but doesn't dig the bot above the bot unlike sup)jump
nothing
watch <entity>
: start watching what<entity>
is building and diggingstop watch
: stop watching and save what has been donereplicate
: redo the building and digging that has just been done (the position of the action are calculated from the position of the bot)
x+
x-
z+
z-
dig forward <position>
: dig the two block in front of the bot then move, works if there is gravel that fallspiral up
: dig an ascending spiral staircasespiral down
: dig a descending spiral staircaseraise chicken
: get an egg then throw itshoot <entity>
: if it has a bow and arrows, shoot<entity>
follow <position>
: go to<position>
every 2 secget <nameBlock>
: go to a position next to nearest<nameBlock>
then dig itbuild shelter
: build a very simple shelter with the equipped block (need 25 blocks)destroy shelter
: destroy this sheltercome
:move to me
attack everymob
: kill any close mobscome
: move to you by digging and buildingdown
: move down of one blocksup
: move up of one blocksget <blockName>
: get a block by building and diggingsmove <position>
:repeat ssumove <position> until at <position> done
: if the position is too far ssumove can't calculate it because it doesn't know the blocks that farssumove <position>
: get to the position by building and digging using a-star to avoid bedrocksumove <position>
: move of 1 in the direction of the position by building and diggingimmure <position>
cget <number> <nameItem>
: get the item using sget and craft commandsgive <position> <number> <item>
give <position> everything
sdig <position>
: repeat ssdig until it's donessdig <position>
: dig safelyachieve <condition>
: achieve<condition>
using the related action
<item>
can be :item to build
tool to break <nameBlock>
<nameItem>
<position>
can be :rx,y,z
: relative position<absolute position>
rx,y,z+<absolute position>
nearest reachable position <position>
<absolute position>
can be :x,y,z
: absolute positionadapted <entity>
: adapted position for shooting with a bow<entity>
<block>
<block>
can be :nearest block <nameBlock>
nearest block *: any nearest block
<entity>
can be :nearest mob <mob>
nearest mob *
: any nearest mobnearest visible mob <mob>
nearest visible mob *
: any nearest visible mobnearest reachable mob <mob>
nearest reachable mob *
: any nearest reachable mobnearest object <object>
nearest object *
: any nearest objectnearest reachable object <object>
nearest reachable object *
: any nearest reachable objectme
bot
player <playerName>
<mob>
can be :spider
enderman
creeper
- ...
<condition>
can be :at <position>
have <number> <nameItem>
close of <blockName>
<position> is empty
<position> is not empty
repeat spiral down done
: build a spiral staircase from y=64 to y=0attack everymob
: attack mobs close from the mobrepeat dig forward r0,0,1 done
: if you want to build a tunnel (not stopped by gravel, but can die from drowning)come
scome
repeat do raise chicken then wait 1000 done done
stop repeat do raise chicken then wait 1000 done done
repeat look at me done
repeat shoot nearest reachable mob done
: kill close mobsrepeat shoot me done
: kill youmove to nearest reachable position nearest block log
follow me
stop follow me
get log
repeat do build shelter then destroy shelter done done
: fun