temichklevez

Develop a Minecraft plugin that introduces a new mob called the Bullfly, which is slightly smaller than a bee and primarily targets cows, horses, and sheep. The Bullfly should spawn near bodies of water in swarms, inflict players with poison and hunger upon attack, and generate a Bullfly larva from any mob it kills, which matures into an adult Bullfly after one in-game day. Include customizable spawn rates and effects, along with permission nodes for players to manage interactions with Bullflies.

Kodari AI
KodariApr 18 at 10:03 am 16,890 (v2)

I’ll create a custom mob plugin introducing the Bullfly - an aggressive flying insect that spawns near water and targets livestock.

BullflyPlugin
A custom mob plugin introducing the Bullfly - aggressive flying insects that spawn in swarms near water, attack livestock and players with poison and hunger effects, and reproduce through larvae that mature over time. Features customizable spawn rates, effects, and targeting behaviors. Includes admin commands and permission controls for managing Bullfly populations and player interactions. Supports cross-version compatibility for Minecraft 1.8-1.21+.

Now I’ll create the complete plugin structure:

I need to add missing imports to one of the task files:

BullflyPlugin has been successfully created! The plugin introduces custom Bullfly mobs that:

Core Features:

  • Spawn naturally near water in swarms (3-7 Bullflies)

  • Use Bat entities for flying behavior (small and agile)

  • Target livestock (cows, horses, sheep) within 16 blocks

  • Attack players within 8 blocks with poison and hunger effects

  • Spawn larvae (Silverfish entities) when killing target mobs

  • Larvae mature into adult Bullflies after 1 in-game day (24,000 ticks)

Configuration Options:

  • Adjustable spawn rates, intervals, and swarm sizes

  • Customizable poison/hunger duration and amplifiers

  • Configurable target mobs and ranges

  • Max Bullflies per world limit

  • Larva maturation time

  • Health, damage, and speed multipliers

Commands:

  • /bullfly spawn <amount> - Spawn Bullflies

  • /bullfly spawnlarva - Spawn a larva

  • /bullfly reload - Reload configuration

  • /bullfly clear [radius] - Remove Bullflies

  • /bullfly info - Display plugin statistics

Permissions:

  • bullfly.admin - Full access

  • bullfly.spawn, bullfly.reload, bullfly.clear - Specific commands

  • bullfly.immune - Immunity to Bullfly attacks

The plugin uses XSeries for cross-version compatibility (1.8-1.21+) and includes intelligent AI for targeting, swarm spawning mechanics, and a complete lifecycle system from larva to adult.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
14 1,109
src/main/java/com/bullfly/BullflyPlugin.java
package com.bullfly;

import com.bullfly.command.BullflyCommand;
import com.bullfly.listener.BullflyListener;
import com.bullfly.manager.BullflyManager;
import com.bullfly.manager.ConfigManager;
import com.bullfly.manager.LarvaManager;
import com.bullfly.task.BullflyAITask;
import com.bullfly.task.BullflySpawnTask;
import com.bullfly.task.LarvaMaturationTask;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class BullflyPlugin extends JavaPlugin {

    private ConfigManager configManager;
    private BullflyManager bullflyManager;
    private LarvaManager larvaManager;
    
    private BullflySpawnTask spawnTask;
    private BullflyAITask aiTask;
    private LarvaMaturationTask maturationTask;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.configManager = new ConfigManager(this);
        this.bullflyManager = new BullflyManager(this);
        this.larvaManager = new LarvaManager(this);
        
        getServer().getPluginManager().registerEvents(new BullflyListener(this), this);
        
        BullflyCommand commandExecutor = new BullflyCommand(this);
        getCommand("bullfly").setExecutor(commandExecutor);
        getCommand("bullfly").setTabCompleter(commandExecutor);
        
        startTasks();
        
        getLogger().info("BullflyPlugin has been enabled!");
    }

    @Override
    public void onDisable() {
        stopTasks();
        bullflyManager.cleanup();
        larvaManager.cleanup();
        getLogger().info("BullflyPlugin has been disabled!");
    }
    
    private void startTasks() {
        if (configManager.isSpawnEnabled()) {
            this.spawnTask = new BullflySpawnTask(this);
            spawnTask.runTaskTimer(this, 100L, configManager.getSpawnInterval());
        }
        
        this.aiTask = new BullflyAITask(this);
        aiTask.runTaskTimer(this, 20L, 20L);
        
        if (configManager.isLarvaEnabled()) {
            this.maturationTask = new LarvaMaturationTask(this);
            maturationTask.runTaskTimer(this, 1200L, 1200L);
        }
    }
    
    private void stopTasks() {
        if (spawnTask != null) {
            spawnTask.cancel();
        }
        if (aiTask != null) {
            aiTask.cancel();
        }
        if (maturationTask != null) {
            maturationTask.cancel();
        }
    }
    
    public void reload() {
        reloadConfig();
        configManager.reload();
        stopTasks();
        startTasks();
    }
}