Chat Games

PrimeChat includes an engaging chat games system that adds interactive trivia and educational content to your server.

Overview

Chat games are automated trivia questions that appear in chat, allowing players to compete for rewards by answering correctly.

Features

  • Multiple Categories: Trivia, math, Minecraft, geography, science

  • Automatic Distribution: Configurable timing for automatic games

  • Manual Triggers: Staff can send games on demand

  • Reward System: Console commands executed for winners

  • Fair Competition: First correct answer wins

  • Customizable: Add your own questions and rewards

Game Configuration

Basic Setup

Configure chat games in chatgames.yml:

# Chat Games Configuration
games:
  enabled: true
  auto-send:
    enabled: true
    interval: 300  # Send game every 5 minutes
  timeout: 30      # Players have 30 seconds to answer
  
# Individual game questions
questions:
  trivia-1:
    question: "What is the capital of France?"
    answers:
      - "Paris"
      - "paris"
      - "PARIS"
    reward-command: "give %player% diamond 1"
    reward-display: "1x Diamond"
    category: "Geography"

Game Categories

Geography Questions

geo-1:
  question: "Which is the largest ocean on Earth?"
  answers:
    - "Pacific"
    - "Pacific Ocean"
    - "pacific"
  reward-command: "eco give %player% 100"
  reward-display: "$100"
  category: "Geography"

geo-2:
  question: "What is the capital of Japan?"
  answers:
    - "Tokyo"
    - "tokyo"
  reward-command: "give %player% emerald 2"
  reward-display: "2x Emerald"
  category: "Geography"

Mathematics Questions

math-1:
  question: "What is 15 + 27?"
  answers:
    - "42"
  reward-command: "give %player% gold_ingot 1"
  reward-display: "1x Gold Ingot"
  category: "Mathematics"

math-2:
  question: "What is the square root of 64?"
  answers:
    - "8"
  reward-command: "eco give %player% 50"
  reward-display: "$50"
  category: "Mathematics"

Minecraft Questions

minecraft-1:
  question: "What tool do you use to mine stone?"
  answers:
    - "Pickaxe"
    - "pickaxe"
    - "Pick"
  reward-command: "give %player% iron_pickaxe 1"
  reward-display: "Iron Pickaxe"
  category: "Minecraft"

minecraft-2:
  question: "How many blocks tall is the Nether?"
  answers:
    - "128"
    - "128 blocks"
  reward-command: "give %player% netherite_scrap 1"
  reward-display: "Netherite Scrap"
  category: "Minecraft"

Science Questions

science-1:
  question: "What is the chemical symbol for gold?"
  answers:
    - "Au"
    - "au"
    - "AU"
  reward-command: "give %player% gold_block 1"
  reward-display: "Gold Block"
  category: "Science"

science-2:
  question: "How many bones are in an adult human body?"
  answers:
    - "206"
  reward-command: "eco give %player% 75"
  reward-display: "$75"
  category: "Science"

Word Games

word-1:
  question: "Unscramble: TCARE"
  answers:
    - "TRACE"
    - "CRATE"
    - "trace"
    - "crate"
  reward-command: "give %player% book 3"
  reward-display: "3x Books"
  category: "Word Games"

Reward System

Command-Based Rewards

Execute any console command as a reward:

# Economy rewards
reward-command: "eco give %player% 100"

# Item rewards
reward-command: "give %player% diamond 5"

# Multiple commands
reward-command: 
  - "give %player% emerald 3"
  - "eco give %player% 50"
  - "title %player% title {\"text\":\"Winner!\",\"color\":\"gold\"}"

# Permission rewards
reward-command: "lp user %player% permission settemp vip.perks true 1h"

# Teleportation rewards
reward-command: "spawn %player%"

Available Placeholders

  • %player% - Winner's username

  • %answer% - The correct answer given

  • %question% - The question that was asked

  • %reward_display% - Display name of the reward

Reward Display

Control how rewards appear to players:

reward-display: "1x Diamond + $100"  # Simple text
reward-display: "&#FFD700★ &#FFFFFF1x Diamond &#FFD700+ &#00FF00$100"  # Colored

Game Management

Manual Commands

Send Random Game

/chat chatgames

Admin Controls

  • Start Game: Triggers random question

  • View Stats: See game statistics

  • Reload Games: Refresh question database

Automatic System

Configuration

auto-send:
  enabled: true
  interval: 300        # Seconds between games
  min-players: 3       # Minimum players online
  random-delay: 60     # Random delay ±60 seconds

Smart Timing

  • Player Check: Only sends if enough players online

  • Cooldown: Prevents spam during active conversations

  • Random Variance: Adds unpredictability to timing

Game Display

Question Format

Configure how questions appear in chat:

messages:
  game:
    question: "&#FFD700⚡ &#FFFF00CHAT GAME &#FFD700⚡ &#FFFFFF%question%"
    timeout: "&#FF6B6B⏰ Time's up! The answer was: &#FFFFFF%answer%"
    winner: "&#00FF00🎉 &#FFFFFF%player% &#00FF00won! Answer: &#FFFFFF%answer% &#00FF00| Reward: &#FFFFFF%reward%"
    category: "&#9370DB📚 Category: &#FFFFFF%category%"

Example Game Flow

⚡ CHAT GAME ⚡ What is the capital of France?
📚 Category: Geography

Steve: paris
🎉 Steve won! Answer: Paris | Reward: 1x Diamond

Advanced Features

Difficulty Levels

Create tiered difficulty systems:

easy-questions:
  difficulty: 1
  reward-multiplier: 1.0
  
medium-questions:
  difficulty: 2
  reward-multiplier: 1.5
  
hard-questions:
  difficulty: 3
  reward-multiplier: 2.0

Category Rotation

Ensure variety in question types:

rotation:
  enabled: true
  categories:
    - "Geography"
    - "Mathematics"
    - "Minecraft"
    - "Science"
  force-variety: true  # Don't repeat categories

Statistics Tracking

Track game performance:

stats:
  track-player-wins: true
  track-category-performance: true
  leaderboard-size: 10

Integration Features

PlaceholderAPI Support

  • %primechat_games_won% - Total games won by player

  • %primechat_current_streak% - Current winning streak

  • %primechat_best_streak% - Best winning streak

  • %primechat_games_played% - Games participated in

Economy Integration

# Vault economy rewards
reward-command: "eco give %player% %amount%"

# PlayerPoints integration
reward-command: "points give %player% 50"

# Custom economy plugins
reward-command: "coins add %player% 100"

Creating Custom Games

Question Guidelines

  1. Clear and Unambiguous: Avoid confusing wording

  2. Appropriate Difficulty: Match your server's demographic

  3. Multiple Answers: Include common variations

  4. Engaging Content: Make questions fun and educational

  5. Fair Rewards: Balance reward value with difficulty

Template Structure

custom-question-id:
  question: "Your question here?"
  answers:
    - "Primary answer"
    - "alternative answer"
    - "case variation"
  reward-command: "give %player% item 1"
  reward-display: "1x Item"
  category: "Custom Category"
  difficulty: 2
  tags: ["education", "fun"]

Bulk Import

Import questions from external sources:

# CSV import support
import:
  file: "questions.csv"
  format: "question,answer1,answer2,category,reward"

Troubleshooting

Common Issues

  1. Games Not Sending

    • Check enabled: true in config

    • Verify minimum player count

    • Check console for errors

  2. Rewards Not Working

    • Test reward commands manually

    • Check placeholder formatting

    • Verify required plugins installed

  3. Answers Not Recognized

    • Check for typos in answer list

    • Add common variations

    • Consider case sensitivity

  4. Timing Issues

    • Adjust interval settings

    • Check server performance

    • Review random delay settings

Debug Mode

Enable detailed logging:

debug:
  chat-games: true

Shows:

  • Question selection process

  • Answer checking logic

  • Reward execution

  • Timer management

Performance Considerations

Memory Usage

  • Questions loaded into memory at startup

  • Configurable cache limits

  • Automatic cleanup of old games

Server Impact

  • Games run on async threads

  • Minimal main thread usage

  • Configurable processing limits

Network Optimization

  • Batched message sending

  • Compressed question storage

  • Efficient placeholder processing

Best Practices

Question Management

  • Regular content updates

  • Seasonal/event questions

  • Community contributions

  • Difficulty progression

Reward Balance

  • Not too generous (economy impact)

  • Varied reward types

  • Special event bonuses

  • Tiered difficulty rewards

Community Engagement

  • Player-submitted questions

  • Category voting

  • Leaderboards

  • Achievement systems

Last updated