Plugin Release TogglePvp

Download Link
https://www.spigotmc.org/resources/togglepvp.44918/
Minecraft Versions
1.12-1.18
Compatible Java Versions
1.8 upwards
This is a Simple to use and lightweight plugin for servers that want to allow PVP but also allow friendly players to play the game.
Perfect for Survival/Skyblock servers.

toggle.png

How does it work?
In order for players to be able to PVP one another, they need to both have their PVP enabled via the /Pvp on/off/toggle command.
(The plugin also has support for Force Pvp Enabled Worlds)

What about bows/potions?
In the instance of an Arrow hitting a user when one of them has PVP disabled, It will simply get deleted and the damage (Including fire) canceled.
In the instance of potions splashing it is somewhat more complex. Rather than just deleting all potions, it will cancel the Effect of a "Offensive" potion Eg. Weakness, Poison or Damage.
It only removes the effect from players with PVP disabled.
This is better than just deleting the potion as that would exclude a lot of possibilities between allies that just happen to have PVP disabled.
or PvPers that accidentally hit a friendly, and get their hard-worked for potion deleted.

What About Tamed Animals?
Yep. It supports that too!
It also has the option to protect tamed creatures against damage from other players and tamed wolves (when the owner has PvP disabled or is offline)

And Explosions?
You guessed it, It sure does.​

Commands

Toggling PVP:
Code:
Base Command(s) : /Pvp "TogglePvp, PvpToggle, pvpt, tpvp"
      Arguments:
      - "on" Activates your PVP if not already.
      - "start" Activates your PVP if not already.
      - "off" Deactivates your PVP if not already.
      - "stop" Deactivates your PVP if not already.
      - "toggle" Toggles your PVP.
      - "" Toggles your PVP.

Admin:
Code:
Command(s) :
      - "/togglePvpReload" Reloads Config file.
            Arguments {}
      - "/togglePvpGetWorld" Gets the name of the world that you're in.
            Arguments {}

Permissions

Permissions:
Code:
Permissions(s) :
      - "tau.togglepvp.use" Grants ability to use the /pvp command.
      - "tau.togglepvp.flightbypass" Bypass combat flight restrictions
      - "tau.togglepvp.reload" Grants ability to use the reload & getWorld command.
Code:
# Config for TogglePvp By TAU

Toggle Permission: 'tau.togglepvp.use'
# The permission to give to players to allow the this plugin

Reload Permission: 'tau.togglepvp.reload'
# The permission to give to Users that you wish to be able to /togglepvpreload
# To reload settings FROM the Config without restating.
# (keep in mind this clears Data like Pvp enabled players)

Delay: 10
# The time delay (In seconds) From where after a Player PVP's another
# player they will be able to use /pvp again.

# Should this plugin allow pvp by default?
Default Pvp State: false

# Only works on 1.14+
# Stores the pvp state in the player's NBT
Enable Persistent Pvp State: false

Force PVP Enabled Worlds:
- 'Pvp'
- 'Testing_World'
- 'Another_one'
- 'And_so_on'
# The above World(s) list is a list of worlds that PVP is FORCE enabled.
# And Cannot be disabled by the user.
# The list IS Case sensitive.
# To get the name of the world you are in, Use /togglepvpGetWorld (You must have the Reload Permission)

Pvp Enabled Commands: []
# Commands that will be ran from console when someone turns on pvp
# %player% will be replaced with the players name

Banned Potion Effects:
- 'POISON'
- 'WITHER'
- 'BLINDNESS'
- 'CONFUSION'
- 'HUNGER'
- 'SLOW'
- 'SLOW_DIGGING'
- 'UNLUCK'
- 'WEAKNESS'
# The list here is where you can control what potion effect(s) are to be handled
#   as offensive by this plugin.
# Note: Don't include potion effects such as HURT (Instant Damage)
#       As that is treated as Damage vs. A Long-Term effect such as POISON
# A full list of supported effects can be found Here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionEffectType.html

Protect Tameable Animals: true
# Should this plugin protect Tamed Animals when their Owner has PVP disabled (Or Offline).

# If you want Tameables to be invulnerable at all times and not be able to attack players / other pets
# Ill consider making a plugin, Or Just ask around, I bet there is one out there.

Protect From Unknown Explosions: false
# Should this plugin protect players with PVP disabled from unknown explosions?
# An explosion is unknown when the plugin cannot determine who caused it.

# Enable Damager-Knockback when pvp is disabled and yet pvp is attempted (Only effects players).
Enable Knockback: true
# Set Knockback force multiplier (Float)
Knockback Force: 0.5F

## Messages ##

Animal Owner Offline: " &c>> &7You may not attack this Animal as It's owner is offline."
# The Message to send to a Player that Attacks a Player-Tamed-Wolf when the Owner of that Wolf is Offline
# And cannot have pvp enabled because they are Offline.

MSG In PVP Enabled World ON Pvp CMD: " &c>> &8&oWarning: &r&7pvp is forcefully enabled in this world."
# String, ColorCodes.
# This MSG will be sent to the player that Attempts to toggle their PVP in the Force Enabled Worlds.
# NOTE: This does NOT block people from toggling. Simply Disregards their settings in THAT world.

