Actions
Actions format
In order for actions to be recognized by NoCheatPlusFork, they need to respect a specific format. If an action is not formatted correctly, NoCheatPlusFork will fallback to the default actions for that check.
The format used for
logactions is:log:string:delay:cooldown:target.For
cmdc/cmdactions, thetargetpart has to be omitted, whiledelayandrepeatcan be removed or specified, at your discretion: (cmd(c):yourcommandhere[:delay:cooldown]).The
delaypart tells NoCheatPlus how many failed checks it has to wait before actually logging the action. This is used if you feel like a check is throwing too many false positives and you want to log your string only if a player fails the check multiple times within a minute.The
cooldownis used to indicate how many seconds have to pass before NoCheatPlus can log an action once again. This is needed to prevent the spam of multiple actions in a given interval. Usually a value of 5 seconds is acceptable. It is recommended to at least enforce a one second cooldown.The
targetpart is used to indicate where NoCheatPlus should log alogaction.istands for in-game chat,cstands for console,fstands for file. The order is at your discretion (icf,cfi,ifcetc..) , however, at least one log destination has to be specified.The
cancelaction does not need to respect a fixed order (e.g.:log:yourstringhere:3:0:icf cancelorcancel log:yourstringhere:3:0:icf). Colons are used to separate arguments from one another.
As always, we'll be taking the previously illustrated string as an example:
log:fdirectionlowvl:5:6:i: This will let NoCheatPlus know that it needs to log thefdirectionlowvlstring only in the in-game chat (i), every5failed checks, with a cooldown of6seconds.cmdc:kicksuspiciouscombat:1:5: This will let NoCheatPlus know that it needs to execute thekicksuspiciouscombatcommand after failing the check1time, with a cooldown of5seconds. Sincecmdcis used, color codes will be used.
Placeholders
There are a few placeholders available which can be used to display more in-depth information in strings and to further customize actions.
[player]
Display the name of the player.
All
[IP]
Display a player's IP.
Chat.Text, Chat.Commands, Chat.Login, Chat.Relog
[reachdistance]
Display the reach distance in blocks.
Block*.Reach, Fight.Reach
[tags]
Generic tag used to display a specific check's information (Eg.: with SurvivalFly, this will display the triggered subchecks).
Moving.*, Net.AttackFrequency, Fight.Angle, Fight.Critical, Combined.Improbable, BlockPlace.AutoSign, Inventory.InventoryMove, Inventory.FastConsume, BlockPlace.Scaffold
[packets]
Generic tag used to display a certain packet (Eg.: with MorePackets, this will display the amount of move-packet received, with AttackFrequency, the attack-packets and so on).
Net.AttackFrequency, Moving.MorePackets, Moving.Vehicle.MorePackets
[limit]
Display the limit of a specific check (Eg. with Fight.Speed, this will display the established limit in the config).
Fight.Speed, Net.AttackFrequency
[violations]
Returns the current violation level reached by the player.
All
[food]
Used by FastConsume and InstantEat, it will display the food type that the player attempted to fast-use.
Inventory.InstantEat, Inventory.FastConsume
[check]
Returns the check's name.
All
[locationto]
Returns the coordinates where the player moved to.
Moving.SurvivalFly, Moving.CreativeFly, Moving.Passable, Moving.Vehicle.Envelope
[locationfrom]
Returns the coordinates where the player moved from.
Moving.SurvivalFly, Moving.CreativeFly, Moving.Passable
[distance]
Returns the horizontal distance that the player has covered with one move.
Moving.SurvivalFly, Moving.CreativeFly, Moving.Passable, Moving.Vehicle.Envelope
[health]
Returns a player's health in hearts.
Fight.GodMode, Fight.FastHeal
[blocktype]
Display a block's name for which the player tried to interact or phase through.
Moving.Passable, BlockBreak.FastBreak, BlockPlace.Against
[model]
Display CreativeFly's current movement model.
Moving.CreativeFly
Notes
Remember that NoCheatPlus will still load up the check on start-up even if its set to false.
Do note that some checks and/or modules might depend on other features to be enabled in order to work (eg.: disabling NoFall will partially cripple the Critical check)
For some checks immediate kicking of players is not recommended, because it can conflict with the set-back logic or further event-processing, such as with the flying checks - for those we recommend to use the command prefix "ncp delay", in order to run the actions outside of the event processing.
Always make sure to cancel first before you kick player to avoid exploits with checks not canceling properly.
Related
Last updated