Building
Chop
The `chop` command allows users to gather wood by using tools in their inventory. It can be triggered using the prefix `c` or the slash command `/chop`.
Command Details
- Name: chop
- Aliases: c
- Category: Inventory
- Description: Go chopping for wood!
- Usage:
chop
,/chop
- Examples:
chop
/chop
- Cooldown: 3 seconds
- Arguments: None
- Slash Command: Enabled
- Permissions:
- Bot: SendMessages, ViewChannel, EmbedLinks
- User: None
- Player Requirements: None
Functionality
- Allows users to gather wood using the appropriate tools in their inventory.
- Uses
client.resourceManager.gatherResource()
to handle the logic. - Requires the following resources:
- Tools:
ChopTools
(e.g., axes) - Resources:
Woods
(different types of wood)
- Tools:
- The system likely checks for tool availability and durability before granting resources.
- Displays feedback in an embed (based on your bot’s embed design).
Code Overview
The command:
- Extends a
Command
class structure. - Handles both message-based and slash commands.
- Imports:
ChopTools
from../../assets/inventory/ChopTools.js
Woods
from../../assets/inventory/Woods.js
- Main logic is delegated to
client.resourceManager.gatherResource()
, which:- Processes resource gathering.
- Likely manages durability, random drops, and reward distribution.