Code Monkey home page Code Monkey logo

pvptoggle's Introduction

PvPToggle

Plugin to toggle the ability to pvp

Commands

/pvp {toggle|on|off|status} - used to change pvp state

/pvp - used to see the pvp state of another player

/pvp {toggle|on|off} - used to set the pvp state of another player

Permission Nodes

pvptoggle.allow - grants access to /pvp {toggle|on|off|status} command

pvptoggle.others - grants access to /pvp (player) command

pvptoggle.others.set - grants access to /pvp (player) {toggle|on|off} command

pvptoggle.bypass - allows player to bypass the /pvp off cooldown

pvptoggle.reload - allows player to reload the config

pvptoggle's People

Contributors

aasmus avatar chromabit avatar jascotty2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pvptoggle's Issues

Plugin does not work for me

Hello, I wanted to use your plugin on my server, however I could see that it did not work. When a player has PVP disabled they can still hit and be hit. I am attaching my configuration file to you.

Good day to you.

Server 1.15.2 Paper
Plugin version: 1.7

`
SETTINGS:
##Do you want the plugin to remember a player's last PVP state when the login
PERSISTENT_PVP_STATE: true
##How much time a player must wait to use /pvp off/toggle (if pvp is on) in seconds after running the command or being in pvp
COOLDOWN: 600
##True makes pvp off by default. False makes pvp on by default.
DEFAULT_PVP_OFF: true
##Show PVP on particle effects
PARTICLES: false
##SHOW PVP on red nametag
NAMETAG: false

Worlds to disable PvP toggling in (i e will always use the world s settings)

BLOCKED_WORLDS: []
## goes in place of a player's current pvp state
## goes in place of a player's name or other parameter
MESSAGES:
HELP_HEADER: '&a&lCommandes:'
HELP_GENERAL_USEAGE: '&aUse /pvp {toggle|on|off|status} to change/view pvp state.'
HELP_VIEW_OTHERS: '&aUse /pvp to see another players pvp state.'
HELP_SET_OTHERS: '&aUse /pvp {toggle|on|off} to set another players pvp state.'
NO_PLAYER: '&cCould not find a player by the name '
COMMAND_INVALID_PARAMETER: '&c is an invalid parameter. {toggle|on|off|status}'
COMMAND_NO_PERMISSION: '&cYou do not have permission to set others pvp state.'
PVP_STATE_ENABLED: '&8&lYtta&c&llium >> &cVous pouvez maintenant attaquer et être attaqué'
PVP_STATE_DISABLED: '&8&lYtta&a&llium >> &aVous ne pouvez plus attaquer ou être attaqué'
PVP_STATE_CHANGED_OTHERS: '&a had their pvp state changed to '
PVP_STATUS: '&aYour pvp is set to '
PVP_STATUS_OTHERS: '&a has their pvp '
PVP_DISABLED: '&cYou have pvp disabled!'
PVP_DISABLED_OTHERS: '&c has pvp disabled!'
PVP_COOLDOWN: '&cToo fast! You can turn off pvp in seconds.'
PVP_WORLD_CHANGE_DISABLED: '&aYour pvp has been disabled because the world you entered does not allow pvp.'
PVP_WORLD_CHANGE_REQUIRED: '&aYour pvp has been enabled because the world you enter requires pvp.'
PVP_WORLD_CANNOT_CHANGE_SELF: '&cYou cannot change pvp state in this world.'
PVP_WORLD_CANNOT_CHANGE_OTHERS: '&cYou cannot change pvp state in that world.'
`

Unable to set default permissions

Hello,

I have been trying to setup pvptoggle on my server, but the players on my server are unable to use it.
Luckperms is the permissions plugin I use and I have tried setting:
-pvptoggle.allow
-pvptoggle.others
-pvptoggle.others.set

But none of these have made it work, it still says "no permission".
Any reason behind this?
I have not mistyped anything, nor is it the wrong group.
Not sure what the issue is, but some help would be good.
Thanks in advance.

add combatlogx

add combatlogx hook please. i have combotlogx and this pvp protection.

Error msg from mcmmo to pvptoggle

