Get started with Peachy now 🍑
PEACHYPEACHY
Building

Mine

The `mine` command allows users to gather minerals by using mining tools in their inventory. It can be triggered using the prefix `m` or the slash command `/mine`.

Command Details

  • Name: mine
  • Aliases: m
  • Category: Inventory
  • Description: Go mining for minerals!
  • Usage: mine, /mine
  • Examples:
    • mine
    • /mine
  • Cooldown: 3 seconds
  • Arguments: None
  • Slash Command: Enabled
  • Permissions:
    • Bot: SendMessages, ViewChannel, EmbedLinks
    • User: None
  • Player Requirements: None

Functionality

  • Allows users to mine for minerals using the appropriate tools in their inventory.
  • Uses client.resourceManager.gatherResource() to handle the logic.
  • Requires the following resources:
    • Tools: MineTools (e.g., pickaxes)
    • Resources: Minerals (various ores and minerals)
  • Likely checks:
    • Tool availability and durability.
    • Grants rewards (minerals) based on tool quality and chance.
  • Displays feedback in an embed according to the bot's style.

Code Overview

The command:

  • Extends a Command class structure.
  • Handles both message-based and slash commands.
  • Imports:
    • MineTools from ../../assets/inventory/MineTools.js
    • Minerals from ../../assets/inventory/Minerals.js
  • Main logic is delegated to client.resourceManager.gatherResource(), which:
    • Manages resource collection.
    • Handles randomness, durability reduction, and reward updates.