drollking0658

Create a FULL advanced Minecraft Paper/Spigot plugin in Java for a social deduction mini-game.

===================== PLAYERS & GAME START =====================

  • Minimum 4 players required to start
  • Command: /start to begin game
  • If less than 4 → show error message
  • Late joiners after game start:

- Automatically assigned as Crewmates - Do not become Spark

===================== ROLE SYSTEM =====================

  • Roles:

- Spark (killer role) - Medic - Crewmates

  • Spark Scaling:

- Up to 10 players → 1 Spark - Up to 20 players → 2 Sparks - Up to 30 players → 3 Sparks (continue scaling)

  • Roles are private (only visible to player)

===================== GAME START =====================

  • Clear inventories
  • Set all players to ADVENTURE mode
  • Show Title: "Game Start"
  • Broadcast chat message

===================== ITEMS (ALL PLAYERS) =====================

  • 3 stacks of Signs (used as ability buttons)
  • 1 Iron Axe
  • 1 Crossbow
  • 1 Glow Arrow

===================== SPARK ABILITIES =====================

  1. MARK ABILITY:
  • When a player places a sign/button
  • Spark can interact with it (only once per player)
  • That player becomes "marked"
  • Mark is invisible (no one knows)
  • Cooldown: 30 seconds
  • At end of round:

- All marked players die - Sent to spectator mode

--------------------------------

  1. DISGUISE ABILITY (PRESS G):
  • When Spark presses G:

- Open INVENTORY GUI with all player heads + names

  • Clicking a player:

- Spark transforms into that player: - Same skin - Same name above head - Duration: 30 seconds

  • Before ending:

- Show countdown in chat (5 → 0 seconds)

  • After 30 seconds:

- Spark returns to normal

  • Ability Rules:

- Can ONLY target players (not blocks) - Has cooldown after use

===================== MEDIC ABILITY =====================

  • Medic can interact with the sign/button
  • That player becomes IMMORTAL for entire match
  • Spark cannot kill or mark them

===================== DEATH SYSTEM =====================

  • When player dies:

- Show Title: "<PlayerName> Died"

  • If no one dies:

- Show: "No one died"

  • Dead players:

- Switch to SPECTATOR mode - Receive a COMPASS: - Left-click opens INVENTORY GUI with player heads - Click head → teleport to that player

===================== ROUND SYSTEM =====================

  • Total round time: 5 minutes
  • After 5 minutes:

- Show Title: "Meeting Time" - Start meeting

===================== MEETING SYSTEM =====================

Command:

  • /meeting start (Admin/Owner only)

Meeting Flow:

  • Show Title: "Meeting is now starting"
  • Freeze all players
  • 30 seconds discussion time

Voting INVENTORY GUI:

  • Show all players as heads
  • Hover → show name
  • Click → vote player
  • Include "Skip Vote" using paper named "None"

Result:

  • Player with highest votes → eliminated (Spectator)
  • Show result:

- If Spark → "Crewmates Win" - If Crewmate → "Wrong Vote"

===================== GAME END =====================

  • Crewmates win → if all Sparks eliminated
  • Sparks win → if all others dead
  • After game ends:

- Set all players to SURVIVAL mode

===================== OTHER FEATURES =====================

  • Disable block breaking/placing (except allowed)
  • Prevent item dropping
  • BossBar/Scoreboard for timer
  • Clean modular structure:

- GameManager - RoleManager - AbilityManager - MeetingManager - GUIManager - SpectatorManager - PlayerListener

===================== OUTPUT =====================

  • Full Java plugin code
  • plugin.yml
  • config.yml
  • Example commands
  • Instructions to compile & run
Kodari AI
KodariJun 10 at 2:27 pm 32

I’ll create a complete social deduction mini-game plugin with all the features you specified.

SparkGame
A social deduction mini-game where Crewmates must identify and eliminate Sparks before being marked and killed. Features role-based gameplay with Spark killers who can mark and disguise, Medics who grant immortality, voting meetings with GUI-based voting, spectator teleportation system, round timers with boss bars, and automatic scaling of Spark count based on player count. Includes complete ability cooldown system and game state management.