MSG Usage:
- " &c>> &7Usage: /&bpvp &3on&7, &3enable&7, &3start&7/&3stop&7, &3disable&7, &3off"
- " &c>> &7Toggle Usage: /&bpvp"
# The color-code message to display to a user that does not enter the command correctly.
# Defaults:
#- '&7Usage: /pvp On, Enable, Start/Off, Disable, Stop'
#- '&7Toggle Usage: /pvp'

MSG CombatTaged:
- " &c>> &7You may only toggle your pvp while not in &ccombat"
- " &c>> &7You must wait &b%remainingtime%&7 seconds before toggleing again"
# Stringlist, ColorCodes, (%remainingtime%)=Time_before_they_can_use_the_command Placeholder(s).
# You may use the placeholders %remainingtime% -(In seconds)
# You may use ColorCodes (&)

MSG Pvp is Already DISABLED: " &4>> &7Your pvp is already &cDisabled"
MSG Pvp is Already ENABLED: " &4>> &7Your pvp is already &aEnabled"
# String, ColorCodes.
# These strings handle the messages that will be sent to the player if they Try to set PVP to the same setting it is already on.

MSG Pvp DISABLED: " &8>> &7Your pvp has been &cDisabled"
MSG Pvp ENABLED: " &8>> &7Your pvp has been &aEnabled"
# String, ColorCodes.
# These strings are simple messages to tell a player if their PVP has been enabled or disabled.

Send PVP Disabled Messages On Non-Melee: true
# Should Attack Blocked messages be sent when non-melee attacks are used? (Bows/Potions)

MSG Attack Blocked BASE: " &c>> &7You may not pvp &b%player% &7because"
# String, ColorCodes, (%player%)=Victim PlaceHolder(s)
# The Message that will be sent to the Attacker when they attempt to attack a Player when ether
# the Attacker or the Victim have PVP disabled
MSG Attack Blocked Both Players Disabled: " &c>> &7both &byou &7and &b%player%&7 have pvp &cDisabled"
# String, ColorCodes, (%player%)=Victim PlaceHolder(s)
# Message that will follow up the Base message if Both players have PVP disabled.
MSG Attack Blocked You Disabled: " &c>> &7you have pvp &cDisabled"
# String, ColorCodes
# Message that will follow up the Base message if the Attacker has pvp disabled.
MSG Attack Blocked Other Player Disabled: " &c>> &b%player%&7 has pvp &cDisabled"
# String, ColorCodes, (%player%)=Victim PlaceHolder(s)
# Message that will follow up the Base message if the Victim has pvp disabled.

Attack MSG Cooldown: 1.0
# When set above 0.0 it will cause the plugin to not send any subsequent messages until this delay expires.
# This only affects messages sent from some form of attack

Change Tab Name Colors of Players: false
# Should the plugin change players tab list name colors to the below to reflect their pvp state

Tab Name Color when PVP is Off: '&a'
# Only true if "Change Tab Name Colors of Players" is true
# Can be '' to not change the color at all

Tab Name Color when PVP is On: '&c'
# Only true if "Change Tab Name Colors of Players" is true
# Can be '' to not change the color at all

#Misc Advanced Messages

Misc:
  No Permission: " &4>> &7no permission"
  ConsoleIsNotPlayer: " &4>> &&Console is not a player."
  Reload: " &8>> &aTogglePvp &7reloading"
  Reloading: " &8>> &aTogglePvp &7reloaded"
  ConsoleCannotPvp: " &4>> &7Last I checked, console couldn't pvp"
# Misc ColorCode(Not recommended for console) messages.
# Defaults:
# ' &cNo Permission'
# ' Console is not a player.'
# ' TogglePvp reloading'
# ' TogglePvp reloaded'
# ' Last I Checked, Console couldn''t PVP'
# If deleted the plugin will default to pre-set 'MSG Misc' messages.

# section for manipulating placeholders
placeholders:
  # the following two values are for the %togglepvp_state% placeholders
  pvp enabled: "Enabled"
  pvp disabled: "Disabled"

#######
# END #
#######

# Plugin by Tau (IGN: TauCubed or UwUberUwU)

# No Touchy
Config Version: 9
# No Touchy
%togglepvp_state%
Players PvP state.

%togglepvp_remainingtime%
Remaining time before player can change PvP states after combat.

Features
Allows Player to toggle their PVP on and off.
Blocks changing to Non-Pvp mode while in Pvp after a configurable delay
Supports multiverse servers, Allowing for Force PVP enabled worlds.
Disable flight of users while in combat.
Disable specific commands while in combat.
You can configure almost everything to your liking.
Simple and easy to use.
PlaceholderAPI support​

Why not check out my other resources?

if you have an issue, please don't use the reviews for it. Just send me a message or write it in discussion. Remember: this plugin is free, I have a Job. keep that in mind.
 
Last edited:

Tau

New member
Jan 12, 2022
12
2
3
Update: 5.2

This update allows you to disable flight of users that don't have tau.togglepvp.flightbypass permission as well as allowing you to set a list of disabled commands while they are in combat with another user.

To access these features you'll need to regenerate your config.