-
Notifications
You must be signed in to change notification settings - Fork 0
optout
Valor edited this page Nov 9, 2025
·
1 revision
Table of Contents
- Command: /rarespawns optout
- Permission: rarespawns.optout
- Usage: Player-only command that toggles whether rares will spawn near you.
- Effect: When enabled, the player is opted out and the plugin will skip spawning rares around them. Running the command again re-enables rare spawns for that player.
- Toggles the player's opt-out flag in memory and provides feedback:
- When opting out: you receive a message like "Rares no longer spawn around you."
- When opting back in: you receive "Rares again spawn around you."
- The command is only executed for actual Player senders (console/command-block cannot toggle).
- The in-memory opt-out list is consulted by the spawn logic; SpawnEvent checks PlayerOptOut.isOptedOut(...) and aborts rare spawn replacements when the nearest player has opted out.
- Opt-out data is persisted to optout.yml by the plugin's PlayerOptOut helper (saved on plugin shutdown and reloaded on enable).
- Note: persistence happens via the plugin’s lifecycle methods (init/load and shutdown/save).
- Toggle opt-out (player): /rarespawns optout
- Tab completion:
- If you have permission, the command appears in tab suggestions for /rarespawns.
- Nothing happens when you run it:
- Ensure you are a player (not console).
- Confirm you have the rarespawns.optout permission.
- Opt-out didn't persist after restart:
- Opt-out state is saved on plugin shutdown; check optout.yml and plugin logs if something looks wrong.
- Rares still spawn nearby after opting out:
- The spawn logic checks the nearest player; if another nearby player has not opted out, rares may still spawn for them. Opt-out only prevents rare spawns that consider the opting-out player as the relevant nearby player.
- Command is implemented in CommandOptOut and toggles state via PlayerOptOut.toggleOptOut(player).
- SpawnEvent checks PlayerOptOut.isOptedOut(player) when determining whether to replace a natural spawn with a rare.
- Tab completion and command routing require the rarespawns.optout permission to be visible/usable.