Build a farm under one command: /farm plant sows a crop that is ready after a few hours, /farm harvest collects it for coins if enough time has passed, and /farm field shows what is growing and when it will be ready
Plant crops, wait for them to grow, and harvest them for coins!
/farm plant — Sow a crop (wheat, corn, tomato, or pumpkin). Each has different grow times and rewards./farm harvest — Collect your grown crop and earn coins. Only works when the crop is ready./farm field — View your current farm status with a progress bar./farm plant and choose from 4 types (1-4 hours to grow)/farm field/farm harvest to earn 50-300 coinsMembers can only have one crop growing at a time. The creation uses MEE6 Economy by default, or tracks its own balance if the setting is disabled.
Made by MEE6. Remix it to get a copy of your own and change anything you like.
🌽 You planted corn! It will be ready to harvest in 2 hours for 120 coins.
🌽 Corn ⏰ Growing... 2h 0m remaining ░░░░░░░░░░ 0%
120 coins
🌾 You planted wheat! It will be ready to harvest in 1 hour for 50 coins.
🍅 You planted tomato! It will be ready to harvest in 3 hours for 200 coins.
🚫 You already have 🍅 tomato growing! It will be ready in 3h 0m.
⏰ Your 🌽 corn isn't ready yet! Wait 2h 0m longer.
🌾 Harvest complete! You collected your wheat and earned 50 coins! 💰
Plant another crop with /farm plant.
// Farm System - Plant crops, harvest them for coins after they grow
interface Crop {
type: string;
plantedAt: number; // timestamp
growTime: number; // seconds
reward: number; // coins
}
const CROPS = {
wheat: { growTime: 3600, reward: 50, emoji: '🌾' }, // 1 hour
corn: { growTime: 7200, reward: 120, emoji: '🌽' }, // 2 hours
tomato: { growTime: 10800, reward: 200, emoji: '🍅' }, // 3 hours
pumpkin: { growTime: 14400, reward: 300, emoji: '🎃' }, // 4 hours
};
mee6.settings({
use_economy: {
type: 'boolean',
label: 'Use MEE6 Economy (coins)?',
default: true,
sample: true,
},
});
// /farm plant - Plant a crop
mee6.command(
'farm plant',
{
description: 'Plant a crop',
options: [
{
name: 'crop',
type: 'string',
description: 'What to plant',
required: true,
choices: [
{ name: '🌾 Wheat (1h, 50 coins)', value: 'wheat' },
{ name: '🌽 Corn (2h, 120 coins)', value: 'corn' },
{ name: '🍅 Tomato (3h, 200 coins)', value: 'tomato' },
{ name: '🎃 Pumpkin (4h, 300 coins)', value: 'pumpkin' },
],
},
],
},
async (ctx) => {
const cropType = ctx.option<string>('crop');
const cropInfo = CROPS[cropType as keyof typeof CROPS];
const m = mee6.store.member(ctx.author.id);
const existing = await m.get<Crop>('crop');
if (existing) {
const now = Math.floor(Date.now() / 1000);
const elapsed = now - existing.plantedAt;
const remaining = existing.growTime - elapsed;
if (remaining > 0) {
const hours = Math.floor(remaining / 3600);
const minutes = Math.floor((remaining % 3600) / 60);
const timeStr = hours > 0 ? `${hours}h ${minutes}m` : `${minutes}m`;
await ctx.reply(
`🚫 You already have ${CROPS[existing.type as keyof typeof CROPS].emoji} ${
existing.type
} growing! It will be ready in ${timeStr}.`
);
return;
}
await ctx.reply(
`⚠️ You have a ready ${CROPS[existing.type as keyof typeof CROPS].emoji} ${
existing.type
}! Harvest it first with \`/farm harvest\`.`
);
return;
}
const crop: Crop = {
type: cropType,
plantedAt: Math.floor(Date.now() / 1000),
growTime: cropInfo.growTime,
reward: cropInfo.reward,
};
await m.set('crop', crop);
const hours = cropInfo.growTime / 3600;
await ctx.reply(
`${cropInfo.emoji} You planted **${cropType}**! It will be ready to harvest in **${hours} hour${
hours !== 1 ? 's' : ''
}** for **${cropInfo.reward} coins**.`
);
}
);
// /farm harvest - Collect your grown crop
mee6.command('farm harvest', { description: 'Harvest your crop' }, async (ctx) => {
const m = mee6.store.member(ctx.author.id);
const crop = await m.get<Crop>('crop');
if (!crop) {
await ctx.reply(`🚫 You don't have anything planted! Use \`/farm plant\` to start farming.`);
return;
}
const now = Math.floor(Date.now() / 1000);
const elapsed = now - crop.plantedAt;
const remaining = crop.growTime - elapsed;
if (remaining > 0) {
const hours = Math.floor(remaining / 3600);
const minutes = Math.floor((remaining % 3600) / 60);
const timeStr = hours > 0 ? `${hours}h ${minutes}m` : `${minutes}m`;
await ctx.reply(
`⏰ Your ${CROPS[crop.type as keyof typeof CROPS].emoji} ${
crop.type
} isn't ready yet! Wait **${timeStr}** longer.`
);
return;
}
const cropEmoji = CROPS[crop.type as keyof typeof CROPS].emoji;
// Award coins
const useEconomy = ctx.settings.use_economy;
let earned = crop.reward;
if (useEconomy) {
// MEE6 coins follow the server's Economy boosts like /work
earned = (await mee6.economy.add(ctx.author.id, crop.reward, { boost: 'income' })).amount;
} else {
await m.incr('balance', crop.reward);
}
// Clear the crop
await m.delete('crop');
await ctx.reply(
`${cropEmoji} **Harvest complete!** You collected your ${crop.type} and earned **${earned} coins**! 💰\n\nPlant another crop with \`/farm plant\`.`
);
});
// /farm field - View your farm
mee6.command('farm field', { description: 'View your farm', ephemeral: true }, async (ctx) => {
const m = mee6.store.member(ctx.author.id);
const crop = await m.get<Crop>('crop');
if (!crop) {
await ctx.reply({
embed: {
title: '🌱 Your Farm',
description: 'Your field is empty! Plant a crop with `/farm plant` to get started.',
color: '#8B4513',
},
});
return;
}
const now = Math.floor(Date.now() / 1000);
const elapsed = now - crop.plantedAt;
const remaining = crop.growTime - elapsed;
const cropEmoji = CROPS[crop.type as keyof typeof CROPS].emoji;
let status: string;
let color: string;
if (remaining <= 0) {
status = '✅ **Ready to harvest!** Use `/farm harvest` to collect your crop.';
color = '#2ECC71';
} else {
const hours = Math.floor(remaining / 3600);
const minutes = Math.floor((remaining % 3600) / 60);
const timeStr = hours > 0 ? `${hours}h ${minutes}m` : `${minutes}m`;
const progress = Math.floor((elapsed / crop.growTime) * 100);
const barLength = 10;
const filled = Math.floor((progress / 100) * barLength);
const bar = '▓'.repeat(filled) + '░'.repeat(barLength - filled);
status = `⏰ Growing... **${timeStr}** remaining\n${bar} ${progress}%`;
color = '#F39C12';
}
await ctx.reply({
embed: {
title: '🌱 Your Farm',
description: `${cropEmoji} **${crop.type.charAt(0).toUpperCase() + crop.type.slice(1)}**\n${status}`,
color: color,
fields: [{ name: '💰 Reward', value: `${crop.reward} coins`, inline: true }],
footer: { text: 'Happy farming!' },
},
});
});