Inactive [FUN] PvPToggle v2.2.1 - Allows players to enable or disable individual pvp status [1.3.2-R1.0]

Discussion in 'Inactive/Unsupported Plugins' started by Sleelin, May 22, 2011.

  1. Offline

    Sleelin

    PvPToggle - PvP Toggling Plugin:
    Version: v2.1.0

    Project moved to BukkitDev
    (this thread will no longer be updated)

    Show Spoiler

    Allows players to decide whether or not they want PvP to be enabled or disabled, and stops PvP attacks when either the attacker or defender has PvP disabled. Also allows admins to toggle global or world-specific PvP, or the PvP status of a specific player, in a specific world. Muti-world compatible, Permissions combatible.

    Features:
    Pretty much stated above, but hey, here they are anyway:
    • Individual, player-specific enabling or disabling of PvP
    • Global PvP control
    • World-specific PvP control
    • Permissions support - only allow certain groups or players access to specific functions
    • Multiworld support - configure which world you want the plugin to be active in
    • Cooldown timer - set time since last conflict in seconds before users can disable PvP again
    Download: here (see BukkitDev)​
    Source Code: here

    Commands:
    • /pvp [on|off|status] [player] [world] - Toggles or checks status of PvP for you or a specific player
    • /tpvp [on|off|status] [player] [world] - Alias for /pvp
    • /gpvp [on|off|status] [world] - Toggles or checks status of global or world-specific PvP
    Installing:

    • Place in your Bukkit plugins folder, run/reload once, this autogenerates a config file.
    • For each world, set logindefault to either true or false depending on whether you want it enabled or disabled for each player on login, and pvpenabled to either true or false to depending on whether you want world-wide PvP enabled or disabled on startup
    • The autogenerated config file should contain a list of all your worlds, but if it doesn't, add them manually as follows:
      • Edit the config file, and add the name of each world you run under the "worlds" parameter, in the YAML format (see sample config below).
      • In addition to entering your worlds, you must also specify whether or not you want PvP to be enabled or disabled by default. To do this, under the name of the world, enter both pvpenabled and logindefault as mentioned above (see config example below).
    • Make sure your world config files have PvP set to allowed, or this plugin won't work.
    Sample Config File:

    Replace all "----" with 4 spaces (i.e. 4 of this: " ")
    Show Spoiler
    globalDiabled: false
    cooldown: 5
    worlds:
    ----world:
    --------logindefault: true
    --------pvpenabled: false
    ----testing:
    --------logindefault: true
    --------pvpenabled: true
    ----herp:
    --------logindefault: false
    --------pvpenabled: false
    ----derp:
    --------logindefault: true
    --------pvpenabled: true

    Permissions nodes:
    • pvptoggle.use
      • Enable usage of the pvptoggle plugin (i.e. status check when hit)
    • pvptoggle.command.toggle
      • /pvp [on|off]: individual pvp toggling
    • pvptoggle.command.status
      • /pvp status: check individual pvp status
    • pvptoggle.admin
      • /pvp [on|off|status] [player]: modify or check status of specific player in sender's current world
      • /pvp [on|off|status] [player] [world]: modify or check status of specific player in specified world
      • /pvp [on|off] *: modify status of all players in sender's current world
      • /pvp [on|off] * [world]: modify status of all players in specified world
    • pvptoggle.gcommand.status
      • /gpvp status: checks global pvp status
      • /gpvp status [world]: checks pvp status in specified world
    • pvptoggle.gadmin
      • /gpvp [on|off]: toggles global pvp status
      • /gpvp [on|off] [world]: toggles pvp status in specified world
    To-Do:


    - Create automatically enable PvP on combat flag

    Changelog:
    v0.3.1:
    - Added support for Citizens NPC plugin: no longer spews console errors when players attack NPCs
    v0.3.0:
    - Added option for cooldown between last conflict and disabling PvP
    - Added console support for toggling PvP status of specific players, or all players in a specific world, or across all worlds
    v0.2.5:
    - Updated multiworld support to use bukkit-dependent world detection (fixes issues with misconfiguration causing errors)
    - Swapped to YAML config file format for ease of use
    Show Spoiler
    v0.2.3:
    - Added persistence across player sessions
    - Fixed bug in /pvp with no arguments
    v0.2.1:
    - Fixed severe errors on reload (to do with initialising players)
    - Fixed /pvp status [player] [world] - it actually works now
    v0.2.0:
    - Added multiworld support
    - Tidied up command handling
    v0.1.0:
    - Initial release
     
    AS1LV3RN1NJA likes this.
  2. Offline

    Sleelin

    Released version 0.2.5 containing bug fixes and proper Bukkit multiworld support.

    Your current version will work fine, however I recommend updating.
    See changelog for more information on the changes.

    Also, when updating, a new config file is generated. You will have to edit it to match your old config.
     
  3. Offline

    HEmile

    Thanks, been looking for something like this :)
     
  4. Offline

    ineff

    Any chance you can enable the commands being run from the console?
    Because I'd LOVE to use this mod!

    Code:
    15:55:32 [INFO] This command cannot be run from the console!
     
  5. Offline

    Sleelin

    Released version 0.3.0 of PvPToggle which includes a cooldown timer between last conflict and when the user can disable PvP again, as well as the ability to toggle specific players', specific worlds' or all worlds' PvP status!

    If you are upgrading from 0.2.5 and wish to use the cooldown feature, please add "cooldown: x" to your config.yml file, where x is the number of seconds before users can disable PvP again.
     
  6. Offline

    fortress_na-f

    Make your plugin with iConomy compatible!
    I mean, if one person has won the duell he get some money and the other will loose some money.
    It is only an idea, but it should be nice ;)

    fortress_na-f
     
  7. Offline

    Guzmanus

    On my server it doesn't generate the configuration file :/
    where should it be located?
    BTW; great plugin idea!
    Allright FIXED, ty
     
  8. Offline

    Asphodan

    Any way you can make it so that their PvP-disabled status will go away on restart, or on a timer? I want to charge them Currency (With Command iConomy) to use the PvP disable command.
     
  9. Offline

    Gogosjon

    Great! - Will test it soon.
     
  10. Offline

    morizuki

    waaa.. this conflict in PVPReward :(
     
  11. Offline

    Sleelin

    @morizuki: yes, I know, that's why I added /tpvp as an alias for /pvp.
     
  12. Offline

    Kiwibird

    I have a suggestion to add that will make this plugin even more robust. Would it be possible to autoflag players for PvP if they perform an "unfriendly" action towards another? So if Player1 punches(detectable damage) Player2, Player1 will now be flagged for PvP. Player2 cannot be harmed since they are not flagged but if Player2 attacks Player1 back, they are now both able to damage each other. The cooldown that you have implemented would start counting down after their last unfriendly action. "/pvp on" would override all though.

    So basically,
    A damaging action towards another player flags you for PvP. You kind of have all the back end there already. This is just making it convenient I suppose. It makes it interesting too (accidental flags)! Perhaps allow the options for disabling auto-flag with certain items(blocks, fists, etc.).

    I don't know. Just a suggestion that you may have already considered.
     
  13. Offline

    r0u9hneck

    Thanks for this plugin. It definately comes in handy. But I've got one request. Could you add support for citizens? left-clicking a npc causes pvptoggle to error. I guess pvptoggle still works, but the console getting filled up with errors is kinda annoying. It tries to create a user for the NPC or smth.. dunno. Or at least give a option to disable those errors outputs?
     
  14. Offline

    Sleelin

    @Kiwibird: you're right, I do have all the necessary backend for automatic flagging as in-combat, I'll look into adding this as soon as possible! It'll probably come in v0.4.0, and I'm not sure when this will be released because I'm a little bit busy right now.

    @r0u9hneck: I completely agree, I run this on my own server and have noticed the error message that comes from attacking an NPC. They don't affect anything, no damage done anywhere, just some annoying console messages :(
    Anyway, this will be fixed in 0.3.1 which will be released as soon as possible!
     
  15. would be cool if the name of a pvp-toggled would change color, the name above the head
     
    fneyret likes this.
  16. Offline

    QQCucumber

    Any ETA on 0.3.1?
     
  17. Offline

    Sleelin

    @QQCucumber: right now ;)

    Released PvPToggle v0.3.1 which includes support for the Citizens NPC plugin.
    No changes to the config file needed.
     
  18. Offline

    ScottSpittle

    Great Plugin.. only one thing i would change..
    As i have access to both normal /pvp off and admin /pvp off
    when i type /pvp off it disables it for both me and the world im in at the same time..
    even if i type /pvp off [name] [world]
     
  19. Offline

    Sleelin

    @ScottSpittle: I can't seem to recreate this. I'll have to look into it.
     
  20. Offline

    ScottSpittle

    ok thanks bro. Everyone on my Server LOVES this plugin becasue before i had to have pvp disabled for obvious reasons.. Server = Muezli-Server.com come play
     
  21. Offline

    Monkz

    Im noticing this mostly as a problem with admins, but when i toggle pvp on sometimes people cant hurt me but i can hurt them. And its a big problem, because I host a pvp server with one faction who doesnt PvP, but it forces this plugin on admins and we keep running into issues when we try to pvp.
     
  22. Offline

    ScottSpittle

    the only way that happens is if you have 'God Mode' on
     
  23. Offline

    Sleelin

    Thanks @ScottSpittle for suggesting the answer to that problem!

    @Monkz: If you don't want a particular group to be able to use PvPToggle (i.e. they can't use this plugin at all, and disabling PvP will not stop them from being attacked) just remove the pvptoggle.use permissions node.
     
  24. Offline

    zawmbee42

    I took off godmode, when i type /pvp off myname it turns pvp off in the entire world.
     
  25. Offline

    Monkz

    I have checked to make sure godmode is off. and it says that my pvp is on when i check the status, and when people hit me it says my pvp is disabled.

    And i do remove that permissions node, however because im OP it still forces me to have it, and it bugs on me only. The regular players have no issues with it
     
  26. Offline

    ScottSpittle

    sounds like an issue with another plugin.. not sure which one..
     
  27. Offline

    amunro

    Code:
    02:53:28 [SEVERE] Could not pass event ENTITY_DAMAGE to PvPToggle
    java.lang.NullPointerException
            at com.sleelin.pvptoggle.PvPToggle.pvpEnabled(PvPToggle.java:196)
            at com.sleelin.pvptoggle.PvPToggleEntityListener.onEntityDamage(PvPToggleEntityListener.java:36)
            at org.bukkit.plugin.java.JavaPluginLoader$51.execute(JavaPluginLoader.java:598)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:310)
            at net.minecraft.server.EntityHuman.damageEntity(EntityHuman.java:419)
            at net.minecraft.server.EntityPlayer.damageEntity(EntityPlayer.java:184)
            at net.minecraft.server.EntityHuman.d(EntityHuman.java:542)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:861)
            at net.minecraft.server.Packet7UseEntity.a(SourceFile:33)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:399)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:309)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    
    I get this error spammed when used with citizens.
     
  28. Offline

    MrKrucible

    u have to tun on pvp in your server.properties on for this to work right?
     
  29. Offline

    DarkKiller13

    how do u use /tpvp in a simple discription haha i was lost :p
     
  30. Offline

    Sleelin

    @amunro: update to version 0.3.1 and it fixes the problem.

    @MrKrucible: yes you do, as it says in the setup instructions.

    @DarkKiller13: /tpvp is exactly the same as /pvp, i only added it so that when people use another plugin that uses /pvp as well, they can still use this plugin.

    @Monkz: I still can't emulate this, what version are you using? As for the OPs thing, I'll look at the source code, might have to make a change to only check for OPs when Permissions is disabled.

    @ScottSpittle: thanks for helping me out answering peoples questions!
     
  31. Offline

    amunro

    First of all, thanks, this is an excellent plugin, keep up the good work!

    Secondly, you might want to rephrase this:

    "For each world, set logindefault to either true or false depending on whether you want it enabled or disabled for each player on login, and pvpenabled to either true or false to depending on whether you want world-wide PvP enabled or disabled on startup"

    This to me is completely confusing. What I assume is that if logindefault is false, players who log in will have pvp off for them! (Does this reset every time they relog? If so, does this take into account the cooldown function?)

    What I assume is that if pvpenabled is set to false, the plugin will be disabled for that world, and players cannot do '/pvp on' to change their pvp status.

    So for my world, we want pvp to be disabled on login (unless they relog within the cooldown limit) but enabled for toggling, so a player can log in, and when he feels safe enough, do '/pvp on'.

    Please confirm my assumptions. Thanks again for the great plugin.

    P.S what does 'globalDiabled: false' in the config do?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 15, 2016

Share This Page