fix function loading in commands
This commit is contained in:
parent
f4a8f9502d
commit
559117352e
@ -1,10 +1,22 @@
|
||||
@lazy
|
||||
function triggerCommand(objective, function) {
|
||||
scoreboard players enable @a $objective;
|
||||
execute as @a[scores={$objective=1..}] run function $function;
|
||||
execute as @a[scores={$objective=1..}] run $function;
|
||||
scoreboard players set @a $objective 0;
|
||||
}
|
||||
|
||||
function command.transport_creative() {
|
||||
transfer 10.0.0.13 25566;
|
||||
}
|
||||
|
||||
function command.transport_SMP() {
|
||||
transfer 10.0.0.13 25565;
|
||||
}
|
||||
|
||||
function command.open_menu() {
|
||||
guis open menu;
|
||||
}
|
||||
|
||||
class command {
|
||||
@add(__load__)
|
||||
function commandsLoad() {
|
||||
@ -15,20 +27,8 @@ class command {
|
||||
|
||||
@add(__tick__)
|
||||
function commandsTick() {
|
||||
triggerCommand(transportCreative, this.transport_creative());
|
||||
triggerCommand(transportSMP, this.transport_SMP());
|
||||
triggerCommand(menu, this.menu());
|
||||
}
|
||||
|
||||
function transport_creative() {
|
||||
transfer 10.0.0.13 25566;
|
||||
}
|
||||
|
||||
function transport_SMP() {
|
||||
transfer 10.0.0.13 25565;
|
||||
}
|
||||
|
||||
function open_menu() {
|
||||
guis open menu;
|
||||
triggerCommand(transportCreative, command.transport_creative());
|
||||
triggerCommand(transportSMP, command.transport_SMP());
|
||||
triggerCommand(menu, command.open_menu());
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user