tr1dzius
📎 1 file 2,591 chars
📄
pasted-code-1789300460433.txt
txt 42 lines
▶
Create a complete Minecraft plugin project for Spigot / Paper 1.20+ in Java. The plugin name is "ChatGames". 

DO NOT include build.gradle, settings.gradle, or any setup instructions. Only output the Java source code and plugin.yml.

Requirements & Features:

1. Dependencies:
   - Soft-depend on "Vault" (Vault 2.0 API) for economy integration.
   - If Vault is enabled, support economy money distribution.

2. Game Types (Triggers automatically via a task every 5 to 10 minutes):
   - Reverse Word: Displays a LITHUANIAN word in reverse order (e.g., "SVEIKAS" displayed as "SAKIEVS", "KOMPIUTERIS" displayed as "SIRETUIPMOK"), and players must type the correct Lithuanian word in chat.
   - Math Problem: Simple arithmetic (e.g., "15 + 27 = ?").
   - Speed Typing: Generates a short random Lithuanian phrase or word string (e.g., "Lietuvos Serveris", "Minecraft Zaidimai") that players must type as quickly as possible.

3. Lithuanian Word List for Games:
   - All target words for the Reverse Word and Speed Typing games must be common LITHUANIAN words (e.g., lietuva, geltona, kalnas, zaidimas, pergalė, laimėjimas, draugas, kardas, miškas).

4. Reward System:
   - When a player answers correctly first, reward them with ONE random option selected from the following weighted pool:
     * Item: 1x Enchanted Golden Apple
     * Item: 3x Golden Apple
     * Item: 16x Iron Ingot
     * Item: 8x Gold Ingot
     * Item: 32x Experience Bottle
     * Item: 1x Diamond
     * Money (Vault): Give the player $1000 using Vault Economy API
     * Money (Vault): Give the player $3000 using Vault Economy API
     * Command Reward: Execute console command "crates key give {PLAYER} daily 1"
     * Command Reward: Execute console command "crates key give {PLAYER} purvo 1"

5. Language & Messages:
   - ALL in-game chat messages sent to players must be written in LITHUANIAN using legacy color codes (&a, &e, &c, &f, &b).
   - Lithuanian Message Examples:
     * Game Start: "&a[Pokalbių Žaidimai] &fPirmasis atspėjęs žodį &e{WORD}&f laimės prizą!"
     * Math Start: "&a[Pokalbių Žaidimai] &fIšspręskite užduotį: &e{QUESTION}&f ir laimėkite prizą!"
     * Winner Announcement: "&a[Pokalbių Žaidimai] &fŽaidėjas &e{PLAYER} &fteisingai atsakė ir gavo: &b{REWARD}&f!"
     * No Winner (Timeout): "&c[Pokalbių Žaidimai] &fNiekas neatsakė teisingai per skirtą laiką."

6. Deliverables:
   - Complete plugin.yml including softdepend: [Vault]
   - Java classes (Main JavaPlugin class, Event Listener for AsyncPlayerChatEvent, Game Manager, and Reward Handler).
Kodari AI
KodariSep 13 at 11:54 am 1
ChatGames
A Spigot/Paper 1.20+ plugin that automatically triggers Lithuanian word games every 5-10 minutes. Players compete in Reverse Word, Math Problem, and Speed Typing challenges via chat. First correct answer wins a random weighted reward including enchanted items, experience bottles, Vault economy money, or console command crate keys. All messages in Lithuanian with legacy color codes, soft-dependent on Vault for economy integration.
  1. Create the JavaPlugin entry point and lifecycle wiring.

  2. Add the asynchronous chat listener and synchronized game manager for reverse-word, math, and speed-typing rounds.

  3. Add Vault-aware weighted reward handling and the complete Lithuanian plugin.yml metadata.

Created the complete ChatGames plugin project with:

  • ChatGamesPlugin.java

  • ChatGameListener.java

  • GameManager.java

  • RewardHandler.java

  • plugin.yml

Features include Lithuanian reverse-word, math, and speed-typing games; automatic 5–10 minute scheduling; 30-second timeouts; weighted rewards; Vault economy support; item rewards; and crate key commands.

tr1dzius
📎 1 file 2,591 chars
📄
pasted-code-1789300894631.txt
txt 42 lines
▶
Create a complete Minecraft plugin project for Spigot / Paper 1.20+ in Java. The plugin name is "ChatGames". 