[21:10:27] [Server thread/ERROR]: Could not pass event McMMOEntityDamageByRuptureEvent to PvPToggle v1.7

this is spammed in the console log a bit

[Error] Could not pass event EntityDamageByEntityEvent

[17:25:51 ERROR]: Could not pass event EntityDamageByEntityEvent to PvPToggle v1.5.3
org.bukkit.event.EventException: null
        at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:72) ~[patched_1.13.2.jar:git-Paper-405]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:78) ~[patched_1.13.2.jar:git-Paper-405]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[patched_1.13.2.jar:git-Paper-405]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:513) ~[patched_1.13.2.jar:git-Paper-405]
        at org.bukkit.craftbukkit.v1_13_R2.event.CraftEventFactory.callEvent(CraftEventFactory.java:100) ~[patched_1.13.2.jar:git-Paper-405]
        at org.bukkit.craftbukkit.v1_13_R2.event.CraftEventFactory.callEntityDamageEvent(CraftEventFactory.java:672) ~[patched_1.13.2.jar:git-Paper-405]
        at org.bukkit.craftbukkit.v1_13_R2.event.CraftEventFactory.handleEntityDamageEvent(CraftEventFactory.java:571) ~[patched_1.13.2.jar:git-Paper-405]
        at org.bukkit.craftbukkit.v1_13_R2.event.CraftEventFactory.handleLivingEntityDamageEvent(CraftEventFactory.java:704) ~[patched_1.13.2.jar:git-Paper-405]
        at net.minecraft.server.v1_13_R2.EntityLiving.damageEntity0(EntityLiving.java:1520) ~[patched_1.13.2.jar:git-Paper-405]
        at net.minecraft.server.v1_13_R2.EntityHuman.damageEntity0(EntityHuman.java:911) ~[patched_1.13.2.jar:git-Paper-405]
        at net.minecraft.server.v1_13_R2.EntityLiving.damageEntity(EntityLiving.java:993) ~[patched_1.13.2.jar:git-Paper-405]
        at net.minecraft.server.v1_13_R2.EntityHuman.damageEntity(EntityHuman.java:824) ~[patched_1.13.2.jar:git-Paper-405]
        at net.minecraft.server.v1_13_R2.EntityPlayer.damageEntity(EntityPlayer.java:654) ~[patched_1.13.2.jar:git-Paper-405]
        at net.minecraft.server.v1_13_R2.EntityHuman.attack(EntityHuman.java:1086) ~[patched_1.13.2.jar:git-Paper-405]
        at net.minecraft.server.v1_13_R2.EntityPlayer.attack(EntityPlayer.java:1419) ~[patched_1.13.2.jar:git-Paper-405]
        at net.minecraft.server.v1_13_R2.PlayerConnection.a(PlayerConnection.java:1993) ~[patched_1.13.2.jar:git-Paper-405]
        at net.minecraft.server.v1_13_R2.PacketPlayInUseEntity.a(PacketPlayInUseEntity.java:49) ~[patched_1.13.2.jar:git-Paper-405]
        at net.minecraft.server.v1_13_R2.PacketPlayInUseEntity.a(PacketPlayInUseEntity.java:6) ~[patched_1.13.2.jar:git-Paper-405]
        at net.minecraft.server.v1_13_R2.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:12) ~[patched_1.13.2.jar:git-Paper-405]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_191]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_191]
        at net.minecraft.server.v1_13_R2.SystemUtils.a(SystemUtils.java:109) ~[patched_1.13.2.jar:git-Paper-405]
        at net.minecraft.server.v1_13_R2.MinecraftServer.b(MinecraftServer.java:1016) ~[patched_1.13.2.jar:git-Paper-405]
        at net.minecraft.server.v1_13_R2.DedicatedServer.b(DedicatedServer.java:439) ~[patched_1.13.2.jar:git-Paper-405]
        at net.minecraft.server.v1_13_R2.MinecraftServer.a(MinecraftServer.java:943) ~[patched_1.13.2.jar:git-Paper-405]
        at net.minecraft.server.v1_13_R2.MinecraftServer.run(MinecraftServer.java:841) ~[patched_1.13.2.jar:git-Paper-405]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_191]
