Welcome to the Hangar Open Beta. Please report any issue you encounter on GitHub!
Avatar for Amethyst-Developers

A modern sleep voting system for Paper servers that transforms night-time gameplay with democratic polling.

Report SleepPolls?

SleepPolls

A modern sleep voting system for Paper servers that transforms night-time gameplay with democratic polling.


SleepPolls Logo

SleepPolls

Modern sleep voting for Paper servers.


๐ŸŽฏ Overview

SleepPolls is a sophisticated Minecraft plugin that revolutionizes how servers handle sleep mechanics. Instead of a single player automatically skipping the night for everyone, SleepPolls initiates a real-time democratic vote. Players receive beautiful interactive vote buttons, live countdown displays, and instant feedbackโ€”all while maintaining server performance and customization options.

Perfect for survival servers, SMPs, and communities that value collaborative decision-making.


โœจ Features

  • ๐ŸŒ™ Sleep Voting System โ€” When a player enters a bed during night, an instant poll launches to determine if the night should be skipped
  • ๐Ÿ–ฑ๏ธ Clickable Vote Buttons โ€” Interactive YES/NO buttons with hover previews using Adventure API components
  • ๐Ÿ“Š BossBar Display โ€” Real-time countdown timer with vote progress tracking (toggleable per player)
  • ๐Ÿ’ฌ ActionBar Updates โ€” Live vote count and remaining time displayed above the hotbar
  • ๐Ÿ”Š Audio Feedback โ€” Customizable sound effects for poll start and countdown completion
  • โฐ Configurable Duration โ€” Adjust poll length from 15 to 60+ seconds based on server size
  • ๐Ÿ“ˆ Flexible Vote Requirements โ€” Set the percentage needed (50-100%) for night skip approval
  • ๐Ÿ˜ด AFK Detection โ€” Seamless EssentialsX integration to exclude AFK players from polls
  • ๐ŸŒ World Blacklist โ€” Disable polls in specific worlds (lobbies, minigames, creative)
  • โšก Minimum Player Validation โ€” Polls require at least 2 active players to initiate
  • ๐ŸŒง๏ธ Weather Control โ€” Optional auto-clearing of rain and thunder on successful skip
  • โš™๏ธ Production-Ready Configuration โ€” Extensive YAML config with sensible defaults
  • โœ… Permission System โ€” Fine-grained control over who can reload config or toggle bossbars

๐Ÿ“ฆ Installation

Prerequisites

  • Server Software: Paper 26.1.2 or later
  • Java Version: Java 25 or later
  • Minecraft Version: 26.1+
  • Optional Dependency: EssentialsX (for AFK detection)

Installation Steps

  1. Download the plugin

    • Download the latest SleepPolls-*.jar from Here
  2. Place the plugin in your plugin folder

  3. Start or restart your server

  4. Verify installation

    /sp version
    # Output: Running SleepPolls 1.0.0
    
  5. Configure

    • Edit plugins/SleepPolls/config.yml to customize behavior
    • Reload with /sp reload without restarting

๐ŸŽฎ Commands

Command Aliases Description Permission
/sleeppoll help /sp help Display the help menu None
/sleeppoll version /sp version Show plugin version None
/sleeppoll status /sp status View current poll information (world-specific) None
/sleeppoll yes /sp yes Vote YES to skip the night None
/sleeppoll no /sp no Vote NO to keep the night None
/sleeppoll bossbar /sp bossbar Toggle personal BossBar notifications sleeppolls.bossbar
/sleeppoll reload /sp reload Reload configuration from disk sleeppolls.reload

๐Ÿ” Permissions

Permission Default Description
sleeppolls.reload Op only Allows use of /sp reload command
sleeppolls.bossbar Everyone Allows toggling BossBar notifications per-player

Note: Voting commands (yes, no, status, version, help) are available to all players without special permissions.


โš™๏ธ Configuration

The plugin uses a single YAML configuration file located at plugins/SleepPolls/config.yml. Edit this file and run /sp reload to apply changes without restarting.

Poll Settings

# Duration of a sleep poll in seconds.
#
# Recommended values:
#   15  = Fast-paced servers, quick decision-making
#   20  = Balanced (default, recommended)
#   30+ = Large SMPs, slower decision-making
poll-duration-seconds: 20

# Percentage of YES votes required to skip the night.
#
# Examples:
#   50  = Simple majority (half + 1)
#   60  = Moderate consensus
#   75  = Strong consensus required
required-percentage: 50

BossBar Settings

bossbar:
  # Enables the BossBar countdown display.
  # Shows remaining time, required votes, and current YES votes.
  # Players can disable this individually with /sp bossbar
  enabled: true

Sound Settings

sounds:
  # Enables all plugin sounds.
  # Includes poll start alert and countdown completion.
  # Players with sound disabled in-game won't hear these.
  enabled: true

Weather Settings

weather:
  # Automatically clear rain after a successful poll
  clear-rain: true

  # Automatically clear thunder after a successful poll
  clear-thunder: true

World Settings

worlds:
  # List of worlds where sleep polls are COMPLETELY DISABLED.
  # Entering a bed in these worlds will not trigger a poll.
  #
  # Common examples:
  #   - lobby      (prevents poll spam in hub areas)
  #   - spawn      (keeps spawn peaceful)
  #   - minigames  (prevents polls during activities)
  blacklist:
    - lobby
    - minigames

