Skip to content

mrfdev/PvPToggle

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

1MB-PvPToggle

1MB-PvPToggle lets players toggle their own PvP state with /_pvp while still allowing staff to inspect or change another player's state. The plugin stores its configuration in plugins/1MB-PvPToggle.

/_pvp is the primary command. An optional /pvp alias can also be registered from config.yml for setups that do not already use another plugin such as CMI for /pvp.

Commands

/_pvp

Shows your current PvP state and the command help summary.

/_pvp status

Shows your current PvP state.

/_pvp status <player>

Shows another player's PvP state.

/_pvp toggle

Switches your PvP state between on and off.

/_pvp on

Turns your PvP on.

/_pvp off

Turns your PvP off.

/_pvp <player>

Shows another player's PvP state.

/_pvp toggle <player>

Toggles another player's PvP state.

/_pvp on <player>

Turns another player's PvP on.

/_pvp off <player>

Turns another player's PvP off.

/_pvp reload

Reloads the plugin configuration.

Command Examples

/_pvp

/_pvp toggle

/_pvp off

/_pvp status

/_pvp Steve

/_pvp status Steve

/_pvp toggle Steve

/_pvp reload

/pvp toggle

Only available when SETTINGS.REGISTER_PVP_ALIAS is enabled when the plugin starts and /pvp is not already owned by another plugin.

Permissions

pvptoggle.allow

Allows a player to use /_pvp {toggle|on|off|status}. Default: true

pvptoggle.others

Allows a player to view another player's PvP state with /_pvp <player> or /_pvp status <player>. Default: op

pvptoggle.others.set

Allows a player to change another player's PvP state with /_pvp {toggle|on|off} <player>. Default: op

pvptoggle.bypass

Allows a player to bypass the /_pvp off cooldown. Default: op

pvptoggle.reload

Allows a player to reload the config with /_pvp reload. Default: op

Localization

Locale files live in plugins/1MB-PvPToggle/Translations/.

config.yml controls which file is loaded through SETTINGS.LOCALE, which maps to Locale_<locale>.yml.

Locale messages support MiniMessage formatting such as <green>, <red>, and <bold>.

Command alias changes such as SETTINGS.REGISTER_PVP_ALIAS apply after a plugin or server reload because commands are registered through Paper's lifecycle API.

Runtime settings such as particles, blocked worlds, and persistence handling are reapplied to online players when /_pvp reload is used.

This fork includes a Gradle wrapper, so a fresh clone can build with ./gradlew build.

Builds produce the versioned development jar in build/libs/ and copy the same versioned release jar into libs/ without deleting older jars.

./gradlew printBuildConfig prints the Java target, Paper API dependency, runtime target, and the plugin api-version compatibility floor.

Config Notes

SETTINGS.PERSISTENT_PVP_STATE

When disabled, the plugin does not create the plugins/1MB-PvPToggle/Data/ folder.

SETTINGS.PARTICLE_TYPE

Controls which particle is used for PvP-enabled players. DUST supports configurable color and size, and particles that require extra item/block data are rejected with a warning and fall back to DUST.

SETTINGS.PARTICLE_INTENSITY

Controls how many particle points are rendered in the ring effect.

SETTINGS.DEBUG

Enables extra logs for command handling, state changes, and /pvp alias registration diagnostics.

SETTINGS.VERBOSE_STARTUP

Logs a one-time startup summary with the active locale, alias state, persistence mode, particle settings, and other runtime details.

Local Testing

Use the centralized Paper runner at /Users/floris/Projects/Codex/servers/run-test-server.

Do not create or rely on a local servers/ folder in this repo.

Example:

/Users/floris/Projects/Codex/servers/run-test-server --paper 1.21.11 --plugin libs/<jar>.jar --foreground

/Users/floris/Projects/Codex/servers/run-test-server --paper 26.1.2 --plugin libs/<jar>.jar --foreground

Placeholders

Requires PlaceholderAPI.

%PvPToggle_pvp_state%

Returns the player's PvP state as colored text.

%PvPToggle_pvp_symbol%

Returns the PvP status symbol used by the plugin.

%PvPToggle_pvp_state_clean%

Returns a plain true or false style PvP state value.

%PvPToggle_pvp_enabled%

Returns true when PvP is enabled and false when it is disabled.

%PvPToggle_pvp_state_text%

Returns enabled or disabled.

%PvPToggle_pvp_state_onoff%

Returns on or off.

%PvPToggle_pvp_state_color%

Returns the legacy color code used by the plugin for the current PvP state.

%PvPToggle_pvp_state_display%

Returns a colored Enabled or Disabled display value.

Credits

Original work by aasmus and the456gamer.

Fork modifications by the Red Fusion Team, Greymagic27, and mrfloris.

Support

Support is focused on Java 25 with Paper 1.21.11 and Paper 26.1.2.

Spigot is not a target for this fork.

About

Plugin to toggle Player vs. Player combat https://www.spigotmc.org/resources/pvptoggle.49112/

Resources

License

Stars

Watchers

Forks

Contributors

Languages

  • Java 100.0%