/fish on a 30-second cooldown catches a fish by rarity tier from a table in settings, /aquarium shows the collection and the rarest catch, and /sell turns the fish into coins Use an editable fish catalogue in list settings (name, rarity, coin value, emoji) with starter fish; preserve collected fish when entries are removed. Use the emoji setting type for each Unicode emoji, with a list of emoji rows when there are several.
A fishing minigame where members cast their line to catch fish of varying rarities. Fish are added to your personal aquarium, and you can sell your entire collection for MEE6 Economy coins.
How to play:
/fish — Cast your line (30-second cooldown). Catch common, uncommon, rare, epic, or legendary fish!/aquarium — View your collection, total value, and rarest catch/sell — Convert all your fish into coins and empty your aquariumFish values range from 5 coins (common) to 1,000 coins (legendary). Build a valuable collection or sell frequently for steady income!
Made by MEE6. Remix it to get a copy of your own and change anything you like.
🐬 Dolphin Epic • 180 coins
🎣 Your line is still in the water! Wait 30s before fishing again.
🐬 Dolphin Epic • 180 coins
🐟 Anchovy Common • 5 coins
🐟 Sardine Common • 5 coins
Total Fish: 2 Collection Value: 360 coins Rarest Catch: 🐬 Dolphin
🐬 Dolphin ×2
Total Fish: 1 Collection Value: 5 coins Rarest Catch: 🐟 Sardine
🐟 Sardine ×1
You sold 2 fish for 360 coins!
Your aquarium is empty! Use /fish to start catching fish.
// Fishing game with rarity tiers, collection tracking, and selling
interface Fish {
name: string;
rarity: 'common' | 'uncommon' | 'rare' | 'epic' | 'legendary';
value: number;
emoji: string;
}
const FISH_TABLE: Fish[] = [
// Common (50% chance)
{ name: 'Sardine', rarity: 'common', value: 5, emoji: '🐟' },
{ name: 'Anchovy', rarity: 'common', value: 5, emoji: '🐟' },
{ name: 'Minnow', rarity: 'common', value: 6, emoji: '🐟' },
// Uncommon (30% chance)
{ name: 'Bass', rarity: 'uncommon', value: 15, emoji: '🐠' },
{ name: 'Trout', rarity: 'uncommon', value: 18, emoji: '🐠' },
{ name: 'Salmon', rarity: 'uncommon', value: 20, emoji: '🐠' },
// Rare (15% chance)
{ name: 'Tuna', rarity: 'rare', value: 50, emoji: '🐡' },
{ name: 'Swordfish', rarity: 'rare', value: 60, emoji: '🐡' },
// Epic (4% chance)
{ name: 'Shark', rarity: 'epic', value: 150, emoji: '🦈' },
{ name: 'Dolphin', rarity: 'epic', value: 180, emoji: '🐬' },
// Legendary (1% chance)
{ name: 'Golden Fish', rarity: 'legendary', value: 500, emoji: '🐲' },
{ name: 'Sea Dragon', rarity: 'legendary', value: 1000, emoji: '🐉' },
];
mee6.settings({
fish: {
type: 'list',
label: 'Fish catalogue',
maxItems: 25,
fields: {
name: { type: 'string', label: 'Name', required: true },
rarity: {
type: 'string',
label: 'Rarity',
required: true,
choices: ['common', 'uncommon', 'rare', 'epic', 'legendary'],
default: 'common',
},
value: { type: 'integer', label: 'Value (coins)', required: true, default: 5 },
emoji: { type: 'emoji', label: 'Emoji', required: true },
},
default: FISH_TABLE,
},
});
// A call moves at most 1,000,000,000 coins, the Economy plugin's own balance
// cap: so does a fish and so does a sale — the fish over that stay for the
// next /sell.
const MAX_SALE = 1_000_000_000;
/** What a fish sells for: its value, within 0 to MAX_SALE coins. */
function price(fish: Fish): number {
return Math.min(Math.max(fish.value, 0), MAX_SALE);
}
const RARITY_CHANCES = {
common: 50,
uncommon: 30,
rare: 15,
epic: 4,
legendary: 1,
};
const RARITY_COLORS = {
common: '#95a5a6',
uncommon: '#2ecc71',
rare: '#3498db',
epic: '#9b59b6',
legendary: '#f1c40f',
};
/** Catch a random fish based on rarity weights */
function catchFish(fish: Fish[]): Fish {
const tiers = Object.entries(RARITY_CHANCES).filter(([rarity]) => fish.some((f) => f.rarity === rarity));
let roll = Math.random() * tiers.reduce((sum, [, weight]) => sum + weight, 0);
let rarity = tiers[tiers.length - 1][0];
for (const [candidate, weight] of tiers) {
roll -= weight;
if (roll <= 0) {
rarity = candidate;
break;
}
}
const pool = fish.filter((f) => f.rarity === rarity);
return pool[Math.floor(Math.random() * pool.length)];
}
async function catalogue(ctx: any): Promise<Fish[]> {
const saved = await mee6.store.member(ctx.author.id).get<Record<string, Fish>>('fish_details', {});
return [...Object.values(saved), ...ctx.settings.fish, ...FISH_TABLE];
}
/** Get the member's aquarium data */
async function getAquarium(userId: string) {
const m = mee6.store.member(userId);
const aquarium = await m.get<Record<string, number>>('aquarium', {});
return aquarium;
}
/** Add a fish to the member's collection */
async function addFish(userId: string, fishName: string) {
const m = mee6.store.member(userId);
const aquarium = await getAquarium(userId);
aquarium[fishName] = (aquarium[fishName] || 0) + 1;
await m.set('aquarium', aquarium);
}
/** Calculate total value and find rarest fish */
function analyzeAquarium(aquarium: Record<string, number>, FISH_TABLE: Fish[]) {
let totalValue = 0;
let totalFish = 0;
let rarestFish: Fish | null = null;
for (const [fishName, count] of Object.entries(aquarium)) {
const fish = FISH_TABLE.find((f) => f.name === fishName);
if (!fish) continue;
totalFish += count;
totalValue += price(fish) * count;
if (!rarestFish || rarityValue(fish.rarity) > rarityValue(rarestFish.rarity)) {
rarestFish = fish;
}
}
return { totalValue, totalFish, rarestFish };
}
function rarityValue(rarity: Fish['rarity']): number {
const values = { common: 1, uncommon: 2, rare: 3, epic: 4, legendary: 5 };
return values[rarity];
}
// Commands
mee6.command('fish', { description: 'Cast your line and catch a fish!' }, async (ctx) => {
const m = mee6.store.member(ctx.author.id);
const now = Math.floor(Date.now() / 1000);
const lastFished = await m.get<number>('last_fished', 0);
// Check 30-second cooldown
if (now - lastFished < 30) {
const remaining = 30 - (now - lastFished);
await ctx.reply(`🎣 Your line is still in the water! Wait ${remaining}s before fishing again.`);
return;
}
// Catch a fish
const pool = (ctx.settings.fish as Fish[]).filter((f) => f.value >= 0);
if (!pool.length) {
await ctx.reply('No fish configured. Add fish in settings.');
return;
}
const fish = catchFish(pool);
const details = await m.get<Record<string, Fish>>('fish_details', {});
if (!details[fish.name]) {
details[fish.name] = fish;
await m.set('fish_details', details);
}
await addFish(ctx.author.id, fish.name);
await m.set('last_fished', now);
await ctx.reply({
embed: {
title: '🎣 You caught a fish!',
description: `${fish.emoji} **${fish.name}**\n*${fish.rarity.charAt(0).toUpperCase() + fish.rarity.slice(1)}* • ${
fish.value
} coins`,
color: RARITY_COLORS[fish.rarity],
footer: { text: 'Use /aquarium to see your collection' },
},
});
});
mee6.command('aquarium', { description: 'View your fish collection' }, async (ctx) => {
const aquarium = await getAquarium(ctx.author.id);
const entries = Object.entries(aquarium);
if (entries.length === 0) {
await ctx.reply({
embed: {
title: '🐠 Your Aquarium',
description: 'Your aquarium is empty! Use `/fish` to start catching fish.',
color: '#3498db',
},
});
return;
}
const fishCatalogue = await catalogue(ctx);
const { totalValue, totalFish, rarestFish } = analyzeAquarium(aquarium, fishCatalogue);
// Group fish by rarity
const byRarity: Record<string, string[]> = {};
for (const [fishName, count] of entries) {
const fish = fishCatalogue.find((f) => f.name === fishName);
if (!fish) continue;
if (!byRarity[fish.rarity]) byRarity[fish.rarity] = [];
byRarity[fish.rarity].push(`${fish.emoji} ${fish.name} ×${count}`);
}
const fields = [];
for (const rarity of ['legendary', 'epic', 'rare', 'uncommon', 'common']) {
if (byRarity[rarity]) {
fields.push({
name: rarity.charAt(0).toUpperCase() + rarity.slice(1),
value: byRarity[rarity].join('\n'),
inline: false,
});
}
}
await ctx.reply({
embed: {
title: '🐠 Your Aquarium',
description: `**Total Fish:** ${totalFish}\n**Collection Value:** ${totalValue} coins${
rarestFish ? `\n**Rarest Catch:** ${rarestFish.emoji} ${rarestFish.name}` : ''
}`,
fields,
color: '#3498db',
footer: { text: 'Use /sell to convert your collection into coins' },
},
});
});
mee6.command('sell', { description: 'Sell all your fish for coins' }, async (ctx) => {
const aquarium = await getAquarium(ctx.author.id);
const entries = Object.entries(aquarium);
if (entries.length === 0) {
await ctx.reply('🐠 You have no fish to sell! Use `/fish` to catch some first.');
return;
}
// Sell what one sale can pay, a kind of fish at a time; the rest stays
const fishCatalogue = await catalogue(ctx);
const kept: Record<string, number> = {};
let totalValue = 0;
let totalFish = 0;
for (const [fishName, count] of entries) {
const fish = fishCatalogue.find((f) => f.name === fishName);
const value = fish ? price(fish) : 0;
const sold = value > 0 ? Math.min(count, Math.floor((MAX_SALE - totalValue) / value)) : count;
totalValue += sold * value;
totalFish += sold;
if (sold < count) kept[fishName] = count - sold;
}
// Pay first, then empty the aquarium: a payment that fails keeps the fish.
// The sale follows the server's Economy boosts like /work
const earned = totalValue > 0 ? (await mee6.economy.add(ctx.author.id, totalValue, { boost: 'income' })).amount : 0;
const m = mee6.store.member(ctx.author.id);
await m.set('aquarium', kept);
const unsold = Object.values(kept).reduce((sum, count) => sum + count, 0);
await ctx.reply({
embed: {
title: '💰 Fish Sold!',
description: `You sold **${totalFish} fish** for **${earned} coins**!`,
color: '#f1c40f',
footer: {
text: unsold
? `${unsold} fish did not fit in this sale: /sell again for the rest.`
: 'Your aquarium is now empty. Time to fish again!',
},
},
});
});