lar1smrqs
📎 1 file 4,650 chars
📄
pasted-code-1773965764665.txt
txt 136 lines
▶
{
  "plugin_name": "InscritosBattle",
  "description": "A Minecraft Spigot/Paper plugin that spawns custom named mobs from a config file and makes them fight each other until one winner remains, with scoreboard tracking and restart system.",
  
  "language_requirement": {
    "important": "ALL plugin messages, commands, scoreboard texts and in-game outputs MUST be in Brazilian Portuguese (pt-BR). The code and structure can be in English, but everything visible to players must be in Portuguese."
  },

  "requirements": {
    "api": "Spigot/Paper",
    "version": "1.20+",
    "performance": "Optimized, no heavy loops, use scheduled tasks",
    "mob_identification": "Use PersistentDataContainer or metadata to tag plugin mobs",
    "compatibility": "Must work in any world type (normal, superflat, amplified)"
  },

  "config_file": {
    "path": "plugins/InscritosBattle/config.yml",
    "auto_generate": true,
    "structure": {
      "mob-type": "ZOMBIE",
      "spawn-spacing": 2,
      "names": [
        "Joao",
        "Maria",
        "Pedro"
      ],
      "battle": {
        "fireworks": true,
        "sound": "ENTITY_PLAYER_LEVELUP"
      }
    }
  },

  "features": {

    "spawn_system": {
      "command": "/inscritos spawn",
      "behavior": [
        "Read all names from config.yml",
        "Spawn one mob per name",
        "Each mob must have custom name equal to the name from config",
        "Custom name must be visible",
        "Spawn mobs in a straight line in front of the player",
        "Respect 'spawn-spacing' value (1 mob per X blocks)",
        "Store all spawned mobs in an internal list",
        "Set total_mobs = number of names",
        "Set alive_mobs = number of names",
        "Initialize scoreboard"
      ]
    },

    "battle_system": {
      "command": "/inscritos batalhar",
      "behavior": [
        "Only affect mobs spawned by the plugin",
        "Make all plugin mobs aggressive toward each other",
        "They must NOT attack players",
        "They must NOT attack natural mobs",
        "Start a monitoring task (scheduler) to track alive mobs",
        "Continuously count how many plugin mobs are still alive",
        "Update alive_mobs value in real time"
      ],
      "win_condition": {
        "rule": "Trigger ONLY when exactly 1 mob remains alive",
        "important": [
          "Do NOT trigger if more than 1 mob is alive",
          "Do NOT trigger multiple times",
          "Fire only once"
        ],
        "actions": [
          "Get the last alive mob",
          "Display a Title message in Portuguese: '🏆 Vencedor: '",
          "Play configured sound",
          "If fireworks enabled: spawn fireworks around the winner"
        ]
      }
    },

    "scoreboard": {
      "title": "§a§lINSCRITOS BATTLE",
      "lines": [
        "§7Total: §f",
        "§7Vivos: §a"
      ],
      "rules": [
        "Total mobs value is FIXED after spawn",
        "Alive mobs value is DYNAMIC and must update in real time",
        "Update scoreboard when mobs die",
        "Do NOT recreate scoreboard every tick, only update values"
      ]
    },

    "restart_system": {
      "commands": {
        "/inscritos restart": [
          "Remove all plugin-spawned mobs",
          "Clear internal mob list",
          "Reset total_mobs to 0",
          "Reset alive_mobs to 0",
          "Reset scoreboard values to 0",
          "Stop any running battle task",
          "Ensure no leftover processes remain",
          "Reload config.yml"
        ],
        "/inscritos reload": [
          "Reload config.yml",
          "Update mob-type, names and settings"
        ]
      }
    },

    "item_trigger": {
      "enabled": true,
      "item": "BLAZE_ROD",
      "name": "§aInvocar Inscritos",
      "behavior": [
        "When player right-clicks, execute same logic as /inscritos spawn"
      ]
    }

  },

  "logic_rules": [
    "Only plugin mobs must be tracked and counted",
    "Use tags or persistent data to identify mobs",
    "Prevent duplication: if spawn is executed again, handle previous mobs properly",
    "Battle must be clean and controlled",
    "Victory event must happen only once",
    "Fireworks must ONLY happen when winner is defined",
    "Title message must ONLY appear when exactly 1 mob remains",
    "Scoreboard must always reflect real data",
    "All player-facing messages MUST be in Portuguese (pt-BR)",
    "Code must be clean, modular and well-structured"
  ]
}
Kodari AI
KodariMar 20 at 12:18 am 15,993 (v2)

I’ll create the InscritosBattle plugin with custom mob battles, scoreboard tracking, and Portuguese messages.

InscritosBattle
A Minecraft Spigot/Paper plugin that spawns custom named mobs from config and makes them fight each other until one winner remains. Features real-time scoreboard tracking, victory celebrations with fireworks and titles, restart system, and item-based triggering. All player-facing text in Brazilian Portuguese.

I’ll create a complete mob battle system with Portuguese messages and real-time tracking.

All files created! The InscritosBattle plugin is ready with:

✅ Spawn system - /inscritos spawn spawns mobs from config in a line formation ✅ Battle system - /inscritos batalhar makes mobs fight each other with real-time monitoring ✅ Victory detection - Triggers exactly once when 1 mob remains with title, sound, and fireworks ✅ Scoreboard - Real-time tracking of total and alive mobs ✅ Restart system - /inscritos restart cleans everything and resets values ✅ Reload - /inscritos reload reloads configuration ✅ Item trigger - Right-click BLAZE_ROD named “§aInvocar Inscritos” to spawn mobs ✅ Mob tagging - Uses PersistentDataContainer for reliable mob identification ✅ All messages in Portuguese - Commands, titles, scoreboards, and feedback in pt-BR ✅ Performance optimized - Uses schedulers, no heavy loops, efficient tracking

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
10 697
src/main/java/com/inscritos/battle/InscritosBattle.java
package com.inscritos.battle;

import com.inscritos.battle.command.InscritosCommand;
import com.inscritos.battle.listener.ItemListener;
import com.inscritos.battle.manager.BattleManager;
import com.inscritos.battle.manager.ConfigManager;
import com.inscritos.battle.manager.MobManager;
import com.inscritos.battle.manager.ScoreboardManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class InscritosBattle extends JavaPlugin {
    
    private ConfigManager configManager;
    private MobManager mobManager;
    private BattleManager battleManager;
    private ScoreboardManager scoreboardManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.configManager = new ConfigManager(this);
        this.mobManager = new MobManager(this);
        this.battleManager = new BattleManager(this);
        this.scoreboardManager = new ScoreboardManager(this);
        
        getCommand("inscritos").setExecutor(new InscritosCommand(this));
        
        Bukkit.getPluginManager().registerEvents(new ItemListener(this), this);
        
        getLogger().info("InscritosBattle ativado com sucesso!");
    }
    
    @Override
    public void onDisable() {
        if (battleManager != null) {
            battleManager.stopBattle();
        }
        if (mobManager != null) {
            mobManager.removeAllMobs();
        }
        if (scoreboardManager != null) {
            scoreboardManager.removeAllScoreboards();
        }
        
        getLogger().info("InscritosBattle desativado!");
    }
}