AFK Farming System
AFK Farming System
The AFK system allows players to automatically harvest crops while remaining inside the farm area. Instead of breaking blocks physically, the system simulates harvesting and rewards the player with:
Hoe XP
Essence
Crop drops
Level rewards
This system is designed to be lightweight and server-safe, avoiding block updates, enchant triggers, boss damage, or visual harvest logic.
How AFK Farming Works
When AFK farming starts, a session is created for the player.
During the session the system will periodically:
Determine the player's active crop.
Simulate crop harvesting.
Grant:
Hoe XP
Essence
Crop items
Send income feedback via the actionbar.
Display a title showing remaining AFK time.
No physical blocks are broken during this process.
AFK Session
Each player has an AFK session containing:
Player UUID
Session start time
Session end time
Crops generated per tick
Last database save timestamp
Sessions automatically stop when:
The player moves
The player leaves the server
The player leaves the farm area
The player stops holding a Tycoon Hoe
The AFK duration expires
AFK Groups
AFK behavior is permission-based. Each player automatically receives the best AFK group they have permission for.
Groups define:
Maximum AFK duration
Crops generated per tick
Example configuration:
The plugin automatically selects the group with the highest allowed AFK time.
Crop Generation
Each AFK tick generates crops based on the player's group:
For every generated crop the system applies the normal harvest rules:
XP from the crop
Essence rewards
Drop table from the crop
Hoe level progression
Drops are handled through the normal item storage hook if available.
Item Handling
If a supported storage plugin is installed, crop drops will attempt to go directly into storage first.
If storage cannot accept the items, they will be placed in the player's inventory.
Actionbar Income
AFK farming provides income feedback through the actionbar.
Income values are automatically stacked for a short window to prevent spam.
Example:
The format can be configured through:
AFK Title Display
While AFK farming is active, a title can be shown to the player displaying:
Remaining AFK time
Crops generated per tick
Example configuration:
Available placeholders:
{time}
Remaining AFK time
{crops}
Crops generated per tick
AFK Cancellation
AFK farming stops automatically if the player:
Moves
Leaves the farm area
Leaves the server
Stops holding a Tycoon Hoe
Messages are configurable:
messages.afk.cancel-move
Player moved
messages.afk.cancel-leave
Session expired or player left
messages.afk.not-in-farm
Player left farm area
messages.afk.not-holding-hoe
Player is not holding a Tycoon Hoe
Performance
The AFK system is designed to avoid heavy operations.
It does not:
Break real blocks
Trigger enchant effects
Trigger boss damage
Update crop statistics
Spawn visual harvest effects
This makes the system safe for long AFK sessions and large farms.
Last updated