Sueta
BO

BotAPI

1.1

API for Minecraft that allows you to create Bots.

·Plugin

Screenshots



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.

Usage

  • 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.
Bot Creating
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();
            }
  • 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.

Movement Types

  • 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.
  • 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.
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();
        }
    }

}
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();
            }
  • And if you want to try out the test code that is in here you can download the compiled where here.

Similar projects

Plugin →