/teams and /nopvp changes etc.e etc.

This commit is contained in:
Martin Dvořák 2026-09-28 11:40:56 +00:00
commit 7fcaaa3221
12 changed files with 1275 additions and 15 deletions

View file

@ -5,20 +5,30 @@ A quality-of-life SMP plugin for Paper/Folia.
## Features
- **Join messages** — a "Welcome to the SMP" title on every join, friendly welcome messages (including a first-join message that lists the server's plugins and a warning that `/nopvp` abuse is bannable and that combat logging is a bad idea), and a special announcement when the owner logs in.
- **`/nopvp`** — toggle no-PvP mode. While active you cannot damage other players and other players cannot damage you (direct hits, projectiles, pets, lingering potions, and player-deployed explosives such as TNT, TNT minecarts, end crystals and bed bombs). While enabled you also glow so everyone can see you're protected. To stop the immunity being used offensively, protected players (and anyone within **25 blocks** of one) are also blocked from placing, priming or detonating PvP explosives — including redstone-primed TNT whose placer is remembered, and dispensers near a protected player firing TNT/lava/fire charges. No-PvP also can't be switched on while you're in combat. Turning no-PvP *off* starts a **1-hour cooldown** before you can enable it again, and the state persists across restarts so relogging can't bypass it.
- **`/nopvp`** — toggle no-PvP mode. While active you cannot damage other players and other players cannot damage you (direct hits, projectiles, pets, lingering potions, and player-deployed explosives such as TNT, TNT minecarts, end crystals and bed bombs). While enabled a floating **"Pacifist"** label appears above you and, if you're in a team with glow on, you glow in the team's colour (visible to everyone). To stop the immunity being used offensively, protected players (and anyone within **25 blocks** of one) are also blocked from placing, priming or detonating PvP explosives — including redstone-primed TNT whose placer is remembered, and dispensers near a protected player firing TNT/lava/fire charges. No-PvP also can't be switched on while you're in combat. Turning no-PvP *off* starts a **1-hour cooldown** before you can enable it again, and the state persists across restarts so relogging can't bypass it.
- **Anti-combat-logging** — whenever you hit another player or get hit by one, you're tagged as being in combat for **15 seconds** with a chat warning. Logging off while tagged kills you on the spot and announces it to the server.
- **Cosmetic teams** — `/team create/delete/invite/leave/join/color/admin/glow/chat`. Teams are purely cosmetic (friendly fire stays on). The owner runs the show and can promote **admins** who may also invite players and change the colour; membership is request-based rather than open. A team's colour becomes the glow colour of any member who has no-PvP enabled (toggleable with `/team glow`, on by default), and `/team chat` gives the team a private chat channel. Stored in `plugins/qol-tweaks/teams.yml`.
## Commands
| Command | Description | Permission |
|----------|--------------------------------------------------------------------------|-----------------------|
| `/nopvp` | Toggle no-PvP mode (damage immunity vs. players + player glow). | `qoltweaks.nopvp` |
| Command | Description | Permission |
|--------------------------------|----------------------------------------------------------------------|-------------------|
| `/nopvp` | Toggle no-PvP mode ("Pacifist" label + optional team-coloured glow). | `qoltweaks.nopvp` |
| `/team create <name>` | Create a team (you become its owner). | `qoltweaks.team` |
| `/team invite <p>` | Invite an online player, or accept their join request (owner/admin). | `qoltweaks.team` |
| `/team join <team>` | Accept an invite, or send a join request to the team. | `qoltweaks.team` |
| `/team color <clr>` | Set the team glow colour, or `none` to clear (owner/admin). | `qoltweaks.team` |
| `/team admin <add\|remove> <p>`| Promote/demote a member to admin (owner only). | `qoltweaks.team` |
| `/team glow` | Toggle the whole team's no-PvP glow (owner/admin). | `qoltweaks.team` |
| `/team chat [message]` | Send a team-only message, or toggle team chat mode. | `qoltweaks.team` |
| `/team leave` | Leave your team (owners must delete instead). | `qoltweaks.team` |
| `/team delete` | Disband the whole team (owner only). | `qoltweaks.team` |
All permissions default to `true`.
All permissions default to `true`. Note `/team` takes over the vanilla scoreboard-team command.
## Data
Player no-PvP state and cooldown timestamps are stored in `plugins/qol-tweaks/nopvp.yml` so they survive restarts and reloads.
Player no-PvP state and cooldown timestamps are stored in `plugins/qol-tweaks/nopvp.yml` so they survive restarts and reloads. Teams, ownership, admins, members, colours and the glow toggle are stored in `plugins/qol-tweaks/teams.yml`.
## Compatibility