|
1 | | -# 🎯 SSAddon SpawnerLimiter |
| 1 | +# SSAddon SpawnerLimiter |
2 | 2 |
|
3 | | -SSAddon (SmartSpawner Addon) that limits spawner placement per chunk based on spawner stacks, with Folia support! |
| 3 | +SSAddon (SmartSpawner Addon) that limits spawner placement per chunk and per player based on spawner stacks, with Folia support! |
4 | 4 |
|
5 | 5 | [](https://www.minecraft.net/) |
6 | 6 | [](https://papermc.io/) |
7 | 7 | [](https://www.oracle.com/java/) |
8 | 8 |
|
9 | | -## 📋 Requirements |
| 9 | +## Requirements |
10 | 10 |
|
11 | 11 | - **Minecraft**: 1.21.4+ |
12 | 12 | - **Server**: Paper or Folia |
13 | 13 | - **Java**: 21+ |
14 | 14 | - **SmartSpawner**: 1.5.7.1+ |
15 | 15 |
|
16 | | -## 📦 Installation |
| 16 | +## Installation |
17 | 17 |
|
18 | 18 | 1. Install [SmartSpawner](https://modrinth.com/plugin/smart-spawner-plugin) plugin |
19 | 19 | 2. Download SSASpawnerLimiter |
20 | 20 | 3. Place the `.jar` file in your `plugins` folder |
21 | 21 | 4. Restart the server |
22 | 22 | 5. Configure settings in `plugins/SSASpawnerLimiter/config.yml` |
23 | 23 |
|
24 | | -## 🎮 Commands |
| 24 | +## Commands |
25 | 25 |
|
26 | 26 | | Command | Description | Aliases | |
27 | 27 | |---------|-------------|---------| |
28 | 28 | | `/ssaspawnerlimiter reload` | Reload plugin configuration | `/ssalimiter reload` | |
29 | 29 | | `/ssaspawnerlimiter info` | Check spawner count in current chunk | `/ssalimiter info` | |
30 | | -| `/ssaspawnerlimiter check <player>` | Check spawner limit for a specific player | `/ssalimiter check <player>` | |
| 30 | +| `/ssaspawnerlimiter check <player>` | Check spawner limit for player's chunk | `/ssalimiter check <player>` | |
| 31 | +| `/ssaspawnerlimiter checkplayer <player>` | Check player's global spawner count | `/ssalimiter checkplayer <player>` | |
31 | 32 | | `/ssaspawnerlimiter stats` | View plugin statistics | `/ssalimiter stats` | |
32 | 33 |
|
33 | | -## 🔐 Permissions |
| 34 | +## Permissions |
34 | 35 |
|
| 36 | +### Bypass Permissions |
35 | 37 | | Permission | Description | Default | |
36 | 38 | |------------|-------------|---------| |
37 | 39 | | `ssaspawnerlimiter.bypass` | Bypass spawner chunk limit | `false` | |
| 40 | +| `ssaspawnerlimiter.perplayer.bypass` | Bypass per-player spawner limit (unlimited) | `false` | |
| 41 | + |
| 42 | +### Per-Player Limit Tiers |
| 43 | +You can create **custom limit tiers** using the permission pattern: `ssaspawnerlimiter.perplayer.<number>` |
| 44 | + |
| 45 | +**Examples:** |
| 46 | +- `ssaspawnerlimiter.perplayer.1500` → Allows 1500 spawners globally |
| 47 | +- `ssaspawnerlimiter.perplayer.2000` → Allows 2000 spawners globally |
| 48 | +- `ssaspawnerlimiter.perplayer.5000` → Allows 5000 spawners globally |
| 49 | +- `ssaspawnerlimiter.perplayer.10000` → Allows 10000 spawners globally |
| 50 | +- Any number you want! |
| 51 | + |
| 52 | +> **Note:** Players with multiple tier permissions will get the highest value. Default limit is configured in `config.yml` as `max_spawners_per_player`. |
| 53 | +
|
| 54 | +### Command Permissions |
| 55 | +| Permission | Description | Default | |
| 56 | +|------------|-------------|---------| |
38 | 57 | | `ssaspawnerlimiter.command.use` | Base permission for all commands | `op` | |
39 | 58 | | `ssaspawnerlimiter.command.reload` | Use reload command | `op` | |
40 | 59 | | `ssaspawnerlimiter.command.info` | Use info command | `op` | |
41 | 60 | | `ssaspawnerlimiter.command.check` | Use check command | `op` | |
| 61 | +| `ssaspawnerlimiter.command.checkplayer` | Use checkplayer command | `op` | |
42 | 62 | | `ssaspawnerlimiter.command.stats` | Use stats command | `op` | |
43 | 63 |
|
44 | | -## 📖 How It Works |
| 64 | +## How It Works |
| 65 | + |
| 66 | +SSASpawnerLimiter provides **two independent limit systems**: |
45 | 67 |
|
46 | | -SSASpawnerLimiter counts **spawner stacks** instead of just spawner blocks: |
| 68 | +### Chunk-Based Limit |
| 69 | +Limits spawner stacks per chunk to prevent chunk overloading: |
47 | 70 | - 1 spawner block with 64 stacks = **64 count** |
48 | 71 | - 1 spawner block with 6 stacks = **6 count** |
49 | 72 | - **Total in chunk**: 70 count |
| 73 | +- Default: 100 spawners per chunk |
| 74 | + |
| 75 | +### Per-Player Limit |
| 76 | +Limits total spawner stacks a player can place globally: |
| 77 | +- Tracks all spawners placed by each player across the entire server |
| 78 | +- Default: 1000 spawners per player |
| 79 | +- Can be increased via permission nodes (1500, 2000, 5000, etc.) |
| 80 | +- Bypass permission for unlimited spawners |
| 81 | + |
| 82 | +**Both systems can be enabled/disabled independently in `config.yml`:** |
| 83 | +```yaml |
| 84 | +enable_chunk_limit: true # Enable chunk-based limiting |
| 85 | +enable_player_limit: true # Enable per-player limiting |
| 86 | +``` |
| 87 | +
|
| 88 | +### Stack Counting Example |
| 89 | +- Player places 1 spawner with stack size 10 → **Adds 10** to both chunk and player count |
| 90 | +- Player breaks that spawner → **Removes 10** from both counts |
| 91 | +- Player stacks spawner from 10 to 20 → **Adds 10** more to both counts |
| 92 | +- Counts never go below 0 (zero-floor protection) |
50 | 93 |
|
51 | 94 | This ensures fair limiting based on actual spawner capacity, not just physical blocks. |
52 | 95 |
|
53 | | -## 🗄️ Database |
| 96 | +## Configuration |
| 97 | +
|
| 98 | +**config.yml:** |
| 99 | +```yaml |
| 100 | +# Chunk limit settings |
| 101 | +enable_chunk_limit: true |
| 102 | +max_spawners_per_chunk: 1000 |
| 103 | +verify_chunk_count_on_check: true # Verify actual count from SmartSpawner API |
| 104 | + |
| 105 | +# Per-player limit settings |
| 106 | +enable_player_limit: true |
| 107 | +max_spawners_per_player: 500 # Default limit for all players |
| 108 | +``` |
| 109 | +
|
| 110 | +## Database |
54 | 111 |
|
55 | | -The plugin uses SQLite to store spawner chunk data. You can view and manage the database using: |
| 112 | +The plugin uses SQLite to store spawner data in two tables: |
| 113 | +- `spawner_chunks` - Chunk spawner counts |
| 114 | +- `player_spawners` - Per-player spawner counts |
56 | 115 |
|
57 | | -**[SQLite Viewer](https://sqliteviewer.app/)** - A free online tool to view and edit SQLite databases |
| 116 | +**[SQLite Viewer](https://sqliteviewer.app/)** - Free online tool to view and edit SQLite databases |
58 | 117 |
|
59 | 118 | Database location: `plugins/SSASpawnerLimiter/spawner_limits.db` |
60 | 119 |
|
61 | | -## 📄 License |
| 120 | +## License |
62 | 121 |
|
63 | 122 | This project is licensed under the CC-BY-NC-SA-4.0 License - see the [LICENSE](LICENSE) file for details. |
0 commit comments