-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbeta.sk
More file actions
1557 lines (1356 loc) · 58.9 KB
/
beta.sk
File metadata and controls
1557 lines (1356 loc) · 58.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
options:
version: 0.0
sub version: 1
channel: "BETA"
# Version is "0.0.1 BETA"
on join:
wait 5 ticks
if {server::name} isn't set:
set {server::name} to "My cool server!"
if {server::%uuid of player%::tokens} isn't set:
set {server::%uuid of player%::tokens} to 0
if {server::alive::*} contains player:
remove player from {server::alive::*}
if {server::dead::*} doesn't contain player:
add player to {server::dead::*}
if {server::spawn} is set:
teleport player to {server::spawn}
else:
loop all players:
if loop-player has permission "ec.setspawn":
send "&cA player has joined but the spawn was not set and they were teleported to the worldspawn!"
send "&cPlease set one using &e`/setspawn`"
clear the player's inventory
clear helmet of player
clear chestplate of player
clear leggings of player
clear boots of player
if {ec::config::default-gamemode} is set:
set player's gamemode to {ec::config::default-gamemode}
every second:
if {ec::config::use-colored-names} is true:
if plugin "LuckPerms" is enabled:
if plugin "Vault" is enabled:
loop all players:
if {server::alive::*} contains loop-value:
set display name of player to "&2%player's display name%&r"
else:
if {server::hosts::*} doesn't contain loop-value:
set display name of player to "&c%player's display name%&r"
else:
set display name of player to "&6%player's display name%&r"
# Main Host Panel
command /ec:
executable by: players
permission: ec.host.panel
description: Open the EventCore host panel
trigger:
set {_panel} to a new chest inventory with 6 rows named "EventCore - Home"
set slot 0 of {_panel} to a barrier named "&cClose" with lore "Close the panel"
set slot 10 of {_panel} to a skeleton skull named "Dead Settings" with lore "Manage dead player defaults"
set slot 12 of {_panel} to the player's skull named "Player Settings" with lore "Default Player Settings"
set slot 14 of {_panel} to an ender pearl named "Warps" with lore "Warp Settings"
set slot 16 of {_panel} to an enchanted book named "Ads" with lore "Advertisements"
open {_panel} to player
function toggleVar(var: object) :: boolean:
if {_var} is true:
set {_var} to false
else:
set {_var} to true
return {_var}
function openConfig(page: text = "home", player: player):
if {_page} is "home":
make {_player} execute command "ec"
else if {_page} is "dead":
set {_config} to a new chest inventory with 5 rows named "EC - Dead Players"
set slot 0 of {_config} to a barrier named "&cBack"
if {ec::config::allow-spectate} is true:
set slot 10 of {_config} to lime wool named "&cDisable Spectating" with lore "&2Spectating is &a&lENABLED"
else:
set slot 10 of {_config} to red wool named "&cEnable Spectating" with lore "&cSpectating is &4&lDISABLED"
if {ec::config::auto-spectate} is true:
set slot 12 of {_config} to lime wool named "&cDisable Auto Spectating" with lore "&2Auto Spectating is &a&lENABLED"
else:
set slot 12 of {_config} to red wool named "&cEnable Auto Spectating" with lore "&cAuto Spectating is &4&lDISABLED"
if {ec::config::default-gamemode} is survival:
set slot 14 of {_config} to grass block named "&2Current:&e Survival" with lore "&2Default Gamemode is &eSurvival!"
else if {ec::config::default-gamemode} is adventure:
set slot 14 of {_config} to grass block named "&2Current:&e Adventure" with lore "&2Default Gamemode is &eAdventure!"
else if {ec::config::default-gamemode} is spectator:
set slot 14 of {_config} to grass block named "&2Current:&e Spectator" with lore "&2Default Gamemode is &eSpectator!"
else if {ec::config::default-gamemode} is creative:
set slot 14 of {_config} to grass block named "&2Current:&e Creative" with lore "&2Default Gamemode is &eCreative!"
else:
set slot 14 of {_config} to grass block named "&2Current:&e Survival" with lore "&2Default Gamemode is &eSurvival!"
open {_config} to {_player}
else if {_page} is "player-manage":
set {_config} to a new chest inventory with 5 rows named "EC - Player Defaults"
set slot 0 of {_config} to a barrier named "&cBack"
if {ec::config::use-colored-names} is true:
set slot 10 of {_config} to lime wool named "&cDisable Colored Names" with lore "&2Colored names are &a&lENABLED"
else:
set slot 10 of {_config} to red wool named "&cEnable Colored Names" with lore "&cColored names are &4&lDISABLED"
open {_config} to {_player}
else if {_page} is "warps":
set {_config} to a new chest inventory with 5 rows named "EC - Warps"
set slot 0 of {_config} to a barrier named "&cBack"
set slot 10 of {_config} to a lime wool named "&2Create a Warp"
set slot 13 of {_config} to a yellow wool named "&6List Warps"
set slot 16 of {_config} to a red wool named "&cDelete a Warp"
open {_config} to {_player}
else if {_page} is "ads":
set {_config} to a new chest inventory with 5 rows named "EC - Advertisements"
set slot 0 of {_config} to a barrier named "&cBack"
set slot 10 of {_config} to a lime wool named "&2Create an ad"
set slot 12 of {_config} to a yellow wool named "&6List ads"
set slot 14 of {_config} to a red wool named "&cDelete an ad"
set slot 16 of {_config} to a green wool named "&2Set &cYoutube&2 ad"
set slot 18 of {_config} to a green wool named "&2Set &bDiscord&2 ad"
open {_config} to {_player}
on inventory click:
if name of event-inventory is "EventCore - Home":
cancel event
if event-slot is 0:
close the player's inventory
else if event-slot is 10:
openConfig("dead", player)
else if event-slot is 12:
openConfig("player-manage", player)
else if event-slot is 14:
openConfig("warps", player)
else if event-slot is 16:
openConfig("ads", player)
else if name of event-inventory is "EC - Dead Players":
cancel event
if event-slot is 0:
openConfig("home", player)
else if event-slot is 10:
set {_new} to toggleVar({ec::config::allow-spectate})
set {ec::config::allow-spectate} to {_new}
openConfig("dead", player)
else if event-slot is 12:
set {_new} to toggleVar({ec::config::auto-spectate})
set {ec::config::auto-spectate} to {_new}
openConfig("dead", player)
else if event-slot is 14:
if {ec::config::default-gamemode} is survival:
set {ec::config::default-gamemode} to adventure
else if {ec::config::default-gamemode} is adventure:
set {ec::config::default-gamemode} to creative
else if {ec::config::default-gamemode} is creative:
set {ec::config::default-gamemode} to spectator
else if {ec::config::default-gamemode} is spectator:
set {ec::config::default-gamemode} to survival
else:
set {ec::config::default-gamemode} to adventure
openConfig("dead", player)
else if name of event-inventory is "EC - Player Defaults":
cancel event
if event-slot is 0:
openConfig("home", player)
else if event-slot is 10:
set {_new} to toggleVar({ec::config::use-colored-names})
set {ec::config::use-colored-names} to {_new}
openConfig("player-manage", player)
else if name of event-inventory is "EC - Warps":
cancel event
if event-slot is 0:
openConfig("home", player)
else if event-slot is 10:
close the player's inventory
send "&2Type the name of the warp to create:"
set {server::%uuid of player%::awaiting::warp::create} to true
else if name of event-inventory is "EC - Advertisements":
cancel event
if event-slot is 0:
openConfig("home", player)
else if event-slot is 10:
close the player's inventory
make player execute command "createad"
else if event-slot is 12:
close the player's inventory
make player execute command "listads"
else if event-slot is 14:
close the player's inventory
set {server::%uuid of player%::awaiting::ad::delete} to true
send "&2Type the name of the ad to delete:"
else if event-slot is 16:
close the player's inventory
set {server::%uuid of player%::awaiting::ad::youtube} to true
send "&2Type your &cyoutube&2 link:"
else if event-slot is 18:
close the player's inventory
set {server::%uuid of player%::awaiting::ad::discord} to true
send "&2Type your &bdiscord&2 link:"
# Warps / TP
command /setwarp <text>:
executable by: players
description: Create a Warp
permission: ec.host.warp.create
usage: /setwarp <warp_name>
aliases: createwarp, makewarp, addwarp
trigger:
set {_name} to arg-1
set {_loc} to the player's location
if {server::warps::%{_name}%} is set:
send "&cThis warp already exists!" to player
stop
set {server::warps::%{_name}%} to {_name}
set {server::warps::%{_name}%::loc} to {_loc}
send "&2Created warp &e%{server::warps::%{_name}%}%&2 at location: &e%{server::warps::%{_name}%::loc}%"
command /delwarp <text>:
description: Delete a Warp
permission: ec.host.warp.delete
usage: /delwarp <warp_name>
aliases: deletewarp, unsetwarp, removewarp, remwarp
trigger:
set {_name} to arg-1
if {server::warps::%{_name}%} isn't set:
send "&cThis warp doesn't exist!" to player
stop
delete {server::warps::%{_name}%}
send "&2Warp &e%{_name}%&2 Successfully deleted!"
command /listwarps:
description: List all available warps
permission: ec.host.warp.list
usage: warplist, listwarp, allwarps, allwarp
trigger:
loop {server::warps::*}:
send "- &e%loop-index%"
command /tphere <text>:
executable by: players
description: Tp a player/all/dead/alive players to you
permission: ec.host.tp.here
usage: /tphere <player|all|dead|alive>
trigger:
set {_arg} to arg-1
if {_arg} is "all":
loop all players:
if {server::hosts::*} doesn't contain uuid of loop-value:
teleport loop-value to player
send "&2All players teleported to you!" to player
else if {_arg} is "dead":
loop {server::dead::*}:
if {server::hosts::*} doesn't contain uuid of loop-value:
teleport loop-value to player
send "&2All dead players teleported to you!" to player
else if {_arg} is "alive":
loop {server::alive::*}:
if {server::hosts::*} doesn't contain uuid of loop-value:
teleport loop-value to player
send "&2All alive players teleported to you!" to player
else:
set {_arg} to {_arg} parsed as player
if {_arg} isn't set:
send "&cInvalid player/player is not online!" to player
else:
teleport {_arg} to player
send "&e%{_arg}%&2 has been teleported to you!" to player
command /tpall [<text>]:
executable by: players
description: Teleported all players to you or a warp
usage: /tpall [warp_name]
permission: ec.host.tp.all
trigger:
set {_arg} to arg-1
if {_arg} isn't set:
loop all players:
if {server::hosts::*} doesn't contain uuid of loop-value:
teleport loop-value to player
send "&2All players teleported to you!" to player
else:
set {_warp} to {server::warps::%{_arg}%::loc}
if {_warp} isn't set:
send "&cThis warp does not exist!" to player
stop
else:
loop all players:
if {server::hosts::*} doesn't contain uuid of loop-value:
teleport loop-value to {_warp}
send "&2All players teleported to &e!%{_warp}%!" to player
command /tpalive [<text>]:
executable by: players
description: Teleport all alive players to you or a warp
permission: ec.host.tp.alive
trigger:
set {_arg} to arg-1
if {_arg} is not set:
loop {server::alive::*}:
if {server::hosts::*} doesn't contain uuid of loop-value:
teleport loop-value to player
send "&2All alive players teleported to you!"
else:
set {_warp} to {server::warps::%{_arg}%::loc}
if {_warp} is not set:
send "&cThis warp does not exist!"
stop
loop all players:
if {server::hosts::*} doesn't contain uuid of loop-value:
teleport loop-value to {_warp}
send "&2All alive players teleported to &e%{_arg}%!"
command /tpdead [<text>]:
executable by: players
description: Teleport all dead players to you or a warp
permission: ec.host.tp.dead
trigger:
set {_arg} to arg-1
if {_arg} is not set:
loop {server::dead::*}:
if {server::hosts::*} doesn't contain uuid of loop-value:
teleport loop-value to player
send "&2All dead players teleported to you!"
else:
set {_warp} to {server::warps::%{_arg}%::loc}
if {_warp} is not set:
send "&cThis warp does not exist!"
stop
loop all players:
if {server::hosts::*} doesn't contain uuid of loop-value:
teleport loop-value to {_warp}
send "&2All dead players teleported to &e%{_arg}%!"
# Host management
command /addhost <player>:
description: Set a player to be a host (does not give more permissions!)
permission: ec.host.addhost
aliases: createhost, makehost, sethost
trigger:
set {_arg} to arg-1
if {server::hosts::*} contains uuid of {_arg}:
send "&cThis player is already a host!"
stop
add uuid of {_arg} to {server::hosts::*}
send "&2Made &e%{_arg}%&2 a host!"
command /remhost <offline player>:
description: Remove a player from the host list (does not remove permissions!)
permission: ec.host.remhost
aliases: removehost, deletehost, unsethost
trigger:
set {_arg} to arg-1
if {server::hosts::*} doesn't contain uuid of {_arg}:
send "&cThis player is not a host!"
stop
remove uuid of {_arg} from {server::hosts::*}
send "&2Remove &e%{_arg}%&2 from host list!"
# Server management
command /setserver <text>:
description: Set the server name
permission: ec.server.setserver
usage: /setserver <name>
trigger:
set {_name} to arg-1
set {server::name} to {_name}
send "&2Set server name to &e%{server::name}%!"
command /setevent <text>:
description: Set the next event
permission: ec.server.event.setevent
usage: /setevent <name>
trigger:
set {_name} to arg-1
set {server::event} to {_name}
send "&2Set event to &e%{server::event}%!"
command /setspawn:
description: Set the server's spawnpoint
permission: ec.setspawn
trigger:
set {server::spawn} to the player's position
loop all players:
if loop-value has permission "ec.setspawn":
send "&e%player%&2 has set the spawnpoint to &e%{server::spawn}%"
# Timers and Cooldowns
command /timer [<text>]:
description: Start or cancel a countdown timer
permission: ec.host.timer
usage: /timer (cancel|<seconds>)
trigger:
if arg-1 is "cancel":
if {server::timer} > 0:
set {server::timer} to 0
send "&2Timer cancelled!"
else:
send "&cNo timer running!"
stop
set {_time} to arg-1 parsed as integer
if {_time} <= 0:
send "&cTime must be greater than 0!"
stop
if {server::timer} > 0:
send "&cA timer is already running!"
stop
set {server::timer} to {_time}
send "&2Timer started for %{_time}% seconds!"
while {server::timer} > 0:
broadcast "&e%{server::timer}% seconds left!"
wait 1 second
remove 1 from {server::timer}
# This will always run after the timer reaches 0
broadcast "&2Times up!"
command /eventcooldown <number>:
description: Start the event cooldown
permission: ec.host.event.cooldown
usage: /eventcooldown <minutes>
trigger:
set {_arg} to arg-1
if {_arg} <= 0:
send "&cTime must be greater than 0!"
stop
if {server::event::cooldown} > 0:
send "&cA cooldown is already running!"
stop
set {server::event::cooldown} to {_arg} * 60
if {_arg} > 1:
broadcast "&eEvent starts in &c%({server::event::cooldown} / 60)% &eminutes!"
while {server::event::cooldown} > 0:
if {server::event::cooldown} is 0:
stop loop
if {server::event::cooldown} >= 300:
if mod({server::event::cooldown},300) = 0:
broadcast "&e%{server::event}% starts in &c%({server::event::cooldown} / 60)% &eminutes!"
# 1 minute
if {server::event::cooldown} = 60:
broadcast "&e%{server::event}% starts in &c1 minute!"
# 30 seconds
if {server::event::cooldown} = 30:
broadcast "&e%{server::event}% starts in &c30 seconds!"
# 10 seconds
if {server::event::cooldown} <= 10:
broadcast "&e%{server::event}% starts in &c%{server::event::cooldown}% &eseconds!"
wait 1 second
remove 1 from {server::event::cooldown}
broadcast "&a%{server::event}% is starting!!"
# Kits
command /createkit <text>:
executable by: players
description: Create a kit
permission: ec.host.kits.create
usage: /createkit <name>
aliases: setkit, makekit, addkit
trigger:
set {_kit} to lowercase arg-1
if {server::kits::%{_kit}%::exists} is true:
send "&cThis kit already exists!"
stop
set {server::kits::%{_kit}%::exists} to true
set {server::kits::%{_kit}%::armor::helmet} to player's helmet
set {server::kits::%{_kit}%::armor::chestplate} to player's chestplate
set {server::kits::%{_kit}%::armor::leggings} to player's leggings
set {server::kits::%{_kit}%::armor::boots} to player's boots
set {_slot} to 0
loop 36 times:
set {server::kits::%{_kit}%::inv::%{_slot}%} to slot {_slot} of player's inventory
add 1 to {_slot}
send "&aCreated kit: &e%{_kit}%"
command /givekit <text> <text>:
description: Give a kit to a player/group of players
permission: ec.kits.givekit
aliases: grantkit
usage: /givekit <player|all|alive|dead> <kit>
trigger:
set {_arg} to arg-1
set {_kit} to lowercase arg-2
if {server::kits::%{_kit}%::exists} is not true:
send "&cThis kit does not exist!"
stop
if {_arg} is "all":
loop all players:
if {server::hosts::*} doesn't contain uuid of loop-value:
giveKit(loop-value, {_kit})
send "&2Gave kit &e%{_kit}%&2 to all players!"
stop
if {_arg} is "alive":
loop {server::alive::*}:
if {server::hosts::*} doesn't contain uuid of loop-value:
giveKit(loop-value, {_kit})
send "&2Gave kit &e%{_kit}%&2 to all alive players!"
stop
if {_arg} is "dead":
loop {server::dead::*}:
if {server::hosts::*} doesn't contain uuid of loop-value:
giveKit(loop-value, {_kit})
send "&2Gave kit &e%{_kit}%&2 to all dead players!"
stop
set {_p} to {_arg} parsed as player
if {_p} is not set:
send "&cInvalid player/player is not online!"
stop
giveKit({_p}, {_kit})
send "&2Gave kit &e%{_kit}%&2 to &e%{_p}%!"
function giveKit(p: player, kit: text):
clear {_p}'s inventory
set {_p}'s helmet to {server::kits::%{_kit}%::armor::helmet}
set {_p}'s chestplate to {server::kits::%{_kit}%::armor::chestplate}
set {_p}'s leggings to {server::kits::%{_kit}%::armor::leggings}
set {_p}'s boots to {server::kits::%{_kit}%::armor::boots}
set {_slot} to 0
loop 36 times:
set slot {_slot} of {_p}'s inventory to {server::kits::%{_kit}%::inv::%{_slot}%}
add 1 to {_slot}
command /deletekit <text>:
executable by: players
description: Delete a kit
permission: ec.host.kits.delete
usage: /deletekit <name>
aliases: delkit, removekit
trigger:
set {_kit} to lowercase arg-1
if {server::kits::%{_kit}%::exists} is not true:
send "&cThis kit does not exist!"
stop
set {server::kits::%{_kit}%::exists} to false
delete {server::kits::%{_kit}%}
send "&2Deleted kit: &e%{_kit}%"
command /invsee <player>:
executable by: players
description: View/Edit a player's inventory
permission: ec.invsee
trigger:
set {_player} to arg-1
set {_inv} to {_player}'s inventory
open {_inv} to player
command /stats [<player>]:
description: View a player's stats
trigger:
set {_p} to arg-1
if {_p} is not set:
set {_p} to player
send "&eStats for %{_p}%:"
send "&2Tokens: &e%{server::%uuid of {_p}%::tokens}%"
send "&2Wins: &e%{server::%uuid of {_p}%::wins}%"
send "&2Kills: &e%{server::%uuid of {_p}%::kills}%"
send "&2Deaths: &e%{server::%uuid of {_p}%::deaths}%"
on death of player:
set {server::deathTime::%uuid of victim%} to now
force victim to respawn
if attacker is a player:
add 1 to {server::%uuid of attacker%::kills}
add 1 to {server::%uuid of victim%::deaths}
if {server::alive::*} contains victim:
remove victim from {server::alive::*}
if {server::dead::*} doesn't contain victim:
add victim to {server::dead::*}
on respawn:
if {ec::config::auto-spectate} isn't true:
if {server::spawn} is set:
teleport player to {server::spawn}
else:
teleport player to spawn
else:
make player execute command "spectate"
# Gamemode
command /gmc [<player>]:
description: Switch to creative mode
permission: ec.host.gamemode.creative
trigger:
set {_p} to arg-1
if {_p} is set:
set {_p}'s gamemode to creative
stop
set the player's gamemode to creative
command /gms [<player>]:
description: Switch to survival mode
permission: ec.host.gamemode.survival
trigger:
set {_p} to arg-1
if {_p} is set:
set {_p}'s gamemode to survival
stop
set the player's gamemode to survival
command /gmsp [<player>]:
description: Switch to spectator mode
permission: ec.host.gamemode.spectator
trigger:
set {_p} to arg-1
if {_p} is set:
set {_p}'s gamemode to spectator
stop
set the player's gamemode to spectator
command /gma [<player>]:
description: Switch to adventure mode
permission: ec.host.gamemode.adventure
trigger:
set {_p} to arg-1
if {_p} is set:
set {_p}'s gamemode to adventure
stop
set the player's gamemode to adventure
# Wins and Tokens
command /addwin <player>:
description: Give a player a win
permission: ec.host.wins.add
aliases: givewin, grantwin
trigger:
set {_p} to arg-1
add 1 to {server::%uuid of {_p}%::wins}
broadcast "&e%{_p}%&2 has received a win! They now have &e%{server::%uuid of {_p}%::wins}% wins!"
command /addtoken <player>:
description: Give a player a token
permission: ec.host.tokens.add
aliases: givetoken, granttoken, grantoken
trigger:
set {_p} to arg-1
add 1 to {server::%uuid of {_p}%::tokens}
broadcast "&e%{_p}%&2 has received a revive token! They now have &e%{server::%uuid of {_p}%::tokens}% revive tokens!"
command /removewin <player>:
description: Remove a win from a player
permission: ec.host.wins.remove
aliases: givewin, grantwin
trigger:
set {_p} to arg-1
if {server::%uuid of {_p}%::wins} <= 0:
send "&cThey don't have any wins!"
stop
remove 1 from {server::%uuid of {_p}%::wins}
broadcast "&e%{_p}%&c has lost a win! They now have &e%{server::%uuid of {_p}%::wins}% wins!"
command /removetoken <player>:
description: Remove a token from a player
permission: ec.host.tokens.remove
aliases: taketoken, remtoken, retractoken
trigger:
set {_p} to arg-1
if {server::%uuid of {_p}%::tokens} <= 0:
send "&cThey don't have any tokens!"
stop
remove 1 from {server::%uuid of {_p}%::tokens}
broadcast "&e%{_p}%&c has lost a revive token! They now have &e%{server::%uuid of {_p}%::tokens}% revive tokens!"
command /usetoken:
description: Use a revive token
cooldown: 1 minute
cooldown message: You can request a revive in %remaining time%!
trigger:
if {server::%uuid of player%::requestingRevive} is true:
send "&cYou are already requesting a revive!"
stop
if {server::%uuid of player%::tokens} < 1:
send "&cYou don't have any tokens!"
stop
loop all players:
if loop-value has permission "ec.host.tokens.accept":
send "&e%player%&2 is requesting to use a revive token!"
send "&e/accepttoken %player%&2 - Accept their token"
send "&e/denytoken %player%&2 - Deny their token"
set {server::%uuid of player%::requestingRevive} to true
command /accepttoken <player>:
description: Accept a player's revive token
permission: ec.host.tokens.accept
trigger:
set {_p} to arg-1
if {server::%uuid of {_p}%::requestingRevive} isn't true:
send "&cThis player isn't requesting a revive!"
stop
set {server::%uuid of {_p}%::requestingRevive} to false
remove 1 from {server::%uuid of {_p}%::tokens}
broadcast "&e%{_p}%&2 has used a revive token!"
send "&2You accepted %{_p}%'s token!" to player
send "&2Your token has been accepted!" to {_p}
command /denytoken <player>:
description: Deny a player's revive token
permission: ec.host.tokens.deny
trigger:
set {_p} to arg-1
if {server::%uuid of {_p}%::requestingRevive} isn't true:
send "&cThis player isn't requesting a revive!"
stop
set {server::%uuid of {_p}%::requestingRevive} to false
send "&cYou denied %{_p}%'s token!" to player
send "&cYour token has been denied!" to {_p}
command /pvp:
description: Toggle PvP in the current region
permission: ec.host.worldguard.pvp
trigger:
if plugin "WorldGuard" isn't enabled:
send "&cWorldGuard is not installed!"
stop
set {_reg} to {server::%uuid of player%::region}
set {_world} to {server::%uuid of player%::world}
if {_reg} is not set:
send "&cNo region detected."
stop
if {server::region::%{_reg}%::pvp} is true:
set {server::region::%{_reg}%::pvp} to false
make player execute command "region flag %{_reg}% -w %{_world}% pvp deny"
broadcast "&c⚔ PvP disabled &7in region &e%{_reg}% &7(%{_world}%)"
else:
set {server::region::%{_reg}%::pvp} to true
make player execute command "region flag %{_reg}% -w %{_world}% pvp allow"
broadcast "&a⚔ PvP enabled &7in region &e%{_reg}% &7(%{_world}%)"
# --- BLOCK BREAK ---
command /break:
description: Toggle block breaking in the region
permission: ec.host.worldguard.break
trigger:
if plugin "WorldGuard" isn't enabled:
send "&cWorldGuard is not installed!"
stop
set {_reg} to {server::%uuid of player%::region}
set {_world} to {server::%uuid of player%::world}
if {server::region::%{_reg}%::break} is true:
set {server::region::%{_reg}%::break} to false
make player execute command "region flag %{_reg}% -w %{_world}% block-break deny"
broadcast "&c🧱 Block breaking disabled &7in &e%{_reg}%"
else:
set {server::region::%{_reg}%::break} to true
make player execute command "region flag %{_reg}% -w %{_world}% block-break allow"
broadcast "&a🧱 Block breaking enabled &7in &e%{_reg}%"
# --- BLOCK PLACE ---
command /place:
description: Toggle block placing in the region
permission: ec.host.worldguard.place
trigger:
if plugin "WorldGuard" isn't enabled:
send "&cWorldGuard is not installed!"
stop
set {_reg} to {server::%uuid of player%::region}
set {_world} to {server::%uuid of player%::world}
if {server::region::%{_reg}%::place} is true:
set {server::region::%{_reg}%::place} to false
make player execute command "region flag %{_reg}% -w %{_world}% block-place deny"
broadcast "&c📦 Block placing disabled &7in &e%{_reg}%"
else:
set {server::region::%{_reg}%::place} to true
make player execute command "region flag %{_reg}% -w %{_world}% block-place allow"
broadcast "&a📦 Block placing enabled &7in &e%{_reg}%"
# --- WATER FLOW ---
command /flow:
description: Toggle water & lava flow in the region
permission: ec.host.worldguard.flow
trigger:
if plugin "WorldGuard" isn't enabled:
send "&cWorldGuard is not installed!"
stop
set {_reg} to {server::%uuid of player%::region}
set {_world} to {server::%uuid of player%::world}
if {server::region::%{_reg}%::flow} is true:
set {server::region::%{_reg}%::flow} to false
make player execute command "region flag %{_reg}% -w %{_world}% water-flow deny"
make player execute command "region flag %{_reg}% -w %{_world}% lava-flow deny"
broadcast "&c🌊 Fluid flow disabled &7in &e%{_reg}%"
else:
set {server::region::%{_reg}%::flow} to true
make player execute command "region flag %{_reg}% -w %{_world}% water-flow allow"
make player execute command "region flag %{_reg}% -w %{_world}% lava-flow allow"
broadcast "&a🌊 Fluid flow enabled &7in &e%{_reg}%"
# --- FALL DAMAGE ---
command /fall:
description: Toggle fall damage in the region
permission: ec.host.worldguard.fall
trigger:
if plugin "WorldGuard" isn't enabled:
send "&cWorldGuard is not installed!"
stop
set {_reg} to {server::%uuid of player%::region}
set {_world} to {server::%uuid of player%::world}
if {_reg} is not set:
send "&cNo region detected."
stop
if {server::region::%{_reg}%::fall} is true:
set {server::region::%{_reg}%::fall} to false
make player execute command "region flag %{_reg}% -w %{_world}% fall-damage deny"
broadcast "&c🪂 Fall damage disabled &7in region &e%{_reg}% &7(%{_world}%)"
else:
set {server::region::%{_reg}%::fall} to true
make player execute command "region flag %{_reg}% -w %{_world}% fall-damage allow"
broadcast "&a🪂 Fall damage enabled &7in region &e%{_reg}% &7(%{_world}%)"
# --- PORTAL USE ---
command /portals:
description: Toggle portal use
permission: ec.host.toggleportals
trigger:
if {ec::config::portals-allowed} is true:
set {ec::config::portals-allowed} to false
broadcast "&cPortals have been disabled!"
else:
set {ec::config::portals-allowed} to true
broadcast "&aPortals have been enabled!"
on portal enter:
if {ec::config::portals-allowed} isn't true:
if event-entity is a player:
cancel event
# Scoreboard
on join:
if {server::hosts::*} doesn't contain player:
set {_board} to player's scoreboard
set line 1 of {_board} to "Event:"
set score of line 1 of {_board} to {server::event}
set line 2 of {_board} to "Wins:"
set score of line 2 of {_board} to "&e%{server::%uuid of player%::wins}%"
set line 3 of {_board} to "Tokens:"
set score of line 3 of {_board} to "&e%{server::%uuid of player%::tokens}%"
set player's scoreboard to {_board}
set title of player's scoreboard to "&cDeath &eEvents"
else:
set {_board} to player's scoreboard
set line 1 of {_board} to "Event:"
set score of line 1 of {_board} to {server::event}
set line 2 of {_board} to "Alive:"
set score of line 2 of {_board} to "&e%size of {server::alive::*}%"
set line 3 of {_board} to "Dead:"
set score of line 3 of {_board} to "&e%size of {server::dead::*}%"
set line 4 of {_board} to "Total:"
set score of line 4 of {_board} to "&e%size of all players%"
set player's scoreboard to {_board}
set title of player's scoreboard to "&cDeath &eEvents &7- Host"
every second:
loop all players:
if {server::hosts::*} doesn't contain loop-player:
set {_board} to loop-player's scoreboard
set line 1 of {_board} to "Event:"
set score of line 1 of {_board} to {server::event}
set line 2 of {_board} to "Wins:"
set score of line 2 of {_board} to "&e%{server::%uuid of loop-player%::wins}%"
set line 3 of {_board} to "Tokens:"
set score of line 3 of {_board} to "&e%{server::%uuid of loop-player%::tokens}%"
set loop-player's scoreboard to {_board}
set title of loop-player's scoreboard to "&cDeath &eEvents"
else:
set {_board} to loop-player's scoreboard
set line 1 of {_board} to "Event:"
set score of line 1 of {_board} to {server::event}
set line 2 of {_board} to "Alive:"
set score of line 2 of {_board} to "&e%size of {server::alive::*}%"
set line 3 of {_board} to "Dead:"
set score of line 3 of {_board} to "&e%size of {server::dead::*}%"
set line 4 of {_board} to "Total:"
set score of line 4 of {_board} to "&e%size of all players%"
set loop-player's scoreboard to {_board}
set title of loop-player's scoreboard to "&cDeath &eEvents &7- Host"
on enter of region:
set {_rg} to "%region%"
set {_regions::*} to split {_rg} at " "
set {_region} to {_regions::1}
set {server::%uuid of player%::region} to {_region}
set {server::%uuid of player%::world} to name of player's world
command /whereami:
permission: ec.whereami
trigger:
send "&aRegion: &e%{server::%uuid of player%::region}%"
send "&aWorld: &e%{server::%uuid of player%::world}%"
# Revives
function revivePlayer(p: player, user: player):
if {server::dead::*} contains {_p}:
remove {_p} from {server::dead::*}
if {server::alive::*} doesn't contain {_p}:
add {_p} to {server::alive::*}
clear {_p}'s inventory
set {_p}'s gamemode to survival
teleport {_p} to {_user}
send "&a☠ You have been revived!" to {_p}
command /revive <text> [<number>]:
description: Revive players
permission: ec.host.revive
usage: /revive (all|last|<player>) [seconds]
aliases: rev, res
trigger:
set {_arg} to arg-1
set {_arg2} to arg-2
# --- REVIVE ALL ---
if {_arg} is "all":
loop {server::dead::*}:
if {server::hosts::*} doesn't contain uuid of loop-value:
revivePlayer(loop-value, player)
broadcast "&a✨ All players have been revived!"
stop
# --- REVIVE LAST ---
if {_arg} is "last":
set {_secs} to {_arg2} parsed as number
if {_secs} is not set:
send "&cYou must specify seconds. &7(/revive last <seconds>)"
stop
if {_secs} <= 0:
send "&cYou must specify seconds. &7(/revive last <seconds>)"
stop
set {_count} to 0
loop {server::dead::*}:
set {_t} to {server::deathTime::%uuid of loop-value%}
if {_t} is set:
if difference between {_t} and now is less than or equal to {_secs} seconds:
revivePlayer(loop-value, player)
add 1 to {_count}
if {_count} > 0:
broadcast "&a✨ Revived %{_count}% player(s) who died in the last %{_secs}%s!"
else:
send "&cNo players died in the last %{_secs}% seconds."
stop
# --- REVIVE PLAYER ---
set {_p} to {_arg} parsed as player
if {_p} is not set: