# Chat games

A message will appear in the chat every few minutes. It could be a riddle, a task to form a word with jumbled letters, or add/multiply/divide numbers (auto-generated). Whoever correctly answers the task in the chat first will receive a reward.

There are also a couple of commands that allow you to play with other players for money. Toss a coin or get a random number from 0 to 100.

<figure><img src="/files/ZcvGLioIGnGduvpNosyL" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/ozUoPH3HLuvEWsA6byzD" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/JMNwJtAvPRa44ELVFSOT" alt=""><figcaption></figcaption></figure>

### Commands <a href="#commands" id="commands"></a>

| Description                                                                                                                                         | Command                                                                 |
| --------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| View mode commands                                                                                                                                  | /chatgames help                                                         |
| Adds an item to your hand as a prize when you win. You need to specify the drop chance. Be sure to change the drop type in the config for this mode | /chatgames additem <mark style="color:purple;">\<mode> \<chance></mark> |
| Quick restart                                                                                                                                       | /chatgames trigger                                                      |
| Return random number from 0 to 100                                                                                                                  | /roll                                                                   |
| Play with a player for a certain amount. Whoever hits the higher number wins                                                                        | /roll <mark style="color:purple;">\<player> \<money></mark>             |
| Accept roll from player                                                                                                                             | /roll accept                                                            |
| A coin is tossed. It may come up heads or tails                                                                                                     | /flip                                                                   |
| Play with a player for a certain amount. Whoever guessed the figure wins                                                                            | /flip <mark style="color:purple;">\<player> \<figure> \<money></mark>   |
| Accept flip from player                                                                                                                             | /flip accept                                                            |

### Permissions <a href="#permissions" id="permissions"></a>

