/
BukkitCommandRegistry.java
4291 lines (4071 loc) · 177 KB
/
BukkitCommandRegistry.java
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
package net.aufdemrand.denizen.scripts.commands;
import net.aufdemrand.denizen.nms.NMSHandler;
import net.aufdemrand.denizen.nms.NMSVersion;
import net.aufdemrand.denizen.scripts.commands.core.*;
import net.aufdemrand.denizen.scripts.commands.entity.*;
import net.aufdemrand.denizen.scripts.commands.item.*;
import net.aufdemrand.denizen.scripts.commands.npc.*;
import net.aufdemrand.denizen.scripts.commands.player.*;
import net.aufdemrand.denizen.scripts.commands.server.*;
import net.aufdemrand.denizen.scripts.commands.world.*;
import net.aufdemrand.denizen.utilities.debugging.dB;
import net.aufdemrand.denizen.utilities.depends.Depends;
import net.aufdemrand.denizencore.scripts.commands.CommandRegistry;
public class BukkitCommandRegistry extends CommandRegistry {
@Override
public void registerCoreMembers() {
registerCoreCommands();
// <--[command]
// @Name Action
// @Syntax action [<action name>|...] (<npc>|...) (context:<name>|<object>|...)
// @Required 1
// @Stable unstable
// @Short Manually fires an NPC action.
// @Author mcmonkey
// @Group npc
//
// @Description
// This command will trigger an NPC action (an action within an 'assignment' type script attached to the NPC) exactly the same
// as if an actual serverside event had caused it.
// You can specify as many action names as you want in the list, they will all be fired.
// You may also specify as many NPCs as you would like to run the action on, in a list.
// If no NPCs are specified, the NPC linked to the script will be assumed.
// The script's linked player and the specified NPC will automatically be sent through to the action.
// To add context information (tags like <context.location>) to the action, simply specify all context values in a list.
// Note that there are some inherent limitations... EG, you can't directly add a list to the context currently.
// To do this, the best way is to just escape the list value (see <@link language property escaping>).
//
// @Tags
// TODO: Document Command Details
//
// @Usage
// Use to trigger a custom action
// - action "custom action"
//
// @Usage
// Use to trigger multiple custom action with context on a different NPC
// - action "player dances|target enemy" n@10 context:action|custom|target|<player.selected_npc>
// -->
registerCoreMember(ActionCommand.class,
"ACTION", "action [<action name>|...] (<npc>|...) (context:<name>|<object>|...)", 1);
// <--[command]
// @Name ActionBar
// @Syntax actionbar [<text>] (targets:<player>|...) (format:<name>)
// @Required 1
// @Stable stable
// @Short Sends a message to a player's action bar.
// @Author Fortifier42
// @group player
//
// @Description
// Sends a message to the target's action bar area. If no target is specified it will default to the attached
// player. Accepts the 'format:<name>' argument, which will reformat the text according to the specified
// format script.
//
// @Tags
// None
//
// @Usage
// Use to send a message to the player's action bar.
// - actionbar "Hey there <player.name>!"
//
// @Usage
// Use to send a message to a list of players.
// - actionbar "Hey, welcome to the server!" targets:p@Fortifier42|p@mcmonkey4eva|p@Morphan1
//
// @Usage
// Use to send a message to a list of players, with a formatted message.
// - actionbar "Hey there!" targets:p@Fortifier42|p@mcmonkey4eva format:ServerChat
// -->
registerCoreMember(ActionBarCommand.class,
"ACTIONBAR", "actionbar [<text>] (targets:<player>|...)", 1);
// <--[command]
// @Name Adjust
// @Syntax adjust [<dObject>|...] [<mechanism>](:<value>)
// @Required 2
// @Stable stable
// @Short Adjusts a dObjects mechanism.
// @Author aufdemrand
// @Group core
// @Video /denizen/vids/Properties%20and%20Mechanisms
//
// @Description
// Many dObjects contains options and properties that need to be adjusted. Denizen employs a mechanism
// interface to deal with those adjustments. To easily accomplish this, use this command with a valid object
// mechanism, and sometimes accompanying value.
//
// @Tags
// <entry[saveName].result> returns the adjusted object.
// <entry[saveName].result_list> returns a dList of adjusted objects.
//
// @Usage
// Use to set a custom display name on an entity.
// - adjust e@1000 'custom_name:ANGRY!'
//
// @Usage
// Use as part of the steps to modify the item a player is holding
// - adjust <player.item_in_hand> "lore:Advanced Item" save:myitem
// - take iteminhand
// - give <entry[myitem].result>
// -->
registerCoreMember(AdjustCommand.class,
"ADJUST", "adjust [<dObject>|...] [<mechanism>](:<value>)", 2);
// <--[command]
// @Name Age
// @Syntax age [<entity>|...] (adult/baby/<age>) (lock)
// @Required 1
// @Stable stable
// @Short Sets the ages of a list of entities, optionally locking them in those ages.
// @Author David Cernat
// @Group entity
//
// @Description
// Some living entity types are 'ageable' which can affect an entities ability to breed, or whether they appear
// as a baby or an adult. Using the 'age' command allows modification of an entity's age. Specify an entity and
// either 'baby', 'adult', or an integer age to set the age of an entity. Using the 'lock' argument will
// keep the entity from increasing its age automatically. NPCs which use ageable entity types can also be
// specified.
//
// @Tags
// <e@entity.age>
//
// @Usage
// Use to make an ageable entity a permanant baby.
// - age e@50 baby lock
// ...or a mature adult.
// - age e@50 adult lock
//
// @Usage
// Use to make a baby entity an adult.
// - age n@puppy adult
//
// @Usage
// Use to mature an animals so that it is old enough to breed.
// - age <player.location.find.entities.within[20]> 10
// -->
registerCoreMember(AgeCommand.class,
"AGE", "age [<entity>|...] (adult/baby/<age>) (lock)", 1);
// <--[command]
// @Name Anchor
// @Syntax anchor [id:<name>] [assume/remove/add <location>/walkto/walknear (r:#)]
// @Required 2
// @Stable stable
// @Short Controls a NPC's Anchor Trait.
// @Author aufdemrand
// @Group npc
//
// @Description
// The anchor system inside Citizens2 allows locations to be 'bound' to a NPC, saved by an 'id'. The anchor
// command can add and remove new anchors, as well as the ability to teleport NPCs to anchors with the 'assume'
// argument.
// The Anchors Trait can also be used as a sort of 'waypoints' system. For ease of use, the anchor command
// provides function for NPCs to walk to or walk near an anchor.
// As the Anchor command is a NPC specific command, a valid npc object must be referenced in the script entry.
// If none is provided by default, the use of the 'npc:n@id' argument, replacing the id with the npcid of the
// NPC desired, can create a link, or alternatively override the default linked npc.
//
// @Tags
// <n@npc.anchor[anchor_name]>
//
// @Usage
// Use to add and remove anchors to a npc.
// - define location_name <context.message>
// - chat "I have saved this location as <def[location_name]>.'
// - anchor add <npc.location> "id:<def[location_name]>"
//
// @Usage
// Use to make a NPC walk to or walk near a saved anchor.
// - anchor walkto i:waypoint_1
// - anchor walknear i:waypoint_2 r:5
// -->
registerCoreMember(AnchorCommand.class,
"ANCHOR", "anchor [id:<name>] [assume/remove/add <location>/walkto/walknear (r:#)]", 2);
// <--[command]
// @Name Animate
// @Syntax animate [<entity>|...] [animation:<name>]
// @Required 2
// @Stable stable
// @Short Makes a list of entities perform a certain animation.
// @Author David Cernat
// @Group entity
//
// @Description
// Minecraft implements several player and entity animations which the animate command can use, just
// specify an entity and an animation.
//
// Player animations require a Player-type entity or NPC. Available player animations include:
// ARM_SWING, CRIT, HURT, and MAGIC_CRIT, SIT, SLEEP, SNEAK, STOP_SITTING, STOP_SLEEPING, STOP_SNEAKING,
// START_USE_MAINHAND_ITEM, START_USE_OFFHAND_ITEM, STOP_USE_ITEM, EAT_FOOD, ARM_SWING_OFFHAND
//
// All entities also have available Bukkit's entity effect list, which includes:
// DEATH, FIREWORK_EXPLODE, HURT, IRON_GOLEM_ROSE, SHEEP_EAT, VILLAGER_ANGRY, VILLAGER_HAPPY
// VILLAGER_HEART, WITCH_MAGIC, WOLF_HEARTS, WOLF_SHAKE, WOLF_SMOKE, ZOMBIE_TRANSFORM,
// SKELETON_START_SWING_ARM, SKELETON_STOP_SWING_ARM
//
// Note that the above list only applies where logical, EG 'WOLF_' animations only apply to wolves.
//
// @Tags
// None
//
// @Usage
// Use to make a player appear to get hurt.
// - animate <player> animation:hurt
//
// @Usage
// Use to make a wolf NPC shake
// - animate '<n@aufdemrand's wolf>' animation:wolf_shake
// -->
if (Depends.citizens != null) {
registerCoreMember(AnimateCommand.class,
"ANIMATE", "animate [<entity>|...] [animation:<name>]", 2);
}
// <--[command]
// @Name AnimateChest
// @Syntax animatechest [<location>] ({open}/close) (sound:{true}/false) (<player>|...)
// @Required 1
// @Stable unstable
// @Short Makes a chest appear to open or close.
// @Author Jeebiss, mcmonkey
// @Group world
//
// @Description
// This command animates a chest in the world to open or close at a specified location.
// The command by default will open the chest. It accepts a sound argument which specifies whether
// the open or close sound will play aswell as the animation. The sound plays by default and
// can be disabled with 'sound:false' It also accepts a player or list of players to animate the chest to,
// allowing only selected players to see the chest animate as opened or closed.
//
// @Tags
// TODO: Document Command Details
//
// @Usage
// Use to animate a chest to open at 15,89,-45 in world: world
// - animatechest l@15,89,-45,world
//
// @Usage
// To then close the chest at 15,89,-45 in world: world
// - animatechest l@15,89,-45,world close
//
// @Usage
// Use to animate a chest to open with no sound at 12,12,-64 in world: peter
// - animatechest l@12,12,-64,peter sound:false
//
// @Usage
// If only a player by the name of Morphan1 should see the chest open
// - animatechest l@12,12,-64,peter sound:false p@Morphan1
//
// @Usage
// The command also accepts a list of players to view the animation
// - animatechest l@12,12,-64,peter sound:false p@Morphan1|p@mcmonkey4eva|p@Fortifier42
// -->
registerCoreMember(AnimateChestCommand.class,
"ANIMATECHEST", "animatechest [<location>] ({open}/close) (sound:{true}/false) (<player>|...)", 1);
// <--[command]
// @Name Announce
// @Syntax announce [<text>] (to_ops/to_console/to_flagged:<flag_name>) (format:<name>)
// @Required 1
// @Stable stable
// @Short Announces a message for everyone online to read.
// @Author aufdemrand
// @Group server
//
// @Description
// Announce sends a raw message to players. Simply using announce with text will send
// the message to all online players. Specifing the 'to_ops' argument will narrow down the players
// in which the message is sent to ops only. Alternatively, using the 'to_flagged' argument
// will send the message to players only if the specified flag does not equal true. You can also
// use the 'to_console' argument to make it so it only shows in the server console. Announce
// can also utilize a format script with the 'format' argument. See the format script-container
// for more information.
//
// @Tags
// None
//
// @Usage
// Use to send an important message to your players.
// - announce 'Warning! This server will restart in 5 minutes!'
//
// @Usage
// Use to send a message to a specific 'group' of players.
// - announce to_flagged:clan_subang '[<player.name>] Best clan ever!'
//
// @Usage
// Use to easily send a message to all online ops.
// - announce to_ops '<player.name> requires help!'
//
// @Usage
// Use to send a message to just the console (Primarily for debugging / logging).
// - announce to_console 'Warning- <player.name> broke a mob spawner at location <player.location>'
// -->
registerCoreMember(AnnounceCommand.class,
"ANNOUNCE", "announce [<text>] (to_ops/to_console/to_flagged:<flag_name>) (format:<name>)", 1);
// <--[command]
// @Name Assignment
// @Syntax assignment [set/remove] (script:<name>)
// @Required 1
// @Stable unstable
// @Short Changes an NPC's assignment.
// @Author aufdemrand
// @Group npc
//
// @Description
// Changes an NPC's assignment as though you used the '/npc assignment' command.
// Uses the script: argument, which accepts an assignment script type. For this command to work an npc must
// be attached to the script queue or an npc specified with npc:n@npc.
//
// @Tags
// <n@npc.script>
//
// @Usage
// Use to assign an npc with an assignment script named 'Bob the Builder'.
// - assignment set "script:Bob the Builder"
//
// @Usage
// Use to give an npc with the id of 3 an assignment.
// - assignment set "script:Bob the Builder" npc:n@3
//
// @Usage
// Use to remove an npc's assignment.
// - assignment remove
// -->
if (Depends.citizens != null) {
registerCoreMember(AssignmentCommand.class,
"ASSIGNMENT", "assignment [set/remove] (script:<name>)", 1);
}
// <--[command]
// @Name Attack
// @Syntax attack (<entity>|...) (target:<entity>/cancel)
// @Required 0
// @Stable stable
// @Short Makes an entity, or list of entities, attack a target.
// @Author David Cernat
// @Group entity
//
// @Description
// By itself, the 'attack' command will act as a NPC command in the sense that an attached
// NPC will attack the attached player, or specified target. It can also accept a specified entity,
// or list of entities, to fulfill the command, just specify a 'fetchable' entity object. This includes
// player objects (dPlayers) and NPC objects (dNPCs). To specify the target, prefix the entity
// object with 'target:' or 't:'.
//
// To cancel an attack, use the 'cancel' argument instead of specifying a target.
//
// @Tags
// <n@npc.navigator.is_fighting>
// <n@npc.navigator.attack_strategy>
// <n@npc.navigator.target_entity>
//
// @Usage
// Use to make a NPC attack a player in an interact script.
// - attack
//
// @Usage
// Use to make a NPC attack a nearby entity.
// - attack target:<npc.location.find.living_entities.within[10].random>
//
// @Usage
// Use to make a specific entity attack an entity, including players or npcs.
// - attack <player.location.find.living_entities.within[10].random> target:<player>
//
// @Usage
// Use to stop an attack
// - attack n@Herobrine stop
// -->
registerCoreMember(AttackCommand.class,
"ATTACK", "attack (<entity>|...) (target:<entity>/cancel)", 0);
// <--[command]
// @Name Ban
// @Syntax ban ({add}/remove) [<player>|...] (reason:<text>) (duration:<duration>)
// @Required 1
// @Stable stable
// @Short Ban or un-ban a player or list of players.
// @Author Fortifier42
// @Group server
//
// @Description
// Add or remove bans from the server, with optional arguments for a reason and duration of a temporary
// ban. By default will ban the specified player(s), and kick them from the server. You can set a reason for
// which the player(s) will be banned, along with a duration (if you wish to temporarily ban them). If a
// reason is not specified, it will default to "Banned.". If a duration for the ban if not specified, they
// will be banned permanently.
//
// @Tags
// <p@player.is_banned>
// <p@player.ban_info.reason>
// <p@player.ban_info.expiration>
// <p@player.ban_info.created>
//
// @Usage
// Use to ban a player.
// - ban p@mcmonkey4eva
//
// @Usage
// Use to ban a list of players with a reason.
// - ban p@mcmonkey4eva|p@Morphan1 "reason:Didn't grow enough potatoes."
//
// @Usage
// Use to ban a list of players for 10 minutes with a reason.
// - ban p@mcmonkey4eva|p@Morphan1 "reason:Didn't grow enough potatoes." duration:10m
//
// @Usage
// Use to unban a list of players.
// - ban remove p@mcmonkey4eva|p@Morphan1
// -->
registerCoreMember(BanCommand.class,
"BAN", "ban ({add}/remove) [<player>|...] (reason:<text>) (duration:<duration>)", 1);
// <--[command]
// @Name BlockCrack
// @Syntax blockcrack [<location>] [progress:<#>] (stack) (players:<player>|...)
// @Required 2
// @Stable stable
// @Short Shows the player(s) a block cracking animation.
// @Author Morphan1
// @Group world
//
// @Description
// You must specify a progress number between 1 and 10, where 1 is the first stage and 10 is the last.
// To remove the animation, you must specify any number outside of that range. For example, 0.
// Optionally, you can stack multiple effects
//
// @Tags
// None
//
// @Usage
// Use to show a crack in a block to the currently attached player.
// - blockcrack l@12,43,20,world progress:4
//
// @Usage
// Use to stop showing a crack in a block to all online players.
// - blockcrack l@12,43,20,world progress:0 players:<server.list_online_players>
//
// @Usage
// Use to show all 10 layers of block cracking at the same time.
// - repeat 10:
// - blockcrack l@12,43,20,world progress:<def[value]> stack
// -->
registerCoreMember(BlockCrack.class,
"BLOCKCRACK", "blockcrack [<location>] [progress:<#>] (stack) (players:<player>|...)", 2);
// <--[command]
// @Name Break
// @Syntax break [<location>] (<npc>) (radius:<#.#>)
// @Required 1
// @Stable unstable
// @Short Makes an NPC walk over and break a block.
// @Author aufdemrand
// @Group world
//
// @Description
// By itself, the 'break' command will act as a NPC command in the sense that an attached
// NPC will navigate to and break the block at the attached location. It can also accept a specified npc,
// to fulfill the command, just specify a 'fetchable' npc object. It can also accept a radius to start
// breaking the block from within. To specify the radius, prefix the radius with 'radius:'.
//
// @Tags
// <n@npc.navigator.is_navigating>
// <n@npc.navigator.target_location>
//
// @Usage
// Use to make the npc break a block at 17,64,-87 in world.
// - break l@17,64,-87,world
//
// @Usage
// Use to make an npc with the id 12 break a block at 17,64,-87 in world.
// - break l@17,64,-87,world n@12
//
// @Usage
// Use to make an npc with the name bob break a block at 17,64,-87 and start digging from 5 blocks away.
// - break l@17,64,-87,world n@bob radius:5
// -->
if (Depends.citizens != null) {
registerCoreMember(BreakCommand.class,
"BREAK", "break [<location>] (<npc>) (radius:<#.#>)", 1);
}
// <--[command]
// @Name BossBar
// @Syntax bossbar ({create}/update/remove) [<id>] (players:<player>|...) (title:<title>) (progress:<#.#>) (color:<color>) (style:<style>) (flags:<flag>|...)
// @Required 1
// @Stable stable
// @Short Shows players a boss bar.
// @Author Morphan1
// @Group server
//
// @Description
// Displays a boss bar at the top of the screen of the specified player(s). You can also update the
// values and remove the bar.
//
// Requires an ID. Progress must be between 0 and 1.
//
// Valid colors: BLUE, GREEN, PINK, PURPLE, RED, WHITE, YELLOW.
// Valid styles: SEGMENTED_10, SEGMENTED_12, SEGMENTED_20, SEGMENTED_6, SOLID.
// Valid flags: CREATE_FOG, DARKEN_SKY, PLAY_BOSS_MUSIC.
//
// @Tags
// <server.current_bossbars>
//
// @Usage
// Shows a message to all online players.
// - bossbar MyMessageID players:<server.list_online_players> "title:HI GUYS" color:red
//
// @Usage
// Update the boss bar's color and progress.
// - bossbar update MyMessageID color:blue progress:0.2
//
// @Usage
// Add more players to the boss bar.
// - bossbar update MyMessageID players:<server.flag[new_players]>
//
// @Usage
// Remove a player from the boss bar.
// - bossbar remove MyMessageID players:<server.match_player[BlackCoyote]>
//
// @Usage
// Delete the boss bar.
// - bossbar remove MyMessageID
// -->
if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_9_R2)) {
registerCoreMember(BossBarCommand.class,
"BOSSBAR", "bossbar ({create}/update/remove) [<id>] (players:<player>|...) (title:<title>) (progress:<#.#>) (color:<color>) (style:<style>) (flags:<flag>|...)", 1);
}
// <--[command]
// @Name Burn
// @Syntax burn [<entity>|...] (duration:<value>)
// @Required 1
// @Stable stable
// @Short Sets a list of entities on fire.
// @Author David Cernat
// @Group entity
//
// @Description
// Burn will set a list of entities on fire. Just specify a list of entities (or a single entity) and
// optionally, a duration. Normal mobs and players will see damage afflicted, but NPCs will block damage
// from a burn unless 'vulnerable'. Since this command sets the total time of fire, it can also be used
// to cancel fire on a burning entity by specifying a duration of 0. Specifying no duration will result
// in a 5 second burn.
//
// @Tags
// <e@entity.fire_time>
//
// @Usage
// Use to set an entity on fire.
// - burn <player> duration:10s
//
// @Usage
// Use to cancel fire on entities.
// - burn <player.location.find.living_entities.within[10]> duration:0
// -->
registerCoreMember(BurnCommand.class,
"BURN", "burn [<entity>|...] (duration:<value>)", 1);
// <--[command]
// @Name Cast
// @Syntax cast [<effect>] (remove) (duration:<value>) (power:<#>) (<entity>|...) (no_ambient) (hide_particles)
// @Required 1
// @Stable Stable
// @Short Casts a potion effect to a list of entities.
// @Author aufdemrand, Jeebiss, Morphan1, mcmonkey
// @Group entity
//
// @Description
// Casts or removes a potion effect to or from a list of entities. If you don't specify a duration,
// it defaults to 60 seconds. If you don't specify a power level, it defaults to 1.
// To cast an effect with a duration which displays as '**:**' or 'infinite' use a duration
// of '1639s' (1639 seconds) or greater. While it may display as infinite, it will still wear off.
//
// If no player is specified, the command will target the player. If no player is present, the
// command will target the NPC. If an NPC is not present, there will be an error!
//
// Optionally, specify "no_ambient" to hide some translucent additional particles, while still
// rendering the main particles.
// Optionally, specify "hide_particles" to remove the particle effects entirely.
//
// @Tags
// <e@entity.has_effect[<effect>]>
//
// @Usage
// Use to cast an effect onto the player for 120 seconds with a power of 3.
// - cast jump d:120 p:3
//
// @Usage
// Use to remove an effect from the player.
// - if <player.has_effect[jump]> {
// - cast jump remove <player>
// }
// -->
registerCoreMember(CastCommand.class,
"CAST", "cast [<effect>] (remove) (duration:<value>) (power:<#>) (<entity>|...) (no_ambient) (hide_particles)", 1);
// TODO: Should the chat command be in the NPC group instead?
// <--[command]
// @Name Chat
// @Syntax chat [<text>] (no_target/targets:<entity>|...) (talkers:<entity>|...) (range:<#.#>)
// @Required 1
// @Stable stable
// @Short Causes a NPC/NPCs to send a chat message to nearby players.
// @Author aufdemrand
// @Group player
//
// @Description
// Chat uses an NPCs DenizenSpeechController provided by Denizen, typically inside 'interact' or 'task'
// script-containers. Typically there is already player and NPC context inside a queue that is using
// the 'chat' command. In this case, only a text string is required. Alternatively, target entities
// can be specified to have any Entity chat to a different target/targets, or specify 'no_target' to
// not send the message to any specific target.
//
// Chat from a NPC is formatted by the settings present in Denizen's config.yml. Players being chatted
// to see a slightly different message than surrounding players. By default, a 'chat' will allow other
// players nearby to also see the conversation. For example:
// <code>
// - chat 'Hello!'
// </code>
// The player being chatted to, by default the attached Player to the script queue, will see a message
// 'Jack says to you, Hello!', however surrounding entities will see something along the lines of
// 'Jack says to aufdemrand, Hello!'. The format for this is configurable.
//
// If sending messages to the Player without any surrounding entities hearing the message is desirable,
// it is often times recommended to instead use the 'narrate' command. Alternatively, on a server-wide scale,
// the configuration node for the 'range' can be set to 0, however this is discouraged.
//
// @Tags
// None
//
// @Usage
// Use to emulate a NPC talking out loud to a Player within an interact script-container.
// - chat "Hello, <player.name>! Nice day, eh?"
//
// @Usage
// Use to have a NPC talk to a group of individuals.
// - flag <npc> talk_targets:!
// - foreach <npc.location.find.players.within[6]> {
// - if <def[value].has_flag[clan_initiate]> {
// - flag <npc> talk_targets:->:<def[value]>
// }
// }
// - chat targets:<npc.flag[talk_targets].as_list> "Welcome, initiate!"
// -->
if (Depends.citizens != null) {
registerCoreMember(ChatCommand.class,
"CHAT", "chat [<text>] (no_target/targets:<entity>|...) (talkers:<entity>|...) (range:<#.#>)", 1);
}
// <--[command]
// @Name ChunkLoad
// @Syntax chunkload ({add}/remove/removeall) [<chunk>] (duration:<value>)
// @Required 1
// @Stable stable
// @Short Keeps a chunk actively loaded and allowing NPC activity.
// @Author spaceemotion, mcmonkey
// @Group world
//
// @Description
// Forces a chunk to load and stay loaded in the world for the duration specified or until removed. This is
// persistent over server restarts. If no duration is specified it defaults to 0 (forever). While a chunk is
// loaded all normal activity such as crop growth and npc activity continues.
//
// @Tags
// <w@world.loaded_chunks>
// <ch@chunk.is_loaded>
//
// @Usage
// Use to load a chunk.
// - chunkload ch@0,0,world
//
// @Usage
// Use to temporarily load a chunk.
// - chunkload ch@0,0,world duration:5m
//
// @Usage
// Use to stop loading a chunk.
// - chunkload remove ch@0,0,world
//
// @Usage
// Use to stop loading all chunks.
// - chunkload removeall
// -->
registerCoreMember(ChunkLoadCommand.class,
"CHUNKLOAD", "chunkload ({add}/remove/removeall) [<chunk>] (duration:<value>)", 1);
// <--[command]
// @Name Compass
// @Syntax compass [<location>/reset]
// @Required 1
// @Stable stable
// @Short Redirects the player's compass to target the given location.
// @Author mcmonkey
// @Group player
//
// @Description
// Redirects the compass of the player, who is attached to the script queue.
//
// This is not the compass item, but the command is controlling the pointer the item should direct at.
// This means that all item compasses will point the same direction but differently for each player.
//
// The y-axis is not used but its fine to be included in the location argument.
//
// Reset argument will turn the direction to default (spawn or bed)
//
// @Tags
// <p@player.compass.target>
//
// @Usage
// Use to reset the compass direction to its default
// - compass reset
//
// @Usage
// Use to point with a compass to the player's current location
// - compass <player.location>
//
// @Usage
// Use to point with a compass to the world's spawn location
// - compass <w@world.spawn_location>
// -->
registerCoreMember(CompassCommand.class,
"COMPASS", "compass [<location>/reset]", 1);
// <--[command]
// @Name Cooldown
// @Syntax cooldown [<duration>] (global) (s:<script>)
// @Required 1
// @Stable stable
// @Short Temporarily disables a script-container from meeting requirements.
// @Author aufdemrand
// @Group core
//
// @Description
// Cools down a script-container. If an interact-container, when on cooldown, scripts will not pass a
// requirements check allowing the next highest priority script to trigger. If any other type of script, a
// manual requirements check (<s@script_name.requirements.check>) will also return false until the cooldown
// period is completed. Cooldown requires a type (player or global), a script, and a duration. It also requires
// a valid link to a dPlayer if using player-type cooldown.
//
// Cooldown periods are persistent through a server restart as they are saved in the saves.yml.
//
// @Tags
// <s@script_name.cooled_down[player]>
// <s@script_name.cooldown>
// <s@requirements.check>
//
// @Usage
// Use to keep the current interact script from meeting requirements.
// - cooldown 20m
//
// @Usage
// Use to keep a player from activating a script for a specified duration.
// - cooldown 11h s:s@bonus_script
// - cooldown 5s s:s@hit_indicator
//
// @Usage
// Use the 'global' argument to indicate the script to be on cooldown for all players.
// - cooldown global 24h s:s@daily_treasure_offering
// -->
registerCoreMember(CooldownCommand.class,
"COOLDOWN", "cooldown [<duration>] (global) (s:<script>)", 1);
// <--[command]
// @Name CopyBlock
// @Syntax copyblock [<location>/<cuboid>] [to:<location>] (remove_original)
// @Required 1
// @Stable unstable
// @Short Copies a block to another location, keeping all metadata.
// @Author aufdemrand, David Cernat
// @Group world
//
// @Description
// TODO: Document Command Details
//
// @Tags
// <l@location.material>
//
// @Usage
// TODO: Document Command Details
// -->
registerCoreMember(CopyBlockCommand.class,
"COPYBLOCK", "copyblock [<location>/<cuboid>] [to:<location>] (remove_original)", 1);
// <--[command]
// @Name Create
// @Syntax create [<entity>] [<name>] (<location>) (traits:<trait>|...)
// @Required 1
// @Stable experimental
// @Short Creates a new NPC, and optionally spawns it at a location.
// @Author aufdemrand
// @Group npc
//
// @Description
// Creates an npc which the entity type specified, or specify an existing npc to create a copy. If no location
// is specified the npc is created despawned. Use the 'save:<savename>' argument to return the npc for later
// use in a script.
//
// @Tags
// <server.list_npcs>
// <entry[saveName].created_npc> returns the NPC that was created.
//
// @Usage
// Use to create a despawned NPC for later usage.
// - create player Bob
//
// @Usage
// Use to create an NPC and spawn it immediately.
// - create spider Joe <player.location>
// -->
if (Depends.citizens != null) {
registerCoreMember(CreateCommand.class,
"CREATE", "create [<entity>] [<name>] (<location>)", 1);
}
// <--[command]
// @Name CreateWorld
// @Syntax createworld [<name>] (g:<generator>) (worldtype:<type>) (environment:<environment>) (copy_from:<world>) (seed:<seed>)
// @Required 1
// @Stable unstable
// @Short Creates a new world, or loads an existing world.
// @Author aufdemrand, mcmonkey
// @Group world
//
// @Description
// This command creates a new minecraft world with the specified name, or loads an existing world by thet name.
// TODO: Document Command Details (generator)
// It accepts a world type which can be specified with 'worldtype:'.
// If a worldtype is not specified it will create a world with a worldtype of NORMAL.
// Recognised world type are NORMAL (creates a normal world), FLAT (creates a world with flat terrain),
// LARGE_BIOMES (creates a normal world with 16x larger biomes) and AMPLIFIED (creates a world with tall
// mountain-like terrain).
// An environment is expected and will be defaulted to NORMAL. Alternatives are NETHER and THE_END.
// Optionally, specify an existing world to copy files from.
//
// @Tags
// <server.list_worlds>
//
// @Usage
// Use to create a normal world with name 'survival'
// - createworld survival
//
// @Usage
// Use to create a flat world with the name 'superflat'
// - createworld superflat worldtype:FLAT
//
// @Usage
// Use to create an end world with the name 'space'
// - createworld space environment:THE_END
// -->
registerCoreMember(CreateWorldCommand.class,
"CREATEWORLD", "createworld [<name>] (g:<generator>) (worldtype:<type>) (environment:<environment>) (copy_from:<world>) (seed:<seed>)", 1);
// <--[command]
// @Name Despawn
// @Syntax despawn (<npc>|...)
// @Required 0
// @Stable stable
// @Short Temporarily despawns the linked NPC or a list of NPCs.
// @Author mcmonkey
// @Group npc
//
// @Description
// This command will temporarily despawn either the linked NPC or
// a list of other NPCs. Despawning means they are no longer visible
// or interactable, but they still exist and can be respawned.
//
// @Tags
// <n@npc.is_spawned>
//
// @Usage
// Use to despawn the linked NPC.
// - despawn
//
// @Usage
// Use to despawn several NPCs.
// - despawn <npc>|<player.selected_npc>|n@32
// -->
if (Depends.citizens != null) {
registerCoreMember(DespawnCommand.class,
"DESPAWN", "despawn (<npc>)", 0);
}
// <--[command]
// @Name Disengage
// @Syntax disengage
// @Required 0
// @Stable stable
// @Short Enables a NPCs triggers that have been temporarily disabled by the engage command.
// @Author aufdemrand
// @Group npc
//
// @Description
// Re-enables any toggled triggers that have been disabled by disengage. Using
// disengage inside scripts must have a NPC to reference, or one may be specified
// by supplying a valid dNPC object with the npc argument.
//
// This is mostly regarded as an 'interact script command', though it may be used inside
// other script types. This is because disengage works with the trigger system, which is an
// interact script-container feature.
//
// NPCs that are interacted with while engaged will fire an 'on unavailable' assignment
// script-container action.
//
// See <@link command Engage>
//
// @Tags
// <n@npc.is_engaged>
//
// @Usage
// Use to reenable a NPC's triggers, disabled via 'engage'.
// - engage
// - chat 'Be right there!'
// - walk <player.location>
// - wait 5s
// - disengage
//
// -->
if (Depends.citizens != null) {
registerCoreMember(DisengageCommand.class,
"DISENGAGE", "disengage", 0);
}
// <--[command]
// @Name DisplayItem
// @Syntax displayitem [<item>] [<location>] (duration:<value>)
// @Required 2
// @Stable unstable
// @Short Makes a non-touchable item spawn for players to view.
// @Author aufdemrand, mcmonkey
// @Group item
//
// @Description
// This command drops an item at the specified location which cannot be picked up by players.
// It accepts a duration which determines how long the item will stay for until disappearing.
// If no duration is specified the item will stay for 1 minute, after which the item will disappear.
//
// @Tags
// TODO: Document Command Details
// <entry[saveName].dropped> returns a dEntity of the spawned item.
//
// @Usage
// Use to display a stone block dropped at a players location
// - displayitem i@stone <player.location>
//
// @Usage
// Use to display a diamond sword dropped at 12,64,-847 in world survival
// - displayitem i@diamond_sword l@12,64,-847,survival
//
// @Usage
// Use to display redstone dust dropped at -54,100,-87 in world creative disappear after 10 seconds
// - displayitem i@redstone l@-54,100,-87,creative duration:10s
//
// @Usage
// Use to save the dropped item to save entry 'item_dropped'
// - displayitem i@redstone l@-54,100,-87,creative duration:10s save:item_dropped
// -->
registerCoreMember(DisplayItemCommand.class,