Caused by: java.lang.NullPointerException
        at com.github.aasmus.pvptoggle.listeners.PvP.onHit(PvP.java:35) ~[?:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor1010.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:70) ~[patched_1.13.2.jar:git-Paper-405]
        ... 26 more

PvPToggle version: 1.5.3
Server Type: Paper
Server Version: git-Paper-405 (MC: 1.13.2)

NPE

[00:28:05 ERROR]: Could not pass event EntityDamageByEntityEvent to PvPToggle v1.7
java.lang.NullPointerException: Cannot invoke "java.lang.Boolean.booleanValue()" because "damagerState" is null
at com.github.aasmus.pvptoggle.listeners.PvP.onHit(PvP.java:44) ~[PvPToggle.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor1192.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:75) ~[pearl-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[pearl-api-1.18.2-R0.1-SNAPSHOT.jar:git-Pearl-"8f12a7a"]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[pearl-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:734) ~[pearl-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R2.event.CraftEventFactory.callEvent(CraftEventFactory.java:248) ~[pearl-1.18.2.jar:git-Pearl-"8f12a7a"]
at org.bukkit.craftbukkit.v1_18_R2.event.CraftEventFactory.callEntityDamageEvent(CraftEventFactory.java:1151) ~[pearl-1.18.2.jar:git-Pearl-"8f12a7a"]
at org.bukkit.craftbukkit.v1_18_R2.event.CraftEventFactory.handleEntityDamageEvent(CraftEventFactory.java:1010) ~[pearl-1.18.2.jar:git-Pearl-"8f12a7a"]
at org.bukkit.craftbukkit.v1_18_R2.event.CraftEventFactory.handleEntityDamageEvent(CraftEventFactory.java:964) ~[pearl-1.18.2.jar:git-Pearl-"8f12a7a"]
at org.bukkit.craftbukkit.v1_18_R2.event.CraftEventFactory.handleLivingEntityDamageEvent(CraftEventFactory.java:1185) ~[pearl-1.18.2.jar:git-Pearl-"8f12a7a"]
at net.minecraft.world.entity.LivingEntity.damageEntity0(LivingEntity.java:2086) ~[?:?]
at net.minecraft.world.entity.player.Player.damageEntity0(Player.java:1032) ~[?:?]
at net.minecraft.world.entity.LivingEntity.hurt(LivingEntity.java:1353) ~[?:?]
at net.minecraft.world.entity.player.Player.hurt(Player.java:939) ~[?:?]
at net.minecraft.server.level.ServerPlayer.hurt(ServerPlayer.java:1032) ~[?:?]
at net.minecraft.world.entity.player.Player.attack(Player.java:1279) ~[?:?]
at net.minecraft.server.level.ServerPlayer.attack(ServerPlayer.java:2041) ~[?:?]
at net.citizensnpcs.nms.v1_18_R2.util.NMSImpl.attack(NMSImpl.java:349) ~[Citizens-2.0.29-b2550.jar:?]
at net.citizensnpcs.util.NMS.attack(NMS.java:57) ~[Citizens-2.0.29-b2550.jar:?]
at net.citizensnpcs.npc.ai.MCTargetStrategy$1.handle(MCTargetStrategy.java:291) ~[Citizens-2.0.29-b2550.jar:?]
at net.citizensnpcs.npc.ai.MCTargetStrategy.update(MCTargetStrategy.java:138) ~[Citizens-2.0.29-b2550.jar:?]
at net.citizensnpcs.npc.ai.CitizensNavigator.run(CitizensNavigator.java:172) ~[Citizens-2.0.29-b2550.jar:?]
at net.citizensnpcs.npc.CitizensNPC.update(CitizensNPC.java:414) ~[Citizens-2.0.29-b2550.jar:?]
at net.citizensnpcs.nms.v1_18_R2.entity.EntityHumanNPC.k(EntityHumanNPC.java:461) ~[Citizens-2.0.29-b2550.jar:?]
at net.minecraft.server.level.ServerLevel.tickNonPassenger(ServerLevel.java:1150) ~[?:?]
at net.minecraft.server.level.ServerLevel.lambda$tick$5(ServerLevel.java:676) ~[?:?]
at net.minecraft.world.level.entity.EntityTickList.forEach(EntityTickList.java:43) ~[pearl-1.18.2.jar:git-Pearl-"8f12a7a"]
at net.minecraft.server.level.ServerLevel.tick(ServerLevel.java:654) ~[?:?]
at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1604) ~[pearl-1.18.2.jar:git-Pearl-"8f12a7a"]
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:489) ~[pearl-1.18.2.jar:git-Pearl-"8f12a7a"]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1468) ~[pearl-1.18.2.jar:git-Pearl-"8f12a7a"]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1232) ~[pearl-1.18.2.jar:git-Pearl-"8f12a7a"]
at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:317) ~[pearl-1.18.2.jar:git-Pearl-"8f12a7a"]
at java.lang.Thread.run(Thread.java:833) ~[?:?]

