Files
commandhider.sk
Code
1 42
commandhider.sk
# CommandHiderSkript
# Place this file in plugins/Skript/scripts/
# Configure visible commands below, then use: /sk reload commandhider
options:
# Use command names without the leading slash.
# Separate multiple commands with commas.
visible-commands: help, spawn, rules, msg, r, tell, t
bypass-permission: commandhider.bypass
on script load:
delete {commandhider.visible::*}
set {_configured::*} to split "{@visible-commands}" at ","
loop {_configured::*}:
set {_command} to loop-value
replace all " " in {_command} with ""
replace all "/" in {_command} with ""
set {_command} to lowercase {_command}
if {_command} is not "":
add {_command} to {commandhider.visible::*}
send "&aCommandHider loaded successfully." to console
on tab complete:
if player has permission "{@bypass-permission}":
stop
set {_input} to event-string
replace all "/" in {_input} with ""
set {_parts::*} to split {_input} at " "
set {_root-command} to {_parts::1}
# At the root command level, only show configured commands.
if {_parts::2} is not set:
set tab completions to {commandhider.visible::*}
stop
# Hide argument suggestions for commands that are not configured.
if {_root-command} is not in {commandhider.visible::*}:
clear tab completions