-
-
Notifications
You must be signed in to change notification settings - Fork 104
/
BukkitCommandRegistry.java
2926 lines (2624 loc) · 120 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.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.AnnounceCommand;
import net.aufdemrand.denizen.scripts.commands.server.ExecuteCommand;
import net.aufdemrand.denizen.scripts.commands.server.ScoreboardCommand;
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 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_ITEM, STOP_USE_ITEM, EAT_FOOD
//
// 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
//
// 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
// TODO: Document Command Details
// @Tags
// TODO: Document Command Details
// @Usage
// TODO: Document Command Details
// -->
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
// TODO: Document Command Details
// @Tags
// <n@npc.script>
// @Usage
// TODO: Document Command Details
// -->
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 Break
// @Syntax break [<location>] (entity:<entity>) (radius:<#.#>)
// @Required 1
// @Stable unstable
// @Short Makes the NPC walk over and break a block.
// @Author aufdemrand
// @Group world
// @Description
// TODO: Document Command Details
// @Tags
// TODO: Document Command Details
// @Usage
// TODO: Document Command Details
// -->
if (Depends.citizens != null)
registerCoreMember(BreakCommand.class,
"BREAK", "break [<location>] (entity:<entity>) (radius:<#.#>)", 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
// - 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
// @Syntax 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
// @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.
// @Tags
// <e@entity.has_effect[<effect>]>
// @Usage
// Use to apply an effect to an entity
// - cast 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 <player.has_effect[jump]> {
// - cast jump remove <player>
// }
//
// -->
registerCoreMember(CastCommand.class,
"CAST, POTION", "cast [<effect>] (remove) (duration:<value>) (power:<#>) (<entity>|...)", 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.living_entities.within[6]> {
// - if <def[value].is_player> && <def[value].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
// TODO: Document Command Details
// @Tags
// TODO: Document Command Details
// @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 any chunks.
// - chunkload removeall
// -->
registerCoreMember(ChunkLoadCommand.class,
"CHUNKLOAD", "chunkload ({add}/remove/removeall) [<chunk>] (duration:<value>)", 1);
// <--[command]
// @Name Compass
// @Syntax compass [<location>]
// @Required 1
// @Stable stable
// @Short Redirects the player's compass to target the given location.
// @Author mcmonkey
// @Group player
// @Description
// TODO: Document Command Details
// @Tags
// <p@player.compass.target>
// @Usage
// TODO: Document Command Details
// -->
registerCoreMember(CompassCommand.class,
"COMPASS", "compass [<location>]", 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
// TODO: Document Command Details
// Specify an NPC to copy the NPC.
// @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>)
// @Required 1
// @Stable unstable
// @Short Creates a new world
// @Author aufdemrand, mcmonkey
// @Group world
// @Description
// TODO: Document Command Details
// @Tags
// <server.list_worlds>
// @Usage
// TODO: Document Command Details
// -->
registerCoreMember(CreateWorldCommand.class,
"CREATEWORLD", "createworld [<name>] (g:<generator>) (worldtype:<type>)", 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 (npc:<npc>)
// @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 (npc:<npc>)", 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
// TODO: Document Command Details
// @Tags
// TODO: Document Command Details
// <entry[saveName].dropped> returns a dEntity of the spawned item.
// @Usage
// TODO: Document Command Details
// -->
registerCoreMember(DisplayItemCommand.class,
"DISPLAYITEM", "displayitem [<item>] [<location>] (duration:<value>)", 2);
// <--[command]
// @Name Drop
// @Syntax drop [<entity_type>/xp/<item>|...] (<location>) (qty:<#>) (speed:<#.#>)
// @Required 1
// @Stable stable
// @Short Drops an item, entity, or experience orb on a location.
// @Author aufdemrand
// @Group world
// @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.
// For items, you can add 'speed:' to modify the launch velocity.
// @Tags
// <entry[saveName].dropped_entities> returns a list of entities that were dropped.
// @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 surprise (exploding TNT)
// - drop e@primed_tnt <player.location>
// -->
registerCoreMember(DropCommand.class,
"DROP", "drop [<entity_type>/xp/<item>|...] (<location>) (qty:<#>) (speed:<#.#>)", 1);
// <--[command]
// @Name Engage
// @Syntax engage (<duration>) (npc:<npc>)
// @Required 0
// @Stable stable
// @Short Temporarily disables a NPCs toggled interact script-container triggers.
// @Author aufdemrand
// @Group npc
//
// @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 <@link command Disengage>
//
// @Tags
// <n@npc.is_engaged>
//
// @Usage
// Use to make a NPC appear 'busy'.
// - engage
// - chat 'Give me a few minutes while I mix you a potion!'
// - walk <npc.anchor[mixing_station]>
// - wait 10s
// - walk <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
//
// -->
if (Depends.citizens != null)
registerCoreMember(EngageCommand.class,
"ENGAGE", "engage (<duration>) (npc:<npc>)", 0);
// <--[command]
// @Name Equip
// @Syntax 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 David Cernat
// @Group entity
// @Description
// TODO: Document Command Details
// @Tags
// <e@entity.equipment>
// @Usage
// TODO: Document Command Details
// -->
registerCoreMember(EquipCommand.class,
"EQUIP", "equip (<entity>|...) (hand:<item>) (head:<item>) (chest:<item>) (legs:<item>) (boots:<item>)", 1);
// <--[command]
// @Name Event
// @Syntax event [<event name>|...] (context:<name>|<object>|...)
// @Required 1
// @Stable unstable
// @Short Manually fires a world event.
// @Author mcmonkey
// @Group core
// @Description
// This command will trigger a world event (an event within a 'world' type script) exactly the same
// as if an actual serverside event had caused it.
// You can specify as many event names as you want in the list, they will all be fired. It will also automatically
// fire a duplicate of each event name with object identifiers (eg 'i@', see <@link language dobject>) removed.
// The script's linked player and NPC will automatically be sent through to the event.
// To add context information (tags like <context.location>) to the event, 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
// <server.has_event[<event_name>]>
// <server.get_event_handlers[<event_name>]>
// <entry[saveName].determinations> returns a list of the determined values (if any) from the event.
// @Usage
// Use to trigger a custom event
// - event "player triggers custom event"
// @Usage
// Use to trigger multiple custom events with context
// - event "player triggers custom event|player causes event" context:event|custom|npc|<player.selected_npc>
// @Usage
// TODO: Document command details
// -->
registerCoreMember(EventCommand.class,
"EVENT", "event [<event name>|...] (context:<name>|<object>|...)", 1);
// <--[command]
// @Name Execute
// @Syntax execute [as_player/as_op/as_npc/as_server] [<Bukkit command>] (silent)
// @Required 2
// @Stable stable
// @Short Executes an arbitrary server command as if the player, NPC, or server typed it in.
// @Author aufdemrand
// @Group server
// @Description
// TODO: Document Command Details
// @Tags
// <entry[saveName].output> returns the output to an as_server sender.
// @Usage
// TODO: Document Command Details
// -->
registerCoreMember(ExecuteCommand.class,
"EXECUTE", "execute [as_player/as_op/as_npc/as_server] [<Bukkit command>] (silent)", 2);
// <--[command]
// @Name Experience
// @Syntax experience [{set}/give/take] (level) [<#>]
// @Required 2
// @Stable TODO: Document Command Details
// @Short Gives or takes experience points to the player.
// @Author aufdemrand
// @Group player
// @Description
// TODO: Document Command Details
// @Tags
// <p@player.xp>
// <p@player.xp.to_next_level>
// <p@player.xp.total>
// <p@player.xp.level>
// @Usage
// TODO: Document Command Details
// -->
registerCoreMember(ExperienceCommand.class,
"EXPERIENCE", "experience [{set}/give/take] (level) [<#>]", 2);
// <--[command]
// @Name Explode
// @Syntax explode (power:<#.#>) (<location>) (fire) (breakblocks)
// @Required 0
// @Stable stable
// @Short Causes an explosion at the location.
// @Author Alain Blanquet
// @Group world
// @Description
// TODO: Document Command Details
// Default power: 1
// Default location: npc.location, or if no NPC link, player.location.
// It is highly recommended you specify a location to be safe.
// @Tags
// TODO: Document Command Details
// @Usage
// TODO: Document Command Details
// -->
registerCoreMember(ExplodeCommand.class,
"EXPLODE", "explode (power:<#.#>) (<location>) (fire) (breakblocks)", 0);
// <--[command]
// @Name Fail
// @Syntax fail (script:<name>)
// @Required 0
// @Stable stable
// @deprecated This command is outdated, use flags instead!
// @Short Marks a script as having failed.
// @Author aufdemrand
// @Group core
// @Description
// TODO: Document Command Details
// @Tags
// TODO: Document Command Details
// @Usage
// TODO: Document Command Details
// -->
registerCoreMember(FailCommand.class,
"FAIL", "fail (script:<name>)", 0);
// <--[command]
// @Name Feed
// @Syntax feed (amt:<#>) (target:<entity>|...)
// @Required 0
// @Stable unstable
// @Short Refills the player's food bar.
// @Author aufdemrand, Jeebiss
// @Group entity
// @Description
// TODO: Document Command Details
// @Tags
// <p@player.food_level>
// <p@player.food_level.formatted>
// @Usage
// TODO: Document Command Details
// -->
registerCoreMember(FeedCommand.class,
"FEED", "feed (amt:<#>) (target:<entity>|...)", 0);
// <--[command]
// @Name Finish
// @Syntax finish (script:<name>)
// @Required 0
// @Stable stable
// @deprecated This command is outdated, use flags instead!
// @Short Marks a script as having been completed successfully.
// @Author aufdemrand
// @Group core
// @Description
// TODO: Document Command Details
// @Tags
// TODO: Document Command Details
// @Usage
// TODO: Document Command Details
// -->
registerCoreMember(FinishCommand.class,
"FINISH", "finish (script:<name>)", 0);
// <--[command]
// @Name Firework
// @Syntax firework (<location>) (power:<#>) (<type>/random) (primary:<color>|...) (fade:<color>|...) (flicker) (trail)
// @Required 0
// @Stable stable
// @Short Launches a firework with specific coloring
// @Author David Cernat
// @Group world
// @Description
// TODO: Document Command Details
// @Tags
// TODO: Document Command Details
// @Usage
// TODO: Document Command Details
// -->
registerCoreMember(FireworkCommand.class,
"FIREWORK", "firework (<location>) (power:<#>) (<type>/random) (primary:<color>|...) (fade:<color>|...) (flicker) (trail)", 0);
// <--[command]
// @Name Fish
// @Syntax fish [<location>] (catch:{none}/default/junk/treasure/fish) (stop) (chance:<#>)
// @Required 1
// @Stable stable
// @Short Causes an NPC to begin fishing around a specified location.
// @Author Jeebiss, Morphan1
// @Group npc
// @Description
// TODO: Document Command Details