Fishing rods

I noticed when pvp turned off, fishing rods will still damage people.

Command error

[16:20:14 ERROR]: null                                                                                                                                             
org.bukkit.command.CommandException: Unhandled exception executing command 'pvp' in plugin PvPToggle v1.6.6                                                        
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[patched_1.14.4.jar:git-Paper-221]                                                     
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.14.4.jar:git-Paper-221]                                             
        at org.bukkit.craftbukkit.v1_14_R1.CraftServer.dispatchCommand(CraftServer.java:739) ~[patched_1.14.4.jar:git-Paper-221]                                   
        at net.minecraft.server.v1_14_R1.PlayerConnection.handleCommand(PlayerConnection.java:1800) ~[patched_1.14.4.jar:git-Paper-221]                            
        at net.minecraft.server.v1_14_R1.PlayerConnection.a(PlayerConnection.java:1608) ~[patched_1.14.4.jar:git-Paper-221]                                        
        at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(PacketPlayInChat.java:47) ~[patched_1.14.4.jar:git-Paper-221]                                          
        at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(PacketPlayInChat.java:5) ~[patched_1.14.4.jar:git-Paper-221]                                           
        at net.minecraft.server.v1_14_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:23) ~[patched_1.14.4.jar:git-Paper-221]                at net.minecraft.server.v1_14_R1.TickTask.run(SourceFile:18) ~[patched_1.14.4.jar:git-Paper-221]                                                           
        at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.14.4.jar:git-Paper-221]                             
        at net.minecraft.server.v1_14_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.14.4.jar:git-Paper-221]                                 
        at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.14.4.jar:git-Paper-221]                             
        at net.minecraft.server.v1_14_R1.MinecraftServer.aX(MinecraftServer.java:1029) ~[patched_1.14.4.jar:git-Paper-221]                                         
        at net.minecraft.server.v1_14_R1.MinecraftServer.executeNext(MinecraftServer.java:1022) ~[patched_1.14.4.jar:git-Paper-221]                                
        at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeAll(IAsyncTaskHandler.java:95) ~[patched_1.14.4.jar:git-Paper-221]                               
        at net.minecraft.server.v1_14_R1.MinecraftServer.a(MinecraftServer.java:1158) ~[patched_1.14.4.jar:git-Paper-221]                                          
        at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:925) ~[patched_1.14.4.jar:git-Paper-221]                                         
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]                                                                                                     
Caused by: java.lang.IllegalArgumentException: character to be escaped is missing                                                                                  
        at java.util.regex.Matcher.appendReplacement(Matcher.java:809) ~[?:1.8.0_222]                                                                              
        at java.util.regex.Matcher.replaceAll(Matcher.java:955) ~[?:1.8.0_222]                                                                                     
        at java.lang.String.replaceAll(String.java:2223) ~[?:1.8.0_222]                                                                                            
        at com.github.aasmus.pvptoggle.utils.Chat.send(Chat.java:28) ~[?:?]                                                                                        
        at com.github.aasmus.pvptoggle.PvPCommand.onCommand(PvPCommand.java:115) ~[?:?]                                                                            
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.14.4.jar:git-Paper-221]                                                     
        ... 17 more                                  

Have a look at the above error. Seems to be an issue with argument parsing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.