martinnicox2020-code

Mr butterfly es una entidad alto y delgado con múltiples de ojos en su cuerpo que solamente aparece en la noche a las 3:am y también Mr butterfly puede crear neblina y también Mr butterfly puede desaparecer aldeanos cuando es de noche y aparece Mr butterfly a las 3:am también Mr butterfly puede telestransportar al Jugador para comunicarse con el jugador Steve en el chat de Minecraft como una inteligencia artificial pero tenemos a Mr duck es un ayudante del jugador Steve y Mr duck aparece al principio del juego Mr duck y también se puede chatear con Mr duck en el chat de Minecraft y Mr duck es una Inteligencia artificial para poder chatear con el y tiene mucha información y Mr duck también puede detectar diamantes y también Mr duck puede seguirle al jugador Steve para poder ayudar al jugador Steve y Mr duck solamente aparece en el inicio del juego cuando empezas el juego de Minecraft y Mr duck aparece en el inicio de Minecraft y también cuando le decís el nombre "Mr butterfly" muchas veces Mr butterfly aparece enojado y después te ataca y también Mr butterfly puede imitar mobs de Minecraft para confundir a los jugadores en Minecraft pero cuando los golpeas se transforma en Mr butterfly

Kodari AI
KodariJun 25 at 1:20 am 55
MrButterflyPlugin
A horror-themed Minecraft plugin featuring two AI entities: Mr Butterfly — a tall, thin Enderman-like creature with multiple glowing eyes that spawns at 3 AM, creates fog, banishes villagers, disguises as other mobs, teleports players, and attacks when provoked by its name; and Mr Duck — a friendly companion Chicken that spawns on first join, follows the player, detects nearby diamonds, and holds intelligent chat conversations with keyword-based AI responses.

Here’s what the plugin contains:


🦋 Mr Butterfly

  • Spawns at 3 AM (in-game time ~21000) in every normal world near a random player

  • Glowing eyes — 8 WITCH particles placed around the Enderman body every 5 seconds

  • Fog creation — CLOUD particles surround any player within 30 blocks

  • Villager removal — despawns all villagers within range on spawn and each tick

  • Mob disguise — turns invisible, spawns a random hostile mob in its place; hitting the imposter triggers a dramatic reveal with lightning + scream

  • Player teleportation — randomly teleports a player next to it with a chat message

  • Anger system — saying “mr butterfly” in chat 3 times (configurable) activates it, making it sprint at the player with Strength III + Speed III

  • Chat AI — type @butterfly <message> to get cryptic, threatening responses while it’s present

  • Despawns at dawn — disappears when night ends, leaving only a farewell message

🐥 Mr Duck

  • Spawns once on first-ever join with a full introduction; respawns every session

  • Follows player — uses velocity-based movement, teleports if too far away

  • Diamond detection — scans a 10-block radius every 10 seconds and alerts the player

  • Extensive Chat AI — type duck <message> for responses on: diamonds, food, survival, crafting, mobs, nether, end, history, enchanting, potions, biomes, and more

  • Respawns on death — drops nothing, returns after 4 seconds

  • Scared of Mr Butterfly — has special fearful responses when “butterfly” is mentioned

Kodari can make mistakes. Review important code before using.
Files
src
Code
11 1,281
src/main/java/com/kodari/mrbutterfly/MrButterflyPlugin.java
package com.kodari.mrbutterfly;

import com.kodari.mrbutterfly.ai.ChatAI;
import com.kodari.mrbutterfly.listener.ChatListener;
import com.kodari.mrbutterfly.listener.EntityListener;
import com.kodari.mrbutterfly.listener.PlayerListener;
import com.kodari.mrbutterfly.manager.ButterflyManager;
import com.kodari.mrbutterfly.manager.DuckManager;
import com.kodari.mrbutterfly.task.ButterflyTask;
import com.kodari.mrbutterfly.task.DuckTask;
import org.bukkit.plugin.java.JavaPlugin;

public class MrButterflyPlugin extends JavaPlugin {

    private ButterflyManager butterflyManager;
    private DuckManager duckManager;
    private ChatAI chatAI;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        getDataFolder().mkdirs();

        this.chatAI = new ChatAI(this);
        this.butterflyManager = new ButterflyManager(this);
        this.duckManager = new DuckManager(this);
        duckManager.loadData();

        getServer().getPluginManager().registerEvents(new ChatListener(this), this);
        getServer().getPluginManager().registerEvents(new EntityListener(this), this);
        getServer().getPluginManager().registerEvents(new PlayerListener(this), this);

        new ButterflyTask(this).runTaskTimer(this, 100L, 100L);
        new DuckTask(this).runTaskTimer(this, 20L, 20L);

        getCommand("mrbutterfly").setExecutor((sender, cmd, label, args) -> {
            if (!sender.hasPermission("mrbutterfly.admin")) {
                sender.sendMessage("§cNo permission.");
                return true;
            }
            if (args.length == 0) {
                sender.sendMessage("§5Usage: /mrbutterfly <status|spawn|despawn>");
                return true;
            }
            switch (args[0].toLowerCase()) {
                case "status":
                    getServer().getWorlds().forEach(w -> {
                        boolean present = butterflyManager.isPresent(w);
                        sender.sendMessage("§5World §d" + w.getName() + "§5: Butterfly " + (present ? "§aACTIVE" : "§7INACTIVE") + " §5| Time: §d" + w.getTime());
                    });
                    break;
                case "spawn":
                    if (sender instanceof org.bukkit.entity.Player) {
                        org.bukkit.entity.Player p = (org.bukkit.entity.Player) sender;
                        butterflyManager.forceSpawn(p.getWorld());
                        sender.sendMessage("§5Mr Butterfly has been summoned.");
                    }
                    break;
                case "despawn":
                    butterflyManager.despawnAll();
                    sender.sendMessage("§5Mr Butterfly has been banished.");
                    break;
                default:
                    sender.sendMessage("§5Usage: /mrbutterfly <status|spawn|despawn>");
            }
            return true;
        });

        getLogger().info("[MrButterflyPlugin] Mr Butterfly awakens... and Mr Duck stands guard.");
    }

    @Override
    public void onDisable() {
        butterflyManager.despawnAll();
        duckManager.saveData();
        duckManager.despawnAll();
        getLogger().info("[MrButterflyPlugin] Mr Butterfly has vanished into the void.");
    }

    public ButterflyManager getButterflyManager() {
        return butterflyManager;
    }

    public DuckManager getDuckManager() {
        return duckManager;
    }

    public ChatAI getChatAI() {
        return chatAI;
    }
}