CakeCookie
AFK Cookie Farming & Cookie Shop Plugin
Standalone • Folia-Compatible • MongoDB • Config-Driven Shop
Overview
CakeCookie is a standalone AFK currency plugin. Players earn
Cookies by standing in designated AFK zones, then spend them in a fully configurable shop GUI.
- AFK Farming — Earn cookies passively in cuboid zones
- Cookie Shop — Config-driven GUI shop with unlimited items
- Admin Panel — Full GUI for managing player cookies
- Zone System — Built-in cuboid selection (no WorldGuard needed)
- Folia Support — Thread-safe, works on Folia and Paper
- MongoDB — Persistent data storage
⚡ Features
AFK Cookie Farming
- Players standing inside a Cookie Zone earn cookies automatically
- Configurable interval (default: 60 seconds)
- Action bar countdown shows time until next cookie
- Booster multiplier support (reserved for future use)
Cookie Shop GUI
- Fully config-driven — add/remove items without code changes
- Supports giving items directly or running console commands
- Shows player's cookie balance at the top
- Color-coded affordability (green = can buy, red = can't)
- Automatic inventory overflow handling (drops on ground)
Admin GUI Panel
- Give / Take / Set cookies for any online player
- Visual player selection with current balance display
- Quick amount buttons (1, 10, 50, 100, 500, 1000, 5000, 10000)
- Top Cookies leaderboard
- Config reload button
Zone Management
- Built-in wand tool (Blaze Rod) for selecting corners
- Left-click = pos1, Right-click = pos2
- Create/delete/list zones via commands
- Zones persist in MongoDB
Commands
Player Commands
Code (Text):
/cookie - Check your cookie balance
/cookieshop - Open the cookie shop GUI
Aliases:
/cookies, /cshop
Admin Commands
(Permission: cakecookie.admin)
Code (Text):
/cookieadmin - Open admin GUI
/cookieadmin give <player> <amount> - Give cookies to a player
/cookieadmin take <player> <amount> - Take cookies from a player
/cookieadmin set <player> <amount> - Set a player's cookies
/cookieadmin reload - Reload config.yml
/cookieadmin zone wand - Toggle zone selection wand
/cookieadmin zone create <name> - Create a zone from pos1/pos2
/cookieadmin zone delete <name> - Delete a zone
/cookieadmin zone list - List all zones
Aliases:
/cadmin
Configuration
config.yml
Code (Text):
database:
mongo-uri: "mongodb://localhost:27017"
mongo-database: "cakecookie"
afk:
interval-seconds: 60
amount-per-interval: 1
booster-multiplier: 3
shop:
items:
- id: diamond_sword
material: DIAMOND_SWORD
name: "&#FFD700Diamond Sword"
lore:
- "&7A shiny sword"
price: 100
slot: 10
- id: golden_apple
material: GOLDEN_APPLE
name: "&#FFD700Golden Apple"
lore:
- "&7Heals you"
price: 50
amount: 3
slot: 11
- id: spawner
material: SPAWNER
name: "&#FF6B6BZombie Spawner"
lore:
- "&7Place to spawn zombies"
price: 10000
command: "spawner give {player} zombie 1"
give-item: false
slot: 14
Shop Item Options
| id |
String |
Yes |
Unique identifier |
| material |
Material |
Yes |
Bukkit Material name |
| name |
String |
Yes |
Display name (supports color codes) |
| lore |
List |
No |
Item lore lines |
| price |
Long |
Yes |
Cookie cost |
| slot |
Int |
Yes |
GUI slot position (0-44) |
| amount |
Int |
No |
Item stack amount (default: 1) |
| command |
String |
No |
Console command ({player} placeholder) |
| give-item |
Boolean |
No |
true = give item, false = run command only |
️ Setting Up AFK Zones
Step-by-step:
- Run /cookieadmin zone wand — you'll receive a Blaze Rod
- Left-click one corner of your AFK area → sets pos1
- Right-click the opposite corner → sets pos2
- Run /cookieadmin zone create <name> — zone is saved
- Players standing inside the zone will now earn cookies!
Notes:
- Both positions must be in the same world
- The zone is a 3D cuboid (includes Y axis)
- Multiple zones can exist simultaneously
- Zones persist across server restarts (stored in MongoDB)
️ GUI Screenshots
Cookie Shop (/cookieshop)
Code (Text):
┌─────────────────────────────────────────────┐
│ . . . . [] . . . . │ ← Cookie balance
│ . [⚔] [] [] [ite] [SP] . . │ ← Shop items
│ . . . . . . . . . │
│ . . . . . . . . . │
│ . . . . [] . . . . │ ← Close button
└─────────────────────────────────────────────┘
Admin Panel (/cookieadmin)
Code (Text):
┌─────────────────────────────────────────────┐
│ . . . . . . . . . │
│ . [+] . [-] . [=] . [] . │ ← Give/Take/Set/Top
│ . . . . . . . . . │
│ . . . [⚙️] . . . . . │ ← Reload
│ . . . . [] . . . . │ ← Close
└─────────────────────────────────────────────┘
Installation
- Requires Paper 1.21+ or Folia
- Requires MongoDB running (local or remote)
- Drop CakeCookie-1.0.0.jar into your plugins/ folder
- Start the server — config.yml will be generated
- Edit config.yml with your MongoDB URI and shop items
- Set up AFK zones using /cookieadmin zone commands
- Done! Players can now farm cookies and use the shop
Permissions
| cakecookie.admin |
OP |
Access to all admin commands and GUI |
All player commands (/cookie, /cookieshop) require no permissions.
Database
CakeCookie uses MongoDB with the following collections:
Collection: players
Code (Text):
{
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"name": "Steve",
"cookies": 1234
}
Collection: cookie_zones
Code (Text):
{
"name": "afk1",
"world": "world",
"x1": 100, "y1": 60, "z1": 200,
"x2": 120, "y2": 80, "z2": 220
}
⚙️ Technical Details
- Folia-safe — Uses entity scheduler for player operations, async scheduler for DB
- Thread-safe — ConcurrentHashMap for all caches
- Shadow JAR — MongoDB driver relocated to avoid conflicts
- No dependencies — Does not require any other plugin
- Auto-save — Player data saved every 5 minutes + on quit
- Reload-safe — Loads online players on enable (handles /reload)
Changelog
v1.0.0
- Initial release
- AFK cookie farming with cuboid zones
- Config-driven cookie shop GUI
- Admin GUI (give/take/set/top/reload)
- Zone management (wand/create/delete/list)
- MongoDB persistence
- Folia support
Made by CakeCraft Development Team