Example Configurations

Fast-Paced PvP Server (emphasizes quick decisions)

poll-duration-seconds: 15
required-percentage: 50  # Simple majority
bossbar:
  enabled: true
sounds:
  enabled: true

Large Community SMP (emphasizes consensus)

poll-duration-seconds: 30
required-percentage: 65  # Stronger consensus
bossbar:
  enabled: true
sounds:
  enabled: true

๐Ÿ”„ How It Works

The Polling Flow

  1. Initiation: A player attempts to enter a bed during night time (13000โ€“23000 game ticks)
  2. Eligibility Check: Server calculates active voters:
    • Online players in the same world
    • Non-AFK players (EssentialsX integration)
    • Non-spectator mode
    • Alive players
    • Minimum 2 players required
  3. Vote Notification: All eligible voters receive:
    • Chat message with clickable [โœ” YES] and [โœ– NO] buttons
    • BossBar countdown timer (if enabled)
    • Sound alert (if enabled)
  4. Voting Window: Players vote using /sp yes or /sp no (or click buttons)
  5. Real-Time Display: ActionBar shows live vote count and remaining seconds
  6. Result Resolution:
    • SUCCESS: YES votes reach required percentage โ†’ Night skipped, weather cleared, success message
    • FAILURE: Time expires or NO votes prevent majority โ†’ Night continues, failure message
    • DUPLICATE: Poll already active in world โ†’ User receives "poll in progress" message

Vote Calculation

The plugin calculates required votes dynamically:

votes_needed = ceil(total_eligible_players ร— (required_percentage รท 100))

Example with 8 players and 50% requirement:

  • votes_needed = ceil(8 ร— 0.50) = 4
  • At least 4 YES votes needed out of 8 eligible voters

AFK Handling

If EssentialsX is installed, SleepPolls automatically:

  • Detects AFK players using EssentialsX API
  • Excludes AFK players from the eligible voter pool
  • Does NOT count their vote slots toward requirements

If EssentialsX is not installed, all online players are considered active.

Cooldown & Minimum Players

  • No hard cooldown between polls, but each poll must finish naturally
  • Minimum 2 active players required to start a poll
  • One poll per world at a time (attempting to sleep during active poll cancels bed entry)

๐Ÿ› ๏ธ Technical Details

Architecture

  • Framework: Built on the modern Paper Bootstrapper system for optimal performance
  • Command Framework: Lamp 4.0.0-rc.12 for flexible, maintainable command routing
  • Text Components: Adventure API for rich, interactive chat elements with click events
  • Integration: Native Paper API + optional EssentialsX hooking
  • Packaging: Shadow Jar with relocated Lamp library to prevent conflicts

Build System

  • Build Tool: Gradle with Kotlin DSL
  • Compilation: Java 25 target with -parameters flag for preserved method names
  • Output: SleepPolls-1.0.0.jar (all-in-one, plugin-ready)

Dependencies

Dependency Version Scope Purpose
Paper API 26.1.2 Compile Server API and Bootstrap system
Lamp 4.0.0-rc.12 Shade Command routing framework
EssentialsX 2.21.1 Optional AFK player detection
Gson 2.13.1 Paper-provided JSON configuration loading

๐Ÿ—บ๏ธ Roadmap

  • Multi-World Vote Averaging โ€” Aggregate votes across linked worlds
  • Vote Streaks & Achievements โ€” Track player voting patterns and unlockable badges
  • Custom Vote Messages โ€” Configurable titles, formats, and colors in messages
  • Statistics Dashboard โ€” /sp stats command showing historical poll data
  • PlaceholderAPI Integration โ€” Placeholders for leaderboards and info displays
  • Alternative Vote Methods โ€” Inventory GUIs or sign interactions for voting
  • Economy Integration โ€” Optional voting costs/rewards for relevant plugins
  • Time Skip Customization โ€” Configure exactly how many ticks to skip on success

๐Ÿค Contributing

Contributions are welcome! To contribute:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/your-feature)
  3. Commit changes with clear messages
  4. Push to your fork (git push origin feature/your-feature)
  5. Open a Pull Request with a description of changes

Development Setup

# Clone the repository
git clone https://github.com/Amethyst-Developers/Sleep-Polls.git
cd Sleep-Polls

# Build the plugin
./gradlew build

# Run the test server
./gradlew runServer

# Output JAR location
# build/libs/SleepPolls-1.0.0.jar

Code Style

  • Follow standard Java naming conventions
  • Use 4-space indentation
  • Preserve Adventure API component builders for readability
  • Add comments for complex game logic

๐Ÿ“„ License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0-or-later).


๐Ÿ™‹ Support & Community

  • Issues: Report bugs or suggest features on GitHub Issues
  • Documentation: Full config guide included in config.yml
  • Questions: Ask in plugin comments or community forums

๐Ÿ‘ฅ Credits

SleepPolls is developed and maintained by Amethyst Developers.

Built with:

  • Paper โ€” Best-in-class Minecraft server software
  • Adventure โ€” Modern text components
  • Lamp โ€” Powerful command framework

Made with โค๏ธ for the Minecraft community

Information

CategoryGameplay
Published onMay 29, 2026
LicenseGPL
Downloads2
Stars1
Watchers0
Supports Folia

Pinned Versions