{% hint style="danger" %}
You **must** use a permission manager like [LuckPerms](https://luckperms.net/download) which supports `.*` permissions notation. Bukkit doesn't support this notation by default!
{% endhint %}

| For what                                                    | Permission            |
| ----------------------------------------------------------- | --------------------- |
| Gives all mode access to the player                         | fun.chatgames.\*      |
| Gives the player permission to restart this mode            | fun.chatgames.trigger |
| Gives the player permission to use /flip and /roll commands | fun.chatcommands.\*   |
| Gives the player permission to use /roll command            | fun.chatcommands.roll |
| Gives the player permission to use /flip command            | fun.chatcommands.flip |

### Main config (config.yml)

```yaml
Chat games enable: true #If "false", this mode will not be available
Chat games min server online: 0 #How much online must be on the server in allowed worlds for the mode to work
Chat games time for answer: 60 #In seconds. Time to answer when the riddle was asked
Chat games cooldown: 300 #In ticks. Delay before sending the next riddle
Chat games sound enable: true #Will there be sounds when sending messages?
Chat games worlds: #As list of world names. In which worlds will the mode be available?
  - 'world'

# ╔════════════════════════════════════════════════════════════════════════════════════╗
# ║                              COLLECT THE WORD                                      ║
# ║  THE LETTERS IN THE WORD WILL BE MIXED AND PLAYERS WILL NEED TO ASSEMBLE THE WORD  ║
# ╚════════════════════════════════════════════════════════════════════════════════════╝

Collect the word enable: true #If "false", this submode will not be available
Collect the word list: #List of all possible words
  - surname
  - car
  - mother
  - father
  - collection
  - city
  - sister
  - library
  - shop
  - market
  - minecraft
  - notch
  - computer
  - fortnite
  - window
  - floor
  - idea
  - discord
  - facebook
  - java
  - food
  - burger
  - mafia
  - document
  - flower
  - school
  - ship
  - forge
  - spigot
  - castle
  - weapon
  - bow
  - sword
  - glock
  - ak47
  - russia
  - bandana
  - shirt
  - usa
  - search
  - beach
  - ocean
  - power
  - resource
  - diamond
  - infinite
  - opressor
  - doctor
  - abandon
  - ability
  - account
  - achievement
  - across
  - address
  - adopt
  - affect
  - afternoon
  - aggressive
  - airline
  - alliance
  - alternative
  - amount
  - another
  - anybody
  - argument
  - arrangement
  - assistance
  - authority
  - background
  - battery
  - beautiful
  - beginning
  - besides
  - birthday
  - bind
  - billion
  - bowl
  - breakfast
  - campaign
  - category
  - ceremony
  - challenge
  - chapter
  - citizen
  - client
  - coach
  - cold
  - column
  - commit
  - compete
  - concert
  - contain
  - contact
  - cook
  - couch
  - country
  - crime
  - daily
  - decline
  - director
  - dish
  - display
  - divorce
  - document
  - drama
  - drawing
  - drop
  - east
  - energy
  - engine
  - enjoy
  - escape
  - evaluate
  - every
  - expand
  - explode
  - faith
  - famous
  - female
  - firm
  - folk
  - foreign
  - foundation
  - funny
  - giant
  - goal
  - grocery
  - hate
  - highway
  - horizon
  - husband
  - image
  - impact
  - increase
  - inform
  - iron
  - jacket
  - joke
  - junior
  - kitchen
  - large
  - launch
  - leader
  - lesson
  - license
  - literature
  - machine
  - manage
  - massive
  - member
  - minister
  - morning
  - mystery
  - nature
  - noise
  - nothing
  - occasion
  - original
  - package
  - parent
  - perform
  - physical
  - plastic
  - pollution
  - position
  - powerful
  - primary
  - profit
  - profile
  - project
  - publish
  - purchase
  - radical
  - reader
  - reason
  - regard
  - relative
  - remove
  - represent
  - revenue
  - room
  - running
  - sample
  - scene
  - scream
  - select
  - senior
  - session
  - several
  - shell
  - shop
  - shower
  - simply
  - slight
  - smoke
  - solution
  - source
  - speaker
  - spread
  - status
  - steel
  - storage
  - stranger
  - strike
  - super
  - teacher
  - thanks
  - ticket
  - tourist
  - translate
  - twenty
  - universal
  - useful
  - version
  - victory
  - vision
  - warning
  - western
  - widely
  - without
  - writing
  - young

# ╔════════════════════════════════════════════════════════════════════╗
# ║                       MATHEMATICS                                  ║
# ║  SYMBOLS, WHICH CAN BE USED -> + - / * ( )                         ║
# ║  IN AUTOGENERATION MODE, THE PLUGIN WILL PICK THE NUMBERS ITSELF.  ║
# ║  MOSTLY THIS WILL BE ADDITION AND SUBTRACTION.                     ║
# ║  BUT MULTIPLICATION AND DIVISION WILL ALSO BE LESSER.              ║
# ╚════════════════════════════════════════════════════════════════════╝

Mathematics enable: true #If "false", this submode will not be available
Mathematics autogenerated: true #If "true", all mathematics will be random
Mathematics list: #If "false", otherwise they will be taken from this list
  - '20*3'
  - '(20+3)*6'
  - '20+3*6'
  - '630/2'
  - '120*3/4'
  - '1600/4-200'
  - '5+10/2'
  - '7*(8/2)'
  - '5*5*5'
  - '2+3*4/2'
  - '9/3-2*2'
  - '6*(9-4)'
  - '4*9-12'
  - '8*12'
  - '229+98'

# ╔════════════════════╗
# ║       RIDDLE       ║
# ║  ANSWER: QUESTION  ║
# ╚════════════════════╝

Riddle enable: true #If "false", this submode will not be available
Riddle list: #List of all possible riddles. Example: "Cat" is answer, "Most popular pet?" is a chat question.
  Cat: Most popular pet?
  Piano: What has many keys but cant open a single lock?
  Window: What invention lets you look right through a wall?
  Bed: What has one head, one foot and four legs?
  Book: What has words, but never speaks?
  Glove: What has a thumb and four fingers, but is not a hand?
  Coin: What has a head and a tail but no body?
  Seven: I am an odd number. Take away a letter and I become even. What number am I?
  Chicago: What is 3/7 chicken, 2/3 cat and 2/4 goat?
  Light: What can fill a room but takes up no space?
  Carrot: Im orange, I wear a green hat and I sound like a parrot. What am I?
  Potato: What has lots of eyes, but cant see?
  Bank: I have branches, but no fruit, trunk, or leaves. What am I?
  Queue: What word is pronounced the same if you take away four of its five letters?
  Guitar: What has a neck but has no head?
  Automobile: What has ten letters and starts with gas?
  Fence: What runs around the whole yard without moving?
  Tulips: What flowers are kissable?
  Dough: People knead me to buy things. What am I?
  Water: I can be hot or cold. I can run and be still. I can be hard and soft. What am I?
  Pants: What does a dog do that a man steps into?
  Beer: What has a head but no neck?
  Age: What goes up and never comes down?
  Ruler: Contrary to my name, I am not a queen. Hold me up to things though and their length is seen.
  Telephone: You answer me, although I never ask you questions. What am I?
  Stamp: What can travel around the world while staying in a corner?
  Romance: What do you call two Italian ants?
  Alphabet: What word contains all of the twenty-six letters?
  Clock: What has a face and two hands, but has no arms or legs?
  Short: What five-letter word becomes shorter when you add two letters to it?
  Envelope: What word begins and ends with an E, but only has one letter?
  Egg: What has to be broken before you can use it?
  Bottle: What has a neck but has no head?
  Edam: What type of cheese is made backwards?
  C: Which letter of the alphabet has the most water?
  Teapot: What begins with T, ends with T, and has T in it?
  12: How much month has 28 days?
  Table: What has legs, but does not walk?
  Cold: What can you catch, but not throw?
  Comb: What has many teeth, but cannot bite?
  Relationship: What ship has two mates but no captain?
  Gum: I go in hard. I come out soft. You blow me hard. What am I?
  Hole: The more you take away, the bigger I become. What am I?
  Pencil lead: What comes from a mine, is always surrounded by wood always, and used by everyone.
  Left hand: What can you hold in your right hand, but never in your left hand?
  Name: What belongs to you, but everyone else uses it.
  North Polish: What nationality is Santa Claus?
  Sandy Claws: What do you call a cat on the beach at Christmastime?
  Frostbite: What do you get when you cross a snowman with a vampire?
  Crackers: What food is so funny that it can be a comedian?
  Footsteps: What makes more as you take them?
  Eyeball: I am a ball that can be rolled but never bounced or thrown. What am I?
  Battery: I have no life, but I can die. What am I?
  Street: I go around all the places, cities, towns, and villages but never come inside. What am I?
  Plate: People always buy me to eat, but they never eat me. What am I?
```

### Mode config (chat\_games.yml)

```yaml
Collect the word rewards:
  Drop mode: MONEY
  Money reward: 3000.0
  Items reward: [] #Set by command
  Command reward: []

Mathematics rewards:
  Drop mode: MONEY
  Money reward: 3000.0
  Items reward: [] #Set by command
  Command reward: []

Riddle rewards:
  Drop mode: MONEY
  Money reward: 3000.0
  Items reward: [] #Set by command
  Command reward: []

Chat games victories: [] #Set by plugin
```

You can change the type of reward. Just change it in the config above. Here are what they are:

1\) **MONEY** - Gives only money

2\) **ITEM** - Gives only one item with some chance

3\) **ALLITEMS** - Gives all items in list

4\) **COMMAND** - Executes commands. Example:

```
Command reward:
- eco give %player% 1000
- say Cool
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://shimado.gitbook.io/fungames/modes/chat-games.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
