ModsJava
BotAPI
Java mod listed for Minecraft 1.8–1.9. Download on the author's site.
⬇ Download on SpigotScreenshots
Bot Movement Gif
Dependencies
Description
Bot Movement Gif
Dependencies
Description
- This API allows you to create Bots really easy.
- All it takes is couple of lines of code and you will have a working bot.
- For the bot movement you can choose between pre made MovementTypes or just create you're own.
- I haven't tested alot of the minecraft version's but it should work on most of them as long as protocollib is supported on that version.
- For this API to work you will need to have it in you're plugins folder
- and you will need to have it added as a dependency in your project aswell as in the plugin.yml
- Now im going to give you an example on how to make a simple bot.
Spoiler: Bot Creating
Code (Text):
try {
Bot bot = new Bot(player.getLocation(), player, MovementCircleAround.class, new BotActionHandler() {
@Override
public void onAttacked(Bot bot, Player player) {
player.sendMessage("You just killed the bot.");
bot.despawn();
}
}).equipRandomArmor().equipRandomItem();
} catch (ExceptionBotAlreadyExists exceptionBotAlreadyExists) {
exceptionBotAlreadyExists.printStackTrace();
}
Bot bot = new Bot(player.getLocation(), player, MovementCircleAround.class, new BotActionHandler() {
@Override
public void onAttacked(Bot bot, Player player) {
player.sendMessage("You just killed the bot.");
bot.despawn();
}
}).equipRandomArmor().equipRandomItem();
} catch (ExceptionBotAlreadyExists exceptionBotAlreadyExists) {
exceptionBotAlreadyExists.printStackTrace();
}
- You can make the bot equip random armor by doing equipRandomArmor() and you can make him equip random held item with equipRandomItem()
- But if random armor or held items in not what you want you can give him what ever ItemStack for armor or held item you want.
- What is a Movement Type?
- Movement type is a way for the Bot to move.
- Are there any pre made Movement Types?
- Yes there are there are 3 pre made movement types that you can use
- MovementCircleAround
- This Movement Type will make the bot move around the player in circle much like the Watchdog bot on Hypixel.
- MovementBehindPlayer
- This Movement Type will try to move the bot behind the player constantly.
- MovementSpaz
- This Movement Type will move the bot to the random positions around the player.
- MovementCircleAround
- Yes there are there are 3 pre made movement types that you can use
- But can i create my Movement Types?
- Yes you can create you're custom movement types.
- It is really easy to do you just need to extend a class with MovementType and you will be presented with a constructor that takes in 2 parameters and with a run method.
Spoiler: Custom MovementType
public class MyMovement extends MovementType {
public MyMovement(Player target, Bot bot) {
super(target, bot);
}
@Override
public void run() {
try {
Player target = getTarget();
Bot bot = getBot();
bot.swing();
bot.teleport(target.getLocation());
} catch (Exception e) {
this.getBot().getTask().cancel();
}
}
}
Code (Text):
public class MyMovement extends MovementType {
public MyMovement(Player target, Bot bot) {
super(target, bot);
}
@Override
public void run() {
try {
Player target = getTarget();
Bot bot = getBot();
bot.swing();
bot.teleport(target.getLocation());
} catch (Exception e) {
this.getBot().getTask().cancel();
}
}
}
Code (Text):
try {
Bot bot = new Bot(player.getLocation(), player, MyMovement.class, new BotActionHandler() {
@Override
public void onAttacked(Bot bot, Player player) {
player.sendMessage("You just killed the bot.");
bot.despawn();
}
}).equipRandomArmor().equipRandomItem();
} catch (ExceptionBotAlreadyExists exceptionBotAlreadyExists) {
exceptionBotAlreadyExists.printStackTrace();
}
Bot bot = new Bot(player.getLocation(), player, MyMovement.class, new BotActionHandler() {
@Override
public void onAttacked(Bot bot, Player player) {
player.sendMessage("You just killed the bot.");
bot.despawn();
}
}).equipRandomArmor().equipRandomItem();
} catch (ExceptionBotAlreadyExists exceptionBotAlreadyExists) {
exceptionBotAlreadyExists.printStackTrace();
}
- And if you want to try out the test code that is in here you can download the compiled where here.
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 1.8, 1.9
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
BotAPI is a free Minecraft Java mod. Compatible with Minecraft 1.8, 1.9. Downloaded 852 times (via Spigot). Download it and open it directly in the game.