Add an option for restricting CommandSender
rkdrns4747 opened this issue ยท 1 comments
User may want to make command executable on Console, so adding runnable_on_console: true/false
option would be perfect for them.
HOWEVER, in this case, the user now have inner variable named sender
instead of player
.
New CommandTrigger option
runnable_in_console: true/false
This option saved in trigger.json
, as runnable_in_console: true/false
. If true, the command trigger would be available for ConsoleCommandSender. If false, only Players can trigger it. Default is false
.
New command logic
/trg cmd myCommand console
This command acts like /trg cmd myCommand sync
but only different thing is that it changes runnable_in_console
value.
New inner variable
isByPlayer
This indicates whether the trigger is triggered by Player or not. This is especially useful for
sender
This inner variable would be defined only when the trigger is triggered by console. If being defined, player
variable would not be set and remain null. In contrary, If player
variable is defined, sender
variable would not be set and remain null.