Solved Unknown command?!

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

adycris

Member
Jul 6, 2023
2
0
1
A problem that I met with these days is that I don't know in skript how to check if a command actually exists or not, without involving permissions and stuff because the only thing that you can do using skript to replace the unknown command that I know right now is by using "if (permission of command command) is not set:". When is not set, it'll also execute the events you want to the commands that does not exist + the commands that doesn't have a permission imposed by the plugin that created the command and I want only to execute the event to the commands that doesn't exists. Any ideas? Here is my skript:

on command:
if executor is not console:
if (permission of command command) is not set:
if executor doesn't have permission (permission of command command):
if {cooldown::%player%} ? now <= now:
set {cooldown::%player%} to 2 seconds later
cancel event
send title "<##CA3818>&lTitle" with subtitle "Subtitle" to executor for 3 seconds with fade in 8 ticks and fade out 5 ticks

- this skript tells the title to the unknown commands + the commands that doesn't have a permission imposed by the plugin that created the command. I want only for unknown commands.. If someone has an idea, it'll be amazin', I think that it's only possible with skript-reflect but if you guys know to do this thing in default skript, it'll be better, it doesn't really matter.. Thankss!
 
Solved, thanks to @publicjake.github.io on SkUnity's discord:
import:
org.bukkit.event.command.UnknownCommandEvent

on UnknownCommandEvent:
set {_s} to event.getSender()
{_s} is a player
event.message({_})
send title "aa" to {_s}