Tags
Creators
Details
Licensed Apache-2.0
Published last year
Updated 10 months ago
All versions
1.3.0
Release
AutoAfkSleep 1.3.010 months ago 320
Uploaded by
Compatibility
Minecraft: Java Edition
1.21.9–1.21.10
Platform
Fabric
Supported environments
Client-side
Required content
Any compatible version
Changes
Changelog
[1.3.0] - 2025-10-09
Performance Improvements
- Bed Position Caching: Added intelligent caching of successful bed positions (1 minute cache duration)
- Dramatically reduces block lookups on subsequent sleep attempts
- Falls back to full search if cached bed is no longer valid
- Optimized Bed Search Radius: Reduced from 3 to 2 blocks (within actual interaction range)
- Eliminates unnecessary block scanning beyond usable range
- Improves performance without affecting functionality
- Smarter AutoEat Processing: Now only processes during night-time checks
- Reduces unnecessary food inventory scans during daytime
- Consolidates AFK maintenance operations for better efficiency
- Reduced Log Verbosity:
- Added debug vs info level distinction for approach-to-night logging
- Removed spam from coordinate overlays and system messages
- Better signal-to-noise ratio in logs
Enhanced User Experience
- Progressive Bed Warnings: Added informative in-game messages when no bed found
- First attempt: Shows interaction range and retry timer
- Second attempt: Brief reminder
- Third attempt: Waits until next night cycle
- Bed Validation: Now validates bed existence before attempting interaction
- Prevents interaction failures with removed/destroyed beds
- Skips to next bed candidate if current one is invalid
Chat Processing Refinements
- Improved Keyword Filtering: Refined sleep-related keywords for more accurate detection
- Removed overly broad keywords ("night", "there", "hello")
- Added specific sleep-state keywords ("asleep", "sleeping")
- Reduces false-positive auto-responses
- Enhanced System Message Detection: Added patterns for Discord bridge and welcome messages
- Better filtering of server announcements
- Fewer inappropriate auto-responses to system messages
Technical Updates
- Fabric Loader: Updated minimum requirement from 0.16.0 to 0.17.0
- Includes MixinExtras 5.0.0 and Fabric Mixin 0.16.3+mixin.0.8.7
- Fabric API: Updated minimum requirement to 0.130.0+1.21.8
- Ensures compatibility with latest Fabric ecosystem improvements
Fixed
- Better handling of edge cases when beds are destroyed during sleep attempts
[1.2.1] - 2025-08-15
Fixed
- AutoEat Slot Selection: Fixed critical issue where food wouldn't be selected properly
- Added Mixin accessor to properly access and modify the selected hotbar slot
- Now correctly switches to food slot before attempting to eat
- Synchronizes slot changes with server using packets
- Log Spam: Removed excessive logging from overlay messages (coordinates, etc.)
- Code Quality: Removed all blocking operations, improved state management
Technical
- Implemented Mixin system for accessing private PlayerInventory.selectedSlot field
- Simplified slot switching logic - direct modification instead of complex workarounds
- Better error handling and state validation
[1.2.0] - 2025-08-15
Added
- AutoEat Feature: Automatically eats food when hunger drops below threshold
- Prioritizes non-magical food (bread, meat, etc.) over magical food (golden apples, etc.)
- Avoids poisonous food (rotten flesh, spider eyes, poisonous potatoes, etc.)
- Configurable hunger threshold (default: 14/20)
- Option to eat stews/soups (default: enabled)
- Minimum food value filter (default: 2)
- Auto-disconnect when out of safe food and critically hungry
- AutoEat Configuration:
- GUI controls in config screen
- Commands:
/autoafksleep config autoEat,autoEatThreshold, etc. - Persistent settings in config file
Changed
- Updated mod description to include AutoEat functionality
- Enhanced status command to show AutoEat status
Technical
- Non-blocking food consumption with proper timing (1.6 seconds)
- Smart food selection algorithm prioritizing safety and efficiency
- Integrated with existing mod enable/disable system
[1.1.0] - 2025-08-12
Performance Improvements
- Intelligent Scheduling: Now calculates exact time until night instead of constant polling
- Reduced Server Load: Polling frequency reduced by 6x during night (5s → 30s)
- Resource Efficiency: During day, waits up to 10 minutes without any CPU usage
- Optimized Bed Finding: Uses BlockPos.Mutable and early distance checks for better performance
Code Quality
- Fixed Critical Bug: Removed Thread.sleep() from event handlers (was blocking game thread!)
- Non-blocking Operations: Replaced with CompletableFuture for async message sending
- Better Modularity: Extracted time calculations and bed finding into dedicated methods
- Pattern Matching: Pre-compiled regex and HashSet lookups for faster message processing
New Features
- Configurable Timing: All timing parameters now adjustable in config file
- Failure Backoff: Stops attempting after configurable consecutive failures
- Dimension Caching: 5-second cache for dimension checks to reduce overhead
- Smart Recovery: Resets failure counter when day arrives
Changed
- Wake-up margin before night: configurable (default 30s)
- Check interval during night: configurable (default 30s)
- Check interval after failures: configurable (default 60s)
- Maximum consecutive failures: configurable (default 3)
- Chat response cooldown: configurable (default 30s)
- Sleep attempt cooldown: configurable (default 3s)
[1.0.1] - 2025-08-06
Fixed
- Fixed chat message processing - now properly detects both player and server messages
- Fixed disconnect phrase detection - players can now test by typing the phrase themselves
- Fixed auto-response triggers - now responds to messages containing sleep/AFK keywords
Changed
- Removed auto-disable on shutdown feature - mod settings now persist between sessions
- Simplified message processing logic - only ignores the mod's own auto-response messages
- Improved auto-response detection for various chat formats
[1.0.0] - 2025-08-04
Initial Release
Features
- Automatic Sleeping: Automatically uses beds when night falls if within 2 blocks
- Smart Timing: Checks more frequently as night approaches to save resources
- Chat Monitoring: Responds to direct messages and @mentions with customizable messages
- Disconnect Phrase: Set a custom phrase that disconnects you from the server
- Failure Actions: Choose what happens when unable to sleep (disconnect, custom command, or nothing)
- Configuration GUI: Easy-to-use settings screen accessible via keybind (default: K)
- Commands: Full command system for all features (
/autoafksleep help) - ModMenu Integration: Access settings through ModMenu if installed
Technical Details
- Client-side only mod
- Supports Minecraft 1.21.8+
- Requires Fabric API
- Compatible with other mods
- Lightweight and efficient
Known Limitations
- Only works in the Overworld (beds explode in Nether/End)
- Requires being within 2 blocks of a bed
- Sleep may fail on some servers with custom sleep mechanics
Acknowledgments
- Special thanks to the players at MCVerse City (https://mcverse.city/) for testing and providing valuable feedback during development
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:70PMZ1cL:iqZwtkev"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:70PMZ1cL:iqZwtkev"
}

