Описание
# 📘 SleepPoll — Fabric Mod (Minecraft 1.21.11)
*A lightweight, server-side voting system for skipping the night in multiplayer.*
---
## Description
**SleepPoll** is a server-side Fabric mod that replaces vanilla night skipping with a **fair voting system**.
When a player enters a bed, the mod automatically creates a poll.
All online players can vote **YES** or **NO** using clickable chat buttons.
The night is skipped only if the **combined support** of:
- Sleeping players
- Players who vote YES
- AFK Players / Players that didn't vote will automatically vote yes at the end of the poll
meets or exceeds the percentage defined by the `playersSleepingPercentage` gamerule`.
SleepPoll also prevents vanilla from skipping the night prematurely and uses a **smooth 10-second transition** instead.
Perfect for multiplayer servers that want fairness and community-driven control over the night cycle.
---
## Features
### ✔ Night Skip Voting System
- A poll automatically begins when a player enters a bed.
- All players can vote via commands or clickable messages.
- Sleeping players count automatically as YES supporters.
### ✔ Clickable Voting UI
Players receive interactive chat buttons:
[Vote YES] [Vote NO]
### ✔ Bossbar Progress Indicator
Shows:
- Supporters required vs. actual supporters
- A 30-second countdown timer
- A “Skipping Night…” animation after success

### ✔ Based on PlayerSleepingPercentage Gamerule
- Fully respects your configured sleep percentage.
- Vanilla sleeping is disabled during a poll (restored afterward).
### ✔ Smooth Night Skipping
Instead of instantly jumping to day:
- Time advances over **10 seconds**
- A bossbar shows real-time skip progress

### ✔ Automatic Insomnia Reset
YES voters get their **phantom insomnia** reset when the night is skipped by vote.
### ✔ Server-Friendly
- Server-side only (no client mod needed)
- Works with any number of players
- Compatible with most other mods
---
## 📸 Screenshots
### 1. Voting Buttons in Chat

### 2. Poll Progress Bossbar (Example 1 / 2)

### 3. Poll Completion / Night-Skipped Message

### 4. Night Skipping Animation

---
## Commands
| Command | Description |
|---------------|-------------|
| `/vote yes` | Casts a YES vote |
| `/vote no` | Casts a NO vote |
Voting is also available through clickable chat buttons.
---
## Gamerule Support
| Gamerule | Description |
|------------------------------|-------------|
| `playersSleepingPercentage` | Percentage required to skip the night |
Example:
```mcfunction
/gamerule playersSleepingPercentage 60