adrian054273

among us plugin

Kodari AI
KodariJan 23 at 7:45 pm 10,328 (v2)

I’ll create an Among Us plugin for Minecraft with game mechanics including roles, tasks, voting, and kill systems.

AmongUsMC
A Minecraft recreation of the popular social deduction game Among Us. Players are assigned roles as Crewmates or Impostors in custom arenas. Crewmates must complete tasks while Impostors attempt to eliminate them. Features include task completion tracking, emergency meetings, voting system, kill cooldowns, sabotage mechanics, and fully customizable game arenas. Supports multiple simultaneous games and spectator mode.

Among Us plugin created with complete game mechanics! Features include:

Core Systems:

  • Role assignment (Crewmates/Impostors)

  • Task completion system

  • Emergency meetings with discussion & voting phases

  • Kill mechanics with cooldowns

  • Win condition checking

  • Multiple simultaneous games support

Commands:

  • /amongus create/join/leave/list - Game management

  • /task - Complete tasks (crewmates)

  • /meeting - Call emergency meeting

  • /vote <player> - Vote during meetings

  • /kill <player> - Impostor kill ability

Features:

  • Configurable player counts, impostor ratio, timers

  • Kill cooldowns and distance checks

  • Voting system with tie detection

  • Win conditions (tasks complete/impostors eliminated/impostors win)

  • Auto game cleanup

Ready to test on your server!

adrian054273

The compilation failed with this error:

code
Validation failed for compilation: Compilation failed with 1 error(s):

ERROR in src/main/java/com/amongusmc/game/Game.java at line 264: incompatible types: invalid method reference
        players.keySet().forEach(plugin.getGameManager()::removePlayerFromGame);
                                 ^


=== COMPILATION ERROR ANALYSIS ===

TYPE MISMATCHES:
  - incompatible types: invalid method reference
ACTION: Fix variable types or casting

FILES TO INVESTIGATE:
  - src/main/java/com/amongusmc/game/Game.java
 exceeds maximum 

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariJan 27 at 1:33 pm 7,262 (v2)

I need to read the relevant files to understand the method signatures and fix the type mismatch.

Now I can see the issue. The removePlayerFromGame method expects a Player parameter, but players.keySet() contains UUID objects. I need to fix this by converting the UUID to a Player or using a lambda that handles the conversion.

Analysis:

  • Line 264 tries to use method reference plugin.getGameManager()::removePlayerFromGame

  • removePlayerFromGame(Player player) expects a Player object

  • players.keySet() contains UUID objects, not Player objects

  • Need to convert UUID to Player before calling the method

Fixed the type mismatch by converting UUID to Player before calling removePlayerFromGame. The method now properly resolves each UUID to a Player object using Bukkit.getPlayer(uuid) before passing it to the GameManager method.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
15 987
src/main/java/com/amongusmc/AmongUsMC.java
package com.amongusmc;

import com.amongusmc.commands.AmongUsCommand;
import com.amongusmc.commands.KillCommand;
import com.amongusmc.commands.MeetingCommand;
import com.amongusmc.commands.TaskCommand;
import com.amongusmc.commands.VoteCommand;
import com.amongusmc.game.GameManager;
import com.amongusmc.listeners.PlayerListener;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class AmongUsMC extends JavaPlugin {
    
    private GameManager gameManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.gameManager = new GameManager(this);
        
        getCommand("amongus").setExecutor(new AmongUsCommand(this));
        getCommand("task").setExecutor(new TaskCommand(this));
        getCommand("meeting").setExecutor(new MeetingCommand(this));
        getCommand("vote").setExecutor(new VoteCommand(this));
        getCommand("kill").setExecutor(new KillCommand(this));
        
        getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
        
        getLogger().info("AmongUsMC has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (gameManager != null) {
            gameManager.shutdown();
        }
        getLogger().info("AmongUsMC has been disabled!");
    }
    
    public String getMessage(String path) {
        return getConfig().getString("messages." + path, "").replace("&", "§");
    }
    
    public String getPrefix() {
        return getMessage("prefix");
    }
}