Skip to content

Warns (v2)

Elikill58 edited this page Oct 13, 2022 · 3 revisions

The Warns Subsystem

Negativity has its own warn subsystem.

This feature is entirely v2-reserved

Configuration

The warn subsystem configuration is located in the main config file (warns.yml), and is quite simple:

  • active: the main 'switch' of the subsystem, if true warn-related commands of the plugins can be used. Defaults to false
  • processor: the ID of the processor to use. Processors are used to execute and fetch warns. Defaults to file

Warn Inventory

In /negativity <player> menu, there is a compass which enable mod to warn (need permission to do /nwarn).

This inventory is a shortcut to nwarn command, which default configuration.

For example, if you want to warn player for Provocation, you just have to configure an item in this inventory and not have to write the full command.

To configure it, there is a "sanctions" section. You can check example here.

Processors

Like each processor have own working system, some of them don't have some features.

File

ID: file Platform: All.

Stores warns on the local filesystem (under warns folder). Useful if you only have one server.

Database

ID: database Platform: All.

Stores warns in a database. Requires a valid database configuration.

Command

ID: command Platform: All.

Executes bans via custom commands. Since this one only uses commands it does not support logged bans.

Its configuration is in the main config file, under ban.command:

  • ban is the list of command to execute when executing bans
  • unban is the same than ban, but for revoking bans

Both lists must contain strings, the order of the commands is respected.

Each command can contain the following placeholders:

  • %uuid%: the UUID of the player
  • %name%: the name of the player
  • %ip%: the IP address of the player
  • %reason%: the reason of the ban
  • %alert%: the number of alerts for the detected cheat that triggered the ban
  • %all_alert%: all alerts for the detected cheat since you added Negativity on your server
  • %life%: the health of the player at the moment the command is executed
  • %level%: the level of the player
  • %gm%: the gamemode of the player
  • %walk_speed%: the speed at which the player should walk

MaxBans

ID: maxbans Platform: Spigot.

Uses MaxBans.

AdvancedBan

ID: advancedban Platform: All.

Uses AdvancedBan.

LiteBans

ID: litebans Platform: All.

Uses LiteBans.

UltraPunishments

ID: ultrapunishments Platform: Spigot.

Uses ProfessionalBans.

I want my own processor !

You can use command processor if you don't have lot of time.

To make your own, follow those steps :

  1. Create your own warn processor.

It should implement com.elikill58.negativity.universal.warn.processor.WarnProcessor's java interface.

  1. Register this processor into Negativity :
WarnProcessor myProcess = ...;
WarnManager.registerProcessor("myprocessor", myProcess);
  1. In config, change processor: "file" pour processor: "myprocessor".

("myprocessor" is what you wrote as plugin ID in registerProcessor)

Clone this wiki locally