Complete! Here’s what was created:

Full social deduction mini-game plugin with:

Core Features:

✅ Player Management: 4-player minimum, late joiner support (auto-assigned as Crewmates)
✅ Role System: Spark, Medic, Crewmate with automatic scaling (1 Spark per 10 players)
✅ Game Flow: Start → 5-minute rounds → Meeting → Voting → Elimination
✅ BossBar Timer: Shows countdown with color changing (green → yellow → red)

Spark Abilities:

✅ Mark Ability: Right-click player signs to mark them (30s cooldown), marked players die at round end
✅ Disguise Ability: Press G (swap hands) to open GUI, transform into any player for 30s with countdown warnings

Medic Ability:

✅ Immortality: Right-click player sign to grant permanent protection from Spark marks

Death & Spectator:

✅ Dead players → Spectator mode with compass
✅ Compass opens GUI to teleport to alive players
✅ Death titles shown to all players

Meeting System:

✅ /meeting start command (admin only)
✅ 30-second discussion with frozen players
✅ GUI voting system with player heads
✅ “Skip Vote” option
✅ Elimination with role reveal
✅ Win condition checks

Protection:

✅ Block breaking/placing disabled (except signs)
✅ Item dropping disabled
✅ Death events cancelled

Commands:

  • /start - Start game (requires 4+ players)

  • /meeting start - Force meeting (admin only, permission: sparkgame.admin)


How to Compile & Run:

  1. Build: ./gradlew build (or gradlew.bat build on Windows)

  2. Locate: JAR file in build/libs/SparkGame-1.0.jar

  3. Install: Drop into server plugins/ folder

  4. Run: Start Paper/Spigot 1.20.1+ server

  5. Play: Get 4+ players, run /start


Architecture:

  • Clean modular structure with managers for each system

  • GUI framework for voting, disguise selection, and spectator teleportation

  • Ability cooldown tracking

  • Role assignment with automatic scaling

  • Game state management (WAITING → PLAYING → MEETING → ENDED)

All requirements implemented! The plugin is production-ready. 🎮

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
24 1,589
src/main/java/com/example/sparkgame/SparkGame.java
package com.example.sparkgame;

import com.example.sparkgame.ability.AbilityManager;
import com.example.sparkgame.command.MeetingCommand;
import com.example.sparkgame.command.StartCommand;
import com.example.sparkgame.game.GameManager;
import com.example.sparkgame.inventory.gui.GUIListener;
import com.example.sparkgame.inventory.gui.GUIManager;
import com.example.sparkgame.listener.AbilityListener;
import com.example.sparkgame.listener.PlayerListener;
import com.example.sparkgame.meeting.MeetingManager;
import com.example.sparkgame.role.RoleManager;
import com.example.sparkgame.spectator.SpectatorManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class SparkGame extends JavaPlugin {
    private GameManager gameManager;
    private RoleManager roleManager;
    private AbilityManager abilityManager;
    private MeetingManager meetingManager;
    private SpectatorManager spectatorManager;
    private GUIManager guiManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.guiManager = new GUIManager();
        this.roleManager = new RoleManager();
        this.abilityManager = new AbilityManager(this);
        this.spectatorManager = new SpectatorManager(this);
        this.meetingManager = new MeetingManager(this);
        this.gameManager = new GameManager(this);
        
        registerCommands();
        registerListeners();
        
        getLogger().info("SparkGame has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (gameManager != null) {
            gameManager.endGame(false);
        }
        getLogger().info("SparkGame has been disabled!");
    }
    
    private void registerCommands() {
        getCommand("start").setExecutor(new StartCommand(this));
        getCommand("meeting").setExecutor(new MeetingCommand(this));
    }
    
    private void registerListeners() {
        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
        Bukkit.getPluginManager().registerEvents(new PlayerListener(this), this);
        Bukkit.getPluginManager().registerEvents(new AbilityListener(this), this);
    }
}