-
Notifications
You must be signed in to change notification settings - Fork 65
Warns (v2)
Negativity has its own warn subsystem.
This feature is entirely v2-reserved
The warn subsystem configuration is located in the main config file (warns.yml
), and is quite simple:
-
active
: the main 'switch' of the subsystem, iftrue
warn-related commands of the plugins can be used. Defaults tofalse
-
processor
: the ID of the processor to use. Processors are used to execute and fetch warns. Defaults tofile
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.
Like each processor have own working system, some of them don't have some features.
ID: file
Platform: All.
Stores warns on the local filesystem (under warns
folder). Useful if you only have one server.
ID: database
Platform: All.
Stores warns in a database. Requires a valid database configuration.
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 thanban
, 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
ID: maxbans
Platform: Spigot.
Uses MaxBans.
ID: advancedban
Platform: All.
Uses AdvancedBan.
ID: litebans
Platform: All.
Uses LiteBans.
ID: ultrapunishments
Platform: Spigot.
Uses ProfessionalBans.
You can use command processor if you don't have lot of time.
To make your own, follow those steps :
- Create your own warn processor.
It should implement com.elikill58.negativity.universal.warn.processor.WarnProcessor
's java interface.
- Register this processor into Negativity :
WarnProcessor myProcess = ...;
WarnManager.registerProcessor("myprocessor", myProcess);
- In config, change
processor: "file"
pourprocessor: "myprocessor"
.
("myprocessor" is what you wrote as plugin ID in registerProcessor
)
Welcome to Negativity's wiki !