DO NOT include build.gradle, settings.gradle, or any setup instructions. Only output the Java source code and plugin.yml.

Requirements & Features:

1. Dependencies:
   - Soft-depend on "Vault" (Vault 2.0 API) for economy integration.
   - If Vault is enabled, support economy money distribution.

2. Game Types (Triggers automatically via a task every 5 to 10 minutes):
   - Reverse Word: Displays a LITHUANIAN word in reverse order (e.g., "SVEIKAS" displayed as "SAKIEVS", "KOMPIUTERIS" displayed as "SIRETUIPMOK"), and players must type the correct Lithuanian word in chat.
   - Math Problem: Simple arithmetic (e.g., "15 + 27 = ?").
   - Speed Typing: Generates a short random Lithuanian phrase or word string (e.g., "Lietuvos Serveris", "Minecraft Zaidimai") that players must type as quickly as possible.

3. Lithuanian Word List for Games:
   - All target words for the Reverse Word and Speed Typing games must be common LITHUANIAN words (e.g., lietuva, geltona, kalnas, zaidimas, pergalė, laimėjimas, draugas, kardas, miškas).

4. Reward System:
   - When a player answers correctly first, reward them with ONE random option selected from the following weighted pool:
     * Item: 1x Enchanted Golden Apple
     * Item: 3x Golden Apple
     * Item: 16x Iron Ingot
     * Item: 8x Gold Ingot
     * Item: 32x Experience Bottle
     * Item: 1x Diamond
     * Money (Vault): Give the player $1000 using Vault Economy API
     * Money (Vault): Give the player $3000 using Vault Economy API
     * Command Reward: Execute console command "crates key give {PLAYER} daily 1"
     * Command Reward: Execute console command "crates key give {PLAYER} purvo 1"

5. Language & Messages:
   - ALL in-game chat messages sent to players must be written in LITHUANIAN using legacy color codes (&a, &e, &c, &f, &b).
   - Lithuanian Message Examples:
     * Game Start: "&a[Pokalbių Žaidimai] &fPirmasis atspėjęs žodį &e{WORD}&f laimės prizą!"
     * Math Start: "&a[Pokalbių Žaidimai] &fIšspręskite užduotį: &e{QUESTION}&f ir laimėkite prizą!"
     * Winner Announcement: "&a[Pokalbių Žaidimai] &fŽaidėjas &e{PLAYER} &fteisingai atsakė ir gavo: &b{REWARD}&f!"
     * No Winner (Timeout): "&c[Pokalbių Žaidimai] &fNiekas neatsakė teisingai per skirtą laiką."

6. Deliverables:
   - Complete plugin.yml including softdepend: [Vault]
   - Java classes (Main JavaPlugin class, Event Listener for AsyncPlayerChatEvent, Game Manager, and Reward Handler).
Kodari AI
KodariSep 13 at 12:00 pm 1

Implemented the ChatGames plugin project:

  • Lithuanian reverse-word, math, and speed-typing games

  • Automatic rounds every 5–10 minutes

  • 30-second answer timeout

  • First correct answer wins

  • Weighted reward pool with items, Vault money, and crate commands

  • Lithuanian chat messages with legacy color codes

  • Vault soft dependency

  • XSeries-compatible material handling for cross-version support

Updated files:

  • src/main/java/com/chatgames/ChatGamesPlugin.java

  • src/main/java/com/chatgames/ChatGameListener.java

  • src/main/java/com/chatgames/GameManager.java

  • src/main/java/com/chatgames/RewardHandler.java

  • src/main/resources/plugin.yml

Kodari can make mistakes. Review important code before using.
Files
src
Code
5 344
src/main/java/com/chatgames/ChatGamesPlugin.java
package com.chatgames;

import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public final class ChatGamesPlugin extends JavaPlugin {
    private GameManager gameManager;

    @Override
    public void onEnable() {
        RewardHandler rewardHandler = new RewardHandler(this);
        this.gameManager = new GameManager(this, rewardHandler);
        Bukkit.getPluginManager().registerEvents(new ChatGameListener(gameManager), this);
        gameManager.start();
    }

    @Override
    public void onDisable() {
        if (gameManager != null) {
            gameManager.stop();
        }
    }
}