I was trying to block certain commands. I was having issues with on command event, however PlayerCommandPreProcessis amazing and fires really fast. I was wondering if there is a way to detect if there is an argument after the command is fired. This code below works however, it doesn't work when there is an argument into the command, for example /pl s would fire the command.
code_language.skript:
on script load:
add "/sk" to {blockedcmd::*}
add "/skript" to {blockedcmd::*}
add "/bukkit:help" to {blockedcmd::*}
add "/bukkit:ver" to {blockedcmd::*}
add "/ver" to {blockedcmd::*}
add "/version" to {blockedcmd::*}
add "/about" to {blockedcmd::*}
add "/bukkit:about" to {blockedcmd::*}
add "//calc" to {blockedcmd::*}
add "//eval" to {blockedcmd::*}
add "//calculate" to {blockedcmd::*}
add "//evaluate" to {blockedcmd::*}
add "/pl" to {blockedcmd::*}
add "/plugins" to {blockedcmd::*}
add "/bukkit:pl" to {blockedcmd::*}
add "/?" to {blockedcmd::*}
add "/bukkit:?" to {blockedcmd::*}
on "org.bukkit.event.player.PlayerCommandPreprocessEvent":
loop {blockedcmd::*}:
if loop-value.contains(event.getMessage().toLowerCase().toString()) = true:
if getGroup(event.getPlayer()) isn't "Owner" or "Developer":
send "&c&l(!) &eCommand was not found!" to event.getPlayer()
event.setCancelled(true)