Implemented the ability to toggle pvp (#97)

* Implemented the ability to toggle pvp

* Changed listener to  PrePlayerAttackEntityEvent

* ... Updated the formatting so I don't get screamed at !

* _
This commit is contained in:
james
2024-06-04 16:30:34 +01:00
committed by GitHub
parent 9e974ae737
commit e066d9b3a1
5 changed files with 90 additions and 6 deletions
@@ -32,6 +32,7 @@ public class ToggleCMD extends PlexCommand
sender.sendMessage(PlexUtils.mmDeserialize("<gray> - Fluidspread" + status("fluidspread")));
sender.sendMessage(PlexUtils.mmDeserialize("<gray> - Drops" + status("drops")));
sender.sendMessage(PlexUtils.mmDeserialize("<gray> - Redstone" + status("redstone")));
sender.sendMessage(PlexUtils.mmDeserialize("<gray> - PVP" + status("pvp")));
sender.sendMessage(PlexUtils.mmDeserialize("<gray> - Chat" + status("chat")));
return null;
}
@@ -53,6 +54,10 @@ public class ToggleCMD extends PlexCommand
{
return toggle("redstone");
}
case "pvp" ->
{
return toggle("pvp");
}
case "chat" ->
{
PlexUtils.broadcast(PlexUtils.messageComponent("chatToggled", sender.getName(), plugin.toggles.getBoolean("chat") ? "off" : "on"));