-
-
Notifications
You must be signed in to change notification settings - Fork 104
/
CommandRegistry.java
2114 lines (1848 loc) · 72.7 KB
/
CommandRegistry.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 java.util.HashMap;
import java.util.Map;
import net.aufdemrand.denizen.Denizen;
import net.aufdemrand.denizen.interfaces.dRegistry;
import net.aufdemrand.denizen.interfaces.RegistrationableInstance;
import net.aufdemrand.denizen.scripts.commands.core.*;
import net.aufdemrand.denizen.scripts.commands.item.*;
import net.aufdemrand.denizen.scripts.commands.player.*;
import net.aufdemrand.denizen.scripts.commands.server.*;
import net.aufdemrand.denizen.scripts.commands.entity.*;
import net.aufdemrand.denizen.scripts.commands.npc.*;
import net.aufdemrand.denizen.scripts.commands.world.*;
import net.aufdemrand.denizen.utilities.debugging.dB;
public class CommandRegistry implements dRegistry {
public Denizen denizen;
public CommandRegistry(Denizen denizen) {
this.denizen = denizen;
}
private Map<String, AbstractCommand> instances = new HashMap<String, AbstractCommand>();
private Map<Class<? extends AbstractCommand>, String> classes = new HashMap<Class<? extends AbstractCommand>, String>();
@Override
public boolean register(String commandName, RegistrationableInstance commandInstance) {
this.instances.put(commandName.toUpperCase(), (AbstractCommand) commandInstance);
this.classes.put(((AbstractCommand) commandInstance).getClass(), commandName.toUpperCase());
return true;
}
@Override
public Map<String, AbstractCommand> list() {
return instances;
}
@Override
public AbstractCommand get(String commandName) {
if (instances.containsKey(commandName.toUpperCase())) return instances.get(commandName.toUpperCase());
else return null;
}
@Override
public <T extends RegistrationableInstance> T get(Class<T> clazz) {
if (classes.containsKey(clazz)) return clazz.cast(instances.get(classes.get(clazz)));
else return null;
}
@Override
public void registerCoreMembers() {
// <--[command]
// @Name Age
// @Usage 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
// @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
// Todo
// @Usage
// Use to make an ageable entity a permanant baby.
// - age e@50 baby 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
// @Usage anchor [id:<name>] [assume/remove/add <location>/walkto/walknear (r:#)]
// @Required 2
// @Stable stable
// @Short Controls a NPC's Anchor Trait.
// @Author aufdemrand
// @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 %location_name%.'
// - anchor add <npc.location> "id:%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
// @Usage animate [<entity>|...] [animation:<name>]
// @Required 1
// @Stable stable
// @Short Makes a list of entities perform a certain animation.
// @Author David Cernat
// @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
// All entities, regardless of type, can utilize the 'hurt' animation. Additionally, wolf entities
// and NPCs can also use: WOLF_SMOKE, WOLF_HEARTS, and WOLF_SHAKE. Sheep entities and NPCs also have
// available the SHEEP_EAT animation.
// @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
// -->
registerCoreMember(AnimateCommand.class,
"ANIMATE", "animate [<entity>|...] [animation:<name>]", 1);
// <--[command]
// @Name AnimateChest
// @Usage animatechest [<location>] ({open}/close) (sound:{true}/false)
// @Required 1
// @Stable unstable
// @Short Makes a chest open or close.
// @Author Todo
// @Description
// Todo
// @Tags
// Todo
// @Usage
// Todo
// -->
registerCoreMember(AnimateChestCommand.class,
"ANIMATECHEST", "animatechest [<location>] ({open}/close) (sound:{true}/false)", 1);
// <--[command]
// @Name Announce
// @Usage announce ["<text>"] (to_ops/to_flagged:<flag_name>) (format:<name>)
// @Required 1
// @Stable stable
// @Short Announces a message for everyone online to read.
// @Author aufdemrand
// @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' value argument
// will send the message to players only if the specified flag does not equal true. Announce can also
// utilize a format script with the 'format' argument. See the format script-container for more
// information.
// @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!'
// -->
registerCoreMember(AnnounceCommand.class,
"ANNOUNCE", "announce [\"<text>\"] (to_ops/to_flagged:<flag_name>) (format:<name>)", 1);
// <--[command]
// @Name Assignment
// @Usage assignment [{set}/remove] (script:<name>)
// @Required 1
// @Stable unstable
// @Short Changes an NPC's assignment.
// @Author aufdemrand
// @Description
// Todo
// @Tags
// <n@npc.script>
// @Usage
// Todo
// -->
registerCoreMember(AssignmentCommand.class,
"ASSIGNMENT", "assignment [{set}/remove] (script:<name>)", 1);
// <--[command]
// @Name Attack
// @Usage attack (<entity>|...) (target:<entity>/cancel)
// @Required 0
// @Stable stable
// @Short Makes an entity, or list of entities, attack a target.
// @Author David Cernat
// @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> will return true if the NPC is currently attacking
// <n@npc.navigator.attack_strategy> will return the name of the current strategy
// <n@npc.navigator.target_entity> will return the entity object of the current target
// @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 Break
// @Usage break [<location>] (entity:<entity>) (radius:<#.#>)
// @Required 1
// @Stable unstable
// @Short Makes the NPC walk over and break a block. (Doesn't work!)
// @Author aufdemrand
// @Description
// Todo
// @Tags
// Todo
// @Usage
// Todo
// -->
registerCoreMember(BreakCommand.class,
"BREAK", "break [<location>] (entity:<entity>) (radius:<#.#>)", 1);
// <--[command]
// @Name Burn
// @Usage burn [<entity>|...] (duration:<value>)
// @Required 1
// @Stable stable
// @Short Sets a list of entities on fire.
// @Author David Cernat
// @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> will show the duration of the burn on the entity
// @Usage
// Use to set an entity on fire.
// - burn <player> duration:10s
// - narrate 'You are on fire!'
// @Usage
// Use to cancel fire on entities.
// - burn <player.location.find.living_entities.within[10]> duration:0
// - narrate 'You have cast a spell of reduce burn!'
// -->
registerCoreMember(BurnCommand.class,
"BURN", "burn [<entity>|...] (duration:<value>)", 1);
// <--[command]
// @Name Cast, Potion
// @Usage cast [<effect>] (remove) (duration:<value>) (power:<#>) (<entity>|...)
// @Required 1
// @Stable Stable
// @Short Casts a potion effect to a list of entities.
// @Author aufdemrand, Jeebiss, Morphan1
// @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.
// @Tags
// <e@entity.has_effect[<effect>]> will return true if the entity has an effect.
// @Usage
// Use to apply an effect to an entity
// - potion jump <player> d:120 p:3
// - narrate "You have been given the temporary ability to jump like a kangaroo."
// @Usage
// Use to remove an effect from an entity
// - if <p@Player.has_effect[jump]> {
// - potion jump remove <player>
// }
//
// -->
registerCoreMember(CastCommand.class,
"CAST, POTION", "cast [<effect>] (remove) (duration:<value>) (power:<#>) (<entity>|...)", 1);
// <--[command]
// @Name Chat
// @Usage chat ["<text>"] (targets:<entity>|...)
// @Required 1
// @Stable stable
// @Short Causes the NPC to send a chat message to nearby players.
// @Author aufdemrand
// @Description
// Chat uses a NPCs SpeechController provided by Citizens2, 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 the NPC chat to a different target/targets.
//
// Chat from a NPC is formatted by the settings present in Citizens' 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 desireable,
// it is often times recommended to instead use the 'narrate' command. Alternatively, on a server-wide scale,
// the configuration node for the 'max range' can be set to 0, however this is discouraged.
// @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.living_entities.within[6]> {
// - if <%value%.is_player> && <%value%.flag[clan_initiate]>
// flag <npc> talk_targets:->:%value%
// }
// - chat targets:<npc.flag[talk_targets].as_list> "Welcome, initiate!"
// -->
registerCoreMember(ChatCommand.class,
"CHAT", "chat [\"<text>\"] (targets:<entity>|...)", 1);
// <--[command]
// @Name ChunkLoad
// @Usage chunkload ({add}/remove/removeall) [<location>] (duration:<value>)
// @Required 1
// @Stable stable
// @Short Keeps a chunk actively loaded and allowing NPC activity.
// @Author spaceemotion, mcmonkey
// @Description
// Todo
// @Tags
// Todo
// @Usage
// Todo
// -->
registerCoreMember(ChunkLoadCommand.class,
"CHUNKLOAD", "chunkload ({add}/remove/removeall) [<location>] (duration:<value>)", 1);
// <--[command]
// @Name Compass
// @Usage compass [<location>]
// @Required 1
// @Stable stable
// @Short Redirects the player's compass to target the given location.
// @Author mcmonkey
// @Description
// Todo
// @Tags
// <p@player.compass.target>
// @Usage
// Todo
// -->
registerCoreMember(CompassCommand.class,
"COMPASS", "compass [<location>]", 1);
// <--[command]
// @Name Cooldown
// @Usage cooldown [<duration>] (global) (s:<script>)
// @Required 1
// @Stable stable
// @Short Temporarily disables a script-container from meeting requirements.
// @Author aufdemrand
// @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]> will return whether the script is cooled down
// <s@script_name.cooldown> will return the duration of the cooldown in progress.
// <s@requirements.check> will also check script cooldown, as well as any requirements.
// @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
// @Usage copyblock [location:<location>] [to:<location>]
// @Required 1
// @Stable unstable
// @Short Copies a block to another location, keeping all metadata.
// @Author aufdemrand, David Cernat
// @Description
// Todo
// @Tags
// <l@location.block. * >
// @Usage
// Todo
// -->
registerCoreMember(CopyBlockCommand.class,
"COPYBLOCK", "copyblock [location:<location>] [to:<location>]", 1);
// <--[command]
// @Name CreateWorld
// @Usage createworld [<name>] (g:<generator>)
// @Required 1
// @Stable unstable
// @Short Creates a new world
// @Author Todo
// @Description
// Todo
// @Tags
// <server.list_worlds>
// @Usage
// Todo
// -->
registerCoreMember(CreateWorldCommand.class,
"CREATEWORLD", "createworld [<name>] (g:<generator>)", 1);
// <--[command]
// @Name Define
// @Usage define [<id>] [<value>]
// @Required 2
// @Stable stable
// @Short Creates a temporary variable inside a script queue.
// @Author aufdemrand
// @Description
// Definitions are queue-level (or script-level) 'variables' that can be used throughout a script, once
// defined, by using %'s around the definition id/name. Definitions are only valid on the current queue and are
// not transferred to any new queues constructed within the script, such as a 'run' command, without explicitly
// specifying to do so.
//
// Definitions are lighter and faster than creating a temporary flag, but unlike flags, are only a single entry,
// that is, you can't add or remove from the definition, but you can re-create it if you wish to specify a new
// value. Definitions are also automatically destroyed when the queue is completed, so there is no worry for
// leaving unused data hanging around.
//
// Definitions are also resolved before replaceable tags, meaning you can use them within tags, even as an
// attribute. ie. <%player%.name>
// @Usage
// Use to make complex tags look less complex, and scripts more readable.
// - narrate 'You invoke your power of notice...'
// - define range '<player.flag[range_level].mul[3]>'
// - define blocks '<player.flag[noticeable_blocks>'
// - narrate '[NOTICE] You have noticed <player.location.find.blocks[%blocks%].within[%range].size>
// blocks in the area that may be of interest.'
// @Usage
// Use to keep the value of a replaceable tag that you might use many times within a single script. Definitions
// can be faster and cleaner than reusing a replaceable tag over and over.
// - define arg1 <c.args.get[1]>
// - if %arg1% == hello narrate 'Hello!'
// - if %arg1% == goodbye narrate 'Goodbye!'
// @Usage
// Use to pass some important information (arguments) on to another queue.
// - run 'new_task' d:hello|world
// 'new_task' now has some definitions, %1% and %2%, that contains the contents specified, 'hello' and 'world'.
// -->
registerCoreMember(DefineCommand.class,
"DEFINE", "define [<id>] [<value>]", 2);
// <--[command]
// @Name Determine
// @Usage determine [<value>]
// @Required 1
// @Stable stable
// @Short Sets the outcome of an event.
// @Author aufdemrand
// @Description
// Todo
// @Tags
// Todo
// @Usage
// Todo
// -->
registerCoreMember(DetermineCommand.class,
"DETERMINE", "determine [<value>]", 1);
// <--[command]
// @Name Disengage
// @Usage disengage (npc:<npc>)
// @Required 0
// @Stable stable
// @Short Enables a NPCs triggers that have been temporarily disabled by the engage command.
// @Author aufdemrand
// @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.
// @Usage
// Use to reenable a NPC's triggers, disabled via 'engage'.
// - engage
// - chat 'Be right there!'
// - walkto <player.location>
// - wait 5s
// - disengage
// -->
registerCoreMember(DisengageCommand.class,
"DISENGAGE", "disengage (npc:<npc>)", 0);
// <--[command]
// @Name DisplayItem
// @Usage displayitem [<item>] [<location>] (duration:<value>)
// @Required 2
// @Stable unstable
// @Short Makes a non-touchable item spawn for players to view.
// @Author aufdemrand, mcmonkey
// @Description
// Todo
// @Tags
// Todo
// @Usage
// Todo
// -->
registerCoreMember(DisplayItemCommand.class,
"DISPLAYITEM", "displayitem [<item>] [<location>] (duration:<value>)", 2);
// <--[command]
// @Name Drop
// @Usage drop [<item>/<entity_type>/xp] [<location>] (qty:<#>)
// @Required 1
// @Stable stable
// @Short Drops an item, entity, or experience orb on a location.
// @Author aufdemrand
// @Description
// To drop an item, just specify a valid item object. To drop
// an entity, specify a generic entity object. Drop can also reward players
// with experience orbs by using the 'xp' argument.
//
// For all three usages, you can optionally specify an integer with 'qty:'
// prefix to drop multiple items/entities/xp.
// @Usage
// Use to drop some loot around the player.
// - drop i@gold_nugget <cu@<player.location.add[-2,-2,-2]>|<player.location.add[2,2.2]>.get_spawnable_blocks.random>
// @Usage
// Use to reward a player
// - drop xp qty:500 <player.location>
// @Usage
// Use to drop a nasty surpise (exploding TNT)
// - drop e@primed_tnt <player.location>
// -->
registerCoreMember(DropCommand.class,
"DROP", "drop [<item>/<entity_type>/xp] [<location>] (qty:<#>)", 1);
// <--[command]
// @Name Engage
// @Usage engage (<duration>) (npc:<npc>)
// @Required 0
// @Stable stable
// @Short Temporarily disables a NPCs toggled interact script-container triggers.
// @Author aufdemrand
//
// @Description
// Engaging a NPC will temporarily disable any interact script-container triggers. To reverse
// this behavior, use either the disengage command, or specify a duration in which the engage
// should timeout. Specifying an engage without a duration will render the NPC engaged until
// a disengage is used on the NPC. Engaging a NPC affects all players attempting to interact
// with the NPC.
//
// While engaged, all triggers and actions associated with triggers will not 'fire', except
// the 'on unavailable' assignment script-container action, which will fire for triggers that
// were enabled previous to the engage command.
//
// Engage can be useful when NPCs are carrying out a task that shouldn't be interrupted, or
// to provide a good way to avoid accidental 'retrigger'.
//
// @See Disengage Command
//
// @Tags
// <n@npc.engaged> will return true if the NPC is currently engaged, false otherwise.
//
// @Usage
// Use to make a NPC appear 'busy'.
// - engage
// - chat 'Give me a few minutes while I mix you a potion!'
// - walkto <npc.anchor[mixing_station]>
// - wait 10s
// - walkto <npc.anchor[service_station]>
// - chat 'Here you go!'
// - give potion <player>
// - disengage
//
// @Usage
// Use to avoid 'retrigger'.
// - engage 5s
// - take quest_item
// - flag player finished_quests:->:super_quest
//
// -->
registerCoreMember(EngageCommand.class,
"ENGAGE", "engage (<duration>) (npc:<npc>)", 0);
// <--[command]
// @Name Engrave
// @Usage engrave (set/remove)
// @Required 0
// @Stable unstable
// @Short Locks an item to a player *does not work currently*
// @Author Todo
// @Description
// Todo
// @Tags
// Todo
// @Usage
// Todo
// -->
registerCoreMember(EngraveCommand.class,
"ENGRAVE", "engrave (set/remove)", 0);
// <--[command]
// @Name Equip
// @Usage equip [<entity>|...] (hand:<item>) (head:<item>) (chest:<item>) (legs:<item>) (boots:<item>)
// @Required 1
// @Stable stable
// @Short Equips items and armor on a list of entities.
// @Author Todo
// @Description
// Todo
// @Tags
// <e@entity.equipment>
// @Usage
// Todo
// -->
registerCoreMember(EquipCommand.class,
"EQUIP", "equip [<entity>|...] (hand:<item>) (head:<item>) (chest:<item>) (legs:<item>) (boots:<item>)", 1);
// <--[command]
// @Name Execute
// @Usage execute [as_player/as_op/as_npc/as_server] [<Bukkit command>]
// @Required 2
// @Stable stable
// @Short Executes an arbitrary server command as if the player, NPC, or server typed it in.
// @Author Todo
// @Description
// Todo
// @Tags
// Todo
// @Usage
// Todo
// -->
registerCoreMember(ExecuteCommand.class,
"EXECUTE", "execute [as_player/as_op/as_npc/as_server] [<Bukkit command>]", 2);
// <--[command]
// @Name Experience
// @Usage experience [{set}/give/take] (level) [<#>]
// @Required 2
// @Stable Todo
// @Short Gives or takes experience points to the player.
// @Author Todo
// @Description
// Todo
// @Tags
// <p@player.xp>
// <p@player.xp.to_next_level>
// <p@player.xp.total>
// <p@player.xp.level>
// @Usage
// Todo
// -->
registerCoreMember(ExperienceCommand.class,
"EXPERIENCE", "experience [{set}/give/take] (level) [<#>]", 2);
// <--[command]
// @Name Explode
// @Usage explode (power:<#.#>) (<location>) (fire) (breakblocks)
// @Required 0
// @Stable stable
// @Short Causes an explosion at the location.
// @Author Alain Blanquet
// @Description
// Todo
// @Tags
// Todo
// @Usage
// Todo
// -->
registerCoreMember(ExplodeCommand.class,
"EXPLODE", "explode (power:<#.#>) (<location>) (fire) (breakblocks)", 0);
// <--[command]
// @Name Fail
// @Usage fail (script:<name>)
// @Required 0
// @Stable stable
// @Short Marks a script as having failed.
// @Author aufdemrand
// @Description
// Todo
// @Tags
// Todo
// @Usage
// Todo
// -->
registerCoreMember(FailCommand.class,
"FAIL", "fail (script:<name>)", 0);
// <--[command]
// @Name Feed
// @Usage feed (amt:<#>) (target:<entity>|...)
// @Required 0
// @Stable unstable
// @Short Refills the player's food bar.
// @Author aufdemrand, Jeebiss
// @Description
// Todo
// @Tags
// <p@player.food_level>
// <p@player.food_level.formatted>
// @Usage
// Todo
// -->
registerCoreMember(FeedCommand.class,
"FEED", "feed (amt:<#>) (target:<entity>|...)", 0);
// <--[command]
// @Name Finish
// @Usage finish (script:<name>)
// @Required 0
// @Stable stable
// @Short Marks a script as having been completed successfully.
// @Author aufdemrand
// @Description
// Todo
// @Tags
// Todo
// @Usage
// Todo
// -->
registerCoreMember(FinishCommand.class,
"FINISH", "finish (script:<name>)", 0);
// <--[command]
// @Name Firework
// @Usage firework (<location>) (power:<#>) (type:<name>/random) (primary:<color>|...) (fade:<color>|...) (flicker) (trail)
// @Required 0
// @Stable Todo
// @Short Launches a firework.
// @Author David Cernat
// @Description
// Todo
// @Tags
// Todo
// @Usage
// Todo
// -->
registerCoreMember(FireworkCommand.class,
"FIREWORK", "firework (<location>) (power:<#>) (type:<name>/random) (primary:<color>|...) (fade:<color>|...) (flicker) (trail)", 0);
// <--[command]
// @Name Fish
// @Usage fish (catchfish) (stop) (<location>) (catchpercent:<#>)
// @Required 1
// @Stable Todo
// @Short Causes an NPC to begin fishing
// @Author Todo
// @Description
// Todo
// @Tags
// Todo
// @Usage
// Todo
// -->
registerCoreMember(FishCommand.class,
"FISH", "fish (catchfish) (stop) (<location>) (catchpercent:<#>)", 1);
// <--[command]
// @Name Flag
// @Usage flag ({player}/npc/global) [<name>([<#>])](:<action>)[:<value>] (duration:<value>)
// @Required 1
// @Stable stable
// @Short Sets or modifies a flag on the player, NPC, or server.
// @Author aufdemrand
// @Description
// Todo
// @Tags
// <p@player.flag[<flag>]>
// <n@npc.flag[<flag>]>
// <global.flag[<flag>]>
// @Usage
// Todo
// -->
registerCoreMember(FlagCommand.class,
"FLAG", "flag ({player}/npc/global) [<name>([<#>])](:<action>)[:<value>] (duration:<value>)", 1);
// <--[command]
// @Name Fly
// @Usage fly (cancel) [<entity>|...] (controller:<player>) (origin:<location>) (destinations:<location>|...) (speed:<#.#>) (rotationthreshold:<#.#>)
// @Required 1
// @Stable stable
// @Short Make an entity fly where its controller is looking or fly to waypoints.
// @Author David Cernat
// @Description
// Todo
// @Tags
// Todo
// @Usage
// Todo
// -->
registerCoreMember(FlyCommand.class,
"FLY", "fly (cancel) [<entity>|...] (controller:<player>) (origin:<location>) (destinations:<location>|...) (speed:<#.#>) (rotationthreshold:<#.#>)", 1);
// <--[command]
// @Name Follow
// @Usage follow (stop) (lead:<#.#>) (target:<entity>)
// @Required 0
// @Stable unstable
// @Short Causes the NPC to follow a target (Currently experiencing bugs with lead: )
// @Author aufdemrand
// @Description
// Todo
// @Tags
// Todo
// @Usage
// Todo
// -->
registerCoreMember(FollowCommand.class,
"FOLLOW", "follow (stop) (lead:<#.#>) (target:<entity>)", 0);
// <--[command]
// @Name ForEach
// @Usage foreach [<object>|...] [<commands>]
// @Required 2
// @Stable stable
// @Short Loops through a dList, running a set of commands for each item.
// @Author Morphan1, mcmonkey
// @Description
// Loops through a dList of any type. For each item in the dList, the specified commands will be ran for
// that list entry. To call the value of the entry while in the loop, you can use %value%.
// @Usage
// Use to run commands for 'each entry' in a list of objects/elements.
// - foreach li@e@123|n@424|p@BobBarker {
// - announce "There's something at <%value%.location>!"
// }
// @Usage
// Use to iterate through entries in any tag that returns a list
// - foreach <server.list_online_players> {
// - narrate "Thanks for coming to our server! Here's a bonus $50.00!"
// - give %value% money qty:50
// }
// -->
registerCoreMember(ForEachCommand.class,
"FOREACH", "foreach [<object>|...] [<commands>]", 2);
// <--[command]
// @Name Give
// @Usage give [money/<item>|...] (qty:<#>) (engrave) (to:<inventory>)
// @Required 1
// @Stable stable
// @Short Gives the player an item or money.
// @Author Todo
// @Description
// Todo
// @Tags
// <p@player.money>
// @Usage
// Todo
// -->
registerCoreMember(GiveCommand.class,
"GIVE", "give [money/<item>|...] (qty:<#>) (engrave) (to:<inventory>)", 1);
// <--[command]
// @Name Group
// @Usage group [add/remove] [<group>] (world:<name>)