[{"data":1,"prerenderedAt":1141},["ShallowReactive",2],{"docs-navigation:\u002Fdocs\u002Fmodules\u002Fvital-commands\u002Fcommands":3,"docs-page-estimated-read-time:\u002Fdocs\u002Fmodules\u002Fvital-commands\u002Fcommands":399,"docs-page:\u002Fdocs\u002Fmodules\u002Fvital-commands\u002Fcommands":400},[4,9,41,69,282],{"title":5,"path":6,"stem":7,"icon":8},"Welcome to the Vital docs","\u002Fdocs\u002Fabout","docs\u002F1.about","i-lucide-info",{"title":10,"path":11,"stem":12,"children":13,"icon":40},"Getting started","\u002Fdocs\u002Fgetting-started","docs\u002F2.getting-started\u002F1.index",[14,16,35],{"title":15,"path":11,"stem":12,"icon":8},"What is Vital?",{"title":17,"icon":18,"path":19,"stem":20,"children":21,"page":34},"Installation","i-lucide-download","\u002Fdocs\u002Fgetting-started\u002Finstallation","docs\u002F2.getting-started\u002F1.installation",[22,26,30],{"title":23,"path":24,"stem":25},"Using a starter project (~5 minutes)","\u002Fdocs\u002Fgetting-started\u002Finstallation\u002Fstarter","docs\u002F2.getting-started\u002F1.installation\u002F2.starter",{"title":27,"path":28,"stem":29},"Manual configuration (~7-8 minutes)","\u002Fdocs\u002Fgetting-started\u002Finstallation\u002Fmanual","docs\u002F2.getting-started\u002F1.installation\u002F3.manual",{"title":31,"path":32,"stem":33},"Using the initializer (~2-3 minutes)","\u002Fdocs\u002Fgetting-started\u002Finstallation\u002Finitializer","docs\u002F2.getting-started\u002F1.installation\u002F4.initializer",false,{"title":36,"path":37,"stem":38,"icon":39},"Main class","\u002Fdocs\u002Fgetting-started\u002Fmain-plugin-class","docs\u002F2.getting-started\u002F2.main-plugin-class","i-lucide-play","i-lucide-circle-play",{"title":42,"path":43,"stem":44,"children":45,"icon":68},"Conventions","\u002Fdocs\u002Fconventions","docs\u002F3.conventions\u002F1.index",[46,48,52,56,60,64],{"title":47,"path":43,"stem":44,"icon":8},"About",{"title":49,"path":50,"stem":51},"Spring","\u002Fdocs\u002Fconventions\u002Fspring","docs\u002F3.conventions\u002F2.spring",{"title":53,"path":54,"stem":55},"Platforms","\u002Fdocs\u002Fconventions\u002Fplatform-implementations","docs\u002F3.conventions\u002F3.platform-implementations",{"title":57,"path":58,"stem":59},"Metadata","\u002Fdocs\u002Fconventions\u002Fmetadata","docs\u002F3.conventions\u002F4.metadata",{"title":61,"path":62,"stem":63},"Lifecycles","\u002Fdocs\u002Fconventions\u002Flifecycles","docs\u002F3.conventions\u002F5.lifecycles",{"title":65,"path":66,"stem":67},"(Optional) Advanced class loading","\u002Fdocs\u002Fconventions\u002Fadvanced-classloading","docs\u002F3.conventions\u002F6.advanced-classloading","i-lucide-cog",{"title":70,"path":71,"stem":72,"children":73,"icon":281},"Modules","\u002Fdocs\u002Fmodules","docs\u002F4.modules\u002F1.index",[74,76,100,106,112,126,136,150,164,178,188,224,234,248,257,275],{"title":75,"path":71,"stem":72,"icon":8},"What are modules?",{"title":77,"path":78,"stem":79,"children":80,"icon":99},"vital-core","\u002Fdocs\u002Fmodules\u002Fvital-core","docs\u002F4.modules\u002F2.vital-core\u002F1.index",[81,83,87,91,95],{"title":82,"path":78,"stem":79,"icon":8},"About this module",{"title":84,"path":85,"stem":86},"Configuration","\u002Fdocs\u002Fmodules\u002Fvital-core\u002Fconfiguration","docs\u002F4.modules\u002F2.vital-core\u002F2.configuration",{"title":88,"path":89,"stem":90},"Listeners","\u002Fdocs\u002Fmodules\u002Fvital-core\u002Flisteners","docs\u002F4.modules\u002F2.vital-core\u002F3.listeners",{"title":92,"path":93,"stem":94},"Conditional beans","\u002Fdocs\u002Fmodules\u002Fvital-core\u002Fconditional-beans","docs\u002F4.modules\u002F2.vital-core\u002F4.conditional-beans",{"title":96,"path":97,"stem":98},"Repositories","\u002Fdocs\u002Fmodules\u002Fvital-core\u002Frepositories","docs\u002F4.modules\u002F2.vital-core\u002F5.repositories","",{"title":101,"path":102,"stem":103,"children":104,"icon":99},"vital-cloudnet4-bridge","\u002Fdocs\u002Fmodules\u002Fvital-cloudnet4-bridge","docs\u002F4.modules\u002Fvital-cloudnet4-bridge\u002F1.index",[105],{"title":82,"path":102,"stem":103,"icon":8},{"title":107,"path":108,"stem":109,"children":110,"icon":99},"vital-cloudnet4-driver","\u002Fdocs\u002Fmodules\u002Fvital-cloudnet4-driver","docs\u002F4.modules\u002Fvital-cloudnet4-driver\u002F1.index",[111],{"title":82,"path":108,"stem":109,"icon":8},{"title":113,"path":114,"stem":115,"children":116,"icon":99},"vital-commands","\u002Fdocs\u002Fmodules\u002Fvital-commands","docs\u002F4.modules\u002Fvital-commands\u002F1.index",[117,118,122],{"title":82,"path":114,"stem":115,"icon":8},{"title":119,"path":120,"stem":121},"Commands","\u002Fdocs\u002Fmodules\u002Fvital-commands\u002Fcommands","docs\u002F4.modules\u002Fvital-commands\u002Fcommands",{"title":123,"path":124,"stem":125},"Exception handling","\u002Fdocs\u002Fmodules\u002Fvital-commands\u002Fexception-handling","docs\u002F4.modules\u002Fvital-commands\u002Fexception-handling",{"title":127,"path":128,"stem":129,"children":130,"icon":99},"vital-configs","\u002Fdocs\u002Fmodules\u002Fvital-configs","docs\u002F4.modules\u002Fvital-configs\u002F1.index",[131,132],{"title":82,"path":128,"stem":129,"icon":8},{"title":133,"path":134,"stem":135},"Configs","\u002Fdocs\u002Fmodules\u002Fvital-configs\u002Fconfigs","docs\u002F4.modules\u002Fvital-configs\u002F2.configs",{"title":137,"path":138,"stem":139,"children":140,"icon":99},"vital-holograms","\u002Fdocs\u002Fmodules\u002Fvital-holograms","docs\u002F4.modules\u002Fvital-holograms\u002F1.index",[141,142,146],{"title":82,"path":138,"stem":139,"icon":8},{"title":143,"path":144,"stem":145},"Global holograms","\u002Fdocs\u002Fmodules\u002Fvital-holograms\u002Fglobal-holograms","docs\u002F4.modules\u002Fvital-holograms\u002F2.global-holograms",{"title":147,"path":148,"stem":149},"Player holograms","\u002Fdocs\u002Fmodules\u002Fvital-holograms\u002Fplayer-holograms","docs\u002F4.modules\u002Fvital-holograms\u002F3.player-holograms",{"title":151,"path":152,"stem":153,"children":154,"icon":99},"vital-inventories","\u002Fdocs\u002Fmodules\u002Fvital-inventories","docs\u002F4.modules\u002Fvital-inventories\u002F1.index",[155,156,160],{"title":82,"path":152,"stem":153,"icon":8},{"title":157,"path":158,"stem":159},"Normal inventories","\u002Fdocs\u002Fmodules\u002Fvital-inventories\u002Fnormal-inventories","docs\u002F4.modules\u002Fvital-inventories\u002F2.normal-inventories",{"title":161,"path":162,"stem":163},"Paged inventories","\u002Fdocs\u002Fmodules\u002Fvital-inventories\u002Fpaged-inventories","docs\u002F4.modules\u002Fvital-inventories\u002F3.paged-inventories",{"title":165,"path":166,"stem":167,"children":168,"icon":99},"vital-items","\u002Fdocs\u002Fmodules\u002Fvital-items","docs\u002F4.modules\u002Fvital-items\u002F1.index",[169,170,174],{"title":82,"path":166,"stem":167,"icon":8},{"title":171,"path":172,"stem":173},"Items","\u002Fdocs\u002Fmodules\u002Fvital-items\u002Fitems","docs\u002F4.modules\u002Fvital-items\u002F2.items",{"title":175,"path":176,"stem":177},"Item builders","\u002Fdocs\u002Fmodules\u002Fvital-items\u002Fitem-builders","docs\u002F4.modules\u002Fvital-items\u002F3.item-builders",{"title":179,"path":180,"stem":181,"children":182,"icon":99},"vital-localization","\u002Fdocs\u002Fmodules\u002Fvital-localization","docs\u002F4.modules\u002Fvital-localization\u002F1.index",[183,184],{"title":82,"path":180,"stem":181,"icon":8},{"title":185,"path":186,"stem":187},"Localization","\u002Fdocs\u002Fmodules\u002Fvital-localization\u002Flocalization","docs\u002F4.modules\u002Fvital-localization\u002F2.localization",{"title":189,"path":190,"stem":191,"children":192,"icon":99},"vital-minigames","\u002Fdocs\u002Fmodules\u002Fvital-minigames","docs\u002F4.modules\u002Fvital-minigames\u002F1.index",[193,194,208],{"title":82,"path":190,"stem":191,"icon":8},{"title":195,"path":196,"stem":197,"children":198,"icon":99},"Global games","\u002Fdocs\u002Fmodules\u002Fvital-minigames\u002Fglobal-games","docs\u002F4.modules\u002Fvital-minigames\u002F2.global-games\u002F1.index",[199,200,204],{"title":47,"path":196,"stem":197,"icon":8},{"title":201,"path":202,"stem":203},"States","\u002Fdocs\u002Fmodules\u002Fvital-minigames\u002Fglobal-games\u002Fstates","docs\u002F4.modules\u002Fvital-minigames\u002F2.global-games\u002F2.states",{"title":205,"path":206,"stem":207},"Countdown states","\u002Fdocs\u002Fmodules\u002Fvital-minigames\u002Fglobal-games\u002Fcountdown-states","docs\u002F4.modules\u002Fvital-minigames\u002F2.global-games\u002F3.countdown-states",{"title":209,"path":210,"stem":211,"children":212,"icon":99},"Instanced games","\u002Fdocs\u002Fmodules\u002Fvital-minigames\u002Finstanced-games","docs\u002F4.modules\u002Fvital-minigames\u002F3.instanced-games\u002F1.index",[213,214,218,221],{"title":47,"path":210,"stem":211,"icon":8},{"title":215,"path":216,"stem":217},"Instances","\u002Fdocs\u002Fmodules\u002Fvital-minigames\u002Finstanced-games\u002Finstances","docs\u002F4.modules\u002Fvital-minigames\u002F3.instanced-games\u002F2.instances",{"title":201,"path":219,"stem":220},"\u002Fdocs\u002Fmodules\u002Fvital-minigames\u002Finstanced-games\u002Fstates","docs\u002F4.modules\u002Fvital-minigames\u002F3.instanced-games\u002F3.states",{"title":205,"path":222,"stem":223},"\u002Fdocs\u002Fmodules\u002Fvital-minigames\u002Finstanced-games\u002Fcountdown-states","docs\u002F4.modules\u002Fvital-minigames\u002F3.instanced-games\u002F4.countdown-states",{"title":225,"path":226,"stem":227,"children":228,"icon":99},"vital-players","\u002Fdocs\u002Fmodules\u002Fvital-players","docs\u002F4.modules\u002Fvital-players\u002F1.index",[229,230],{"title":82,"path":226,"stem":227,"icon":8},{"title":231,"path":232,"stem":233},"Players","\u002Fdocs\u002Fmodules\u002Fvital-players\u002Fplayers","docs\u002F4.modules\u002Fvital-players\u002F2.players",{"title":235,"path":236,"stem":237,"children":238,"icon":99},"vital-scoreboards","\u002Fdocs\u002Fmodules\u002Fvital-scoreboards","docs\u002F4.modules\u002Fvital-scoreboards\u002F1.index",[239,240,244],{"title":82,"path":236,"stem":237,"icon":8},{"title":241,"path":242,"stem":243},"Global scoreboards","\u002Fdocs\u002Fmodules\u002Fvital-scoreboards\u002Fglobal-scoreboards","docs\u002F4.modules\u002Fvital-scoreboards\u002Fglobal-scoreboards",{"title":245,"path":246,"stem":247},"Player scoreboards","\u002Fdocs\u002Fmodules\u002Fvital-scoreboards\u002Fplayer-scoreboards","docs\u002F4.modules\u002Fvital-scoreboards\u002Fplayer-scoreboards",{"title":249,"path":250,"stem":251,"children":252,"icon":99},"vital-statistics","\u002Fdocs\u002Fmodules\u002Fvital-statistics","docs\u002F4.modules\u002Fvital-statistics\u002F1.index",[253,254],{"title":82,"path":250,"stem":251,"icon":8},{"title":84,"path":255,"stem":256},"\u002Fdocs\u002Fmodules\u002Fvital-statistics\u002Fconfiguration","docs\u002F4.modules\u002Fvital-statistics\u002F2.configuration",{"title":258,"path":259,"stem":260,"children":261,"icon":99},"vital-tasks","\u002Fdocs\u002Fmodules\u002Fvital-tasks","docs\u002F4.modules\u002Fvital-tasks\u002F1.index",[262,263,267,271],{"title":82,"path":259,"stem":260,"icon":8},{"title":264,"path":265,"stem":266},"Repeatable tasks","\u002Fdocs\u002Fmodules\u002Fvital-tasks\u002Frepeatable-tasks","docs\u002F4.modules\u002Fvital-tasks\u002F2.repeatable-tasks",{"title":268,"path":269,"stem":270},"Countdown tasks","\u002Fdocs\u002Fmodules\u002Fvital-tasks\u002Fcountdown-tasks","docs\u002F4.modules\u002Fvital-tasks\u002F3.countdown-tasks",{"title":272,"path":273,"stem":274},"Scheduled tasks","\u002Fdocs\u002Fmodules\u002Fvital-tasks\u002Fscheduled-tasks","docs\u002F4.modules\u002Fvital-tasks\u002F4.scheduled-tasks",{"title":276,"path":277,"stem":278,"children":279,"icon":99},"vital-utils (Also for non Vital projects)","\u002Fdocs\u002Fmodules\u002Fvital-utils","docs\u002F4.modules\u002Fvital-utils\u002F1.index",[280],{"title":82,"path":277,"stem":278,"icon":8},"i-lucide-package",{"title":283,"path":284,"stem":285,"children":286,"icon":398},"Recipes","\u002Fdocs\u002Frecipes","docs\u002F5.recipes\u002F1.index",[287,289,301,305,317,330,341,344,368,371,384],{"title":288,"path":284,"stem":285,"icon":8},"What are recipes?",{"title":119,"path":290,"stem":291,"children":292,"page":34},"\u002Fdocs\u002Frecipes\u002Fcommands","docs\u002F5.recipes\u002Fcommands",[293,297],{"title":294,"path":295,"stem":296},"Command with arg exception handler","\u002Fdocs\u002Frecipes\u002Fcommands\u002Fcommands","docs\u002F5.recipes\u002Fcommands\u002Fcommands",{"title":298,"path":299,"stem":300},"Global command exception handler","\u002Fdocs\u002Frecipes\u002Fcommands\u002Fglobal-exception-handler","docs\u002F5.recipes\u002Fcommands\u002Fglobal-exception-handler",{"title":302,"path":303,"stem":304},"Config","\u002Fdocs\u002Frecipes\u002Fconfig","docs\u002F5.recipes\u002Fconfig",{"title":306,"path":307,"stem":308,"children":309,"page":34},"Holograms","\u002Fdocs\u002Frecipes\u002Fholograms","docs\u002F5.recipes\u002Fholograms",[310,314],{"title":311,"path":312,"stem":313},"Global hologram","\u002Fdocs\u002Frecipes\u002Fholograms\u002Fglobal-holograms","docs\u002F5.recipes\u002Fholograms\u002Fglobal-holograms",{"title":147,"path":315,"stem":316},"\u002Fdocs\u002Frecipes\u002Fholograms\u002Fplayer-holograms","docs\u002F5.recipes\u002Fholograms\u002Fplayer-holograms",{"title":318,"path":319,"stem":320,"children":321,"page":34},"Inventories","\u002Fdocs\u002Frecipes\u002Finventories","docs\u002F5.recipes\u002Finventories",[322,326],{"title":323,"path":324,"stem":325},"Normal inventory","\u002Fdocs\u002Frecipes\u002Finventories\u002Fnormal-inventory","docs\u002F5.recipes\u002Finventories\u002Fnormal-inventory",{"title":327,"path":328,"stem":329},"Paged inventory","\u002Fdocs\u002Frecipes\u002Finventories\u002Fpaged-inventory","docs\u002F5.recipes\u002Finventories\u002Fpaged-inventory",{"title":171,"path":331,"stem":332,"children":333,"page":34},"\u002Fdocs\u002Frecipes\u002Fitems","docs\u002F5.recipes\u002Fitems",[334,338],{"title":335,"path":336,"stem":337},"Interactable items","\u002Fdocs\u002Frecipes\u002Fitems\u002Finteractable-items","docs\u002F5.recipes\u002Fitems\u002Finteractable-items",{"title":175,"path":339,"stem":340},"\u002Fdocs\u002Frecipes\u002Fitems\u002Fitem-builders","docs\u002F5.recipes\u002Fitems\u002Fitem-builders",{"title":185,"path":342,"stem":343},"\u002Fdocs\u002Frecipes\u002Flocalization","docs\u002F5.recipes\u002Flocalization",{"title":345,"path":346,"stem":347,"children":348,"page":34},"Minigames","\u002Fdocs\u002Frecipes\u002Fminigames","docs\u002F5.recipes\u002Fminigames",[349,353,357,361,365],{"title":350,"path":351,"stem":352},"Global minigame countdown states","\u002Fdocs\u002Frecipes\u002Fminigames\u002Fglobal-countdown-states","docs\u002F5.recipes\u002Fminigames\u002Fglobal-countdown-states",{"title":354,"path":355,"stem":356},"Global minigame states","\u002Fdocs\u002Frecipes\u002Fminigames\u002Fglobal-states","docs\u002F5.recipes\u002Fminigames\u002Fglobal-states",{"title":358,"path":359,"stem":360},"Instance countdown states","\u002Fdocs\u002Frecipes\u002Fminigames\u002Finstance-countdown-states","docs\u002F5.recipes\u002Fminigames\u002Finstance-countdown-states",{"title":362,"path":363,"stem":364},"Instance states","\u002Fdocs\u002Frecipes\u002Fminigames\u002Finstance-states","docs\u002F5.recipes\u002Fminigames\u002Finstance-states",{"title":215,"path":366,"stem":367},"\u002Fdocs\u002Frecipes\u002Fminigames\u002Finstances","docs\u002F5.recipes\u002Fminigames\u002Finstances",{"title":231,"path":369,"stem":370},"\u002Fdocs\u002Frecipes\u002Fplayers","docs\u002F5.recipes\u002Fplayers",{"title":372,"path":373,"stem":374,"children":375,"page":34},"Scoreboards","\u002Fdocs\u002Frecipes\u002Fscoreboards","docs\u002F5.recipes\u002Fscoreboards",[376,380],{"title":377,"path":378,"stem":379},"Global scoreboard","\u002Fdocs\u002Frecipes\u002Fscoreboards\u002Fglobal-scoreboard","docs\u002F5.recipes\u002Fscoreboards\u002Fglobal-scoreboard",{"title":381,"path":382,"stem":383},"Player scoreboard","\u002Fdocs\u002Frecipes\u002Fscoreboards\u002Fplayer-scoreboard","docs\u002F5.recipes\u002Fscoreboards\u002Fplayer-scoreboard",{"title":385,"path":386,"stem":387,"children":388,"page":34},"Tasks","\u002Fdocs\u002Frecipes\u002Ftasks","docs\u002F5.recipes\u002Ftasks",[389,392,395],{"title":268,"path":390,"stem":391},"\u002Fdocs\u002Frecipes\u002Ftasks\u002Fcountdown-tasks","docs\u002F5.recipes\u002Ftasks\u002Fcountdown-tasks",{"title":264,"path":393,"stem":394},"\u002Fdocs\u002Frecipes\u002Ftasks\u002Frepeatable-tasks","docs\u002F5.recipes\u002Ftasks\u002Frepeatable-tasks",{"title":272,"path":396,"stem":397},"\u002Fdocs\u002Frecipes\u002Ftasks\u002Fscheduled-tasks","docs\u002F5.recipes\u002Ftasks\u002Fscheduled-tasks","i-lucide-cooking-pot",5,{"id":401,"title":119,"body":402,"description":1134,"extension":1135,"meta":1136,"navigation":1137,"path":120,"rawbody":1138,"seo":1139,"stem":121,"__hash__":1140},"docs\u002Fdocs\u002F4.modules\u002Fvital-commands\u002Fcommands.md",{"type":403,"value":404,"toc":1128},"minimark",[405,409,426,429,509,514,526,651,665,679,698,701,762,766,776,891,906,919,932,936,943,1014,1032,1046,1049,1124],[406,407,119],"h1",{"id":408},"commands",[410,411,412,413,417,418,421,422,425],"p",{},"Every command will be a class that extends ",[414,415,416],"code",{},"VitalCommand.Spigot"," and is annotated with ",[414,419,420],{},"VitalCommand.Info",".",[423,424],"br",{},"\nA command can have n-number of arg handlers; each arg handler is essentially a method executed when the command is executed with the configured argument.",[410,427,428],{},"Since Vital can determine the structure of your command by simply just looking at your class, it will automatically build tab-completions without you having to do anything!",[430,431,436],"pre",{"className":432,"code":433,"filename":434,"language":435,"meta":99,"style":99},"language-java shiki shiki-themes material-theme-lighter github-light github-dark","@VitalCommand.Info(name = \"mycommand\")\npublic class MyCommand extends VitalCommand.Spigot {\n}\n","MyCommand.java","java",[414,437,438,475,503],{"__ignoreMap":99},[439,440,443,447,450,453,457,461,465,469,472],"span",{"class":441,"line":442},"line",1,[439,444,446],{"class":445},"sP7_E","@",[439,448,420],{"class":449},"sbsja",[439,451,452],{"class":445},"(",[439,454,456],{"class":455},"sZMiF","name",[439,458,460],{"class":459},"smGrS"," =",[439,462,464],{"class":463},"sjJ54"," \"",[439,466,468],{"class":467},"s_sjI","mycommand",[439,470,471],{"class":463},"\"",[439,473,474],{"class":445},")\n",[439,476,478,481,484,488,491,494,497,500],{"class":441,"line":477},2,[439,479,480],{"class":449},"public",[439,482,483],{"class":449}," class",[439,485,487],{"class":486},"sbgvK"," MyCommand",[439,489,490],{"class":449}," extends",[439,492,493],{"class":486}," VitalCommand",[439,495,421],{"class":496},"stp6e",[439,498,499],{"class":486},"Spigot",[439,501,502],{"class":445}," {\n",[439,504,506],{"class":441,"line":505},3,[439,507,508],{"class":445},"}\n",[510,511,513],"h2",{"id":512},"arguments","Arguments",[410,515,516,517,421,520,522,523,421],{},"The following example shows a command that has an arg handler for ",[414,518,519],{},"\u002Fmycommand myarg0 myarg1",[423,521],{},"\nWhen this command is executed, Vital automatically calls the method annotated with ",[414,524,525],{},"@ArgHandler",[430,527,529],{"className":432,"code":528,"filename":434,"language":435,"meta":99,"style":99},"@VitalCommand.Info(name = \"mycommand\")\npublic class MyCommand extends VitalCommand.Spigot {\n  @ArgHandler(arg = @Arg(name = \"myarg0 myarg1\"))\n  public ReturnState onMyArg0MyArg1SomethingBlaBla(Player player) {\n    \u002F\u002F ...\n  }\n}\n",[414,530,531,551,569,606,634,640,646],{"__ignoreMap":99},[439,532,533,535,537,539,541,543,545,547,549],{"class":441,"line":442},[439,534,446],{"class":445},[439,536,420],{"class":449},[439,538,452],{"class":445},[439,540,456],{"class":455},[439,542,460],{"class":459},[439,544,464],{"class":463},[439,546,468],{"class":467},[439,548,471],{"class":463},[439,550,474],{"class":445},[439,552,553,555,557,559,561,563,565,567],{"class":441,"line":477},[439,554,480],{"class":449},[439,556,483],{"class":449},[439,558,487],{"class":486},[439,560,490],{"class":449},[439,562,493],{"class":486},[439,564,421],{"class":496},[439,566,499],{"class":486},[439,568,502],{"class":445},[439,570,571,574,577,579,582,584,587,590,592,594,596,598,601,603],{"class":441,"line":505},[439,572,573],{"class":445},"  @",[439,575,576],{"class":449},"ArgHandler",[439,578,452],{"class":445},[439,580,581],{"class":455},"arg",[439,583,460],{"class":459},[439,585,586],{"class":445}," @",[439,588,589],{"class":449},"Arg",[439,591,452],{"class":445},[439,593,456],{"class":455},[439,595,460],{"class":459},[439,597,464],{"class":463},[439,599,600],{"class":467},"myarg0 myarg1",[439,602,471],{"class":463},[439,604,605],{"class":445},"))\n",[439,607,609,612,616,620,622,625,629,632],{"class":441,"line":608},4,[439,610,611],{"class":449},"  public",[439,613,615],{"class":614},"s_bVq"," ReturnState",[439,617,619],{"class":618},"sGLFI"," onMyArg0MyArg1SomethingBlaBla",[439,621,452],{"class":445},[439,623,624],{"class":614},"Player",[439,626,628],{"class":627},"s99_P"," player",[439,630,631],{"class":445},")",[439,633,502],{"class":445},[439,635,636],{"class":441,"line":399},[439,637,639],{"class":638},"sutJx","    \u002F\u002F ...\n",[439,641,643],{"class":441,"line":642},6,[439,644,645],{"class":445},"  }\n",[439,647,649],{"class":441,"line":648},7,[439,650,508],{"class":445},[410,652,653,654,658,659,421,662,664],{},"Every arg handler ",[655,656,657],"strong",{},"MUST"," return a ",[414,660,661],{},"ReturnState",[423,663],{},"\nThis type determines the status of your command arg execution.",[410,666,667,668,671,672,674,675,678],{},"By default, this will most likely be ",[414,669,670],{},"ReturnState.SUCCESS"," for almost any of your arg handlers.",[423,673],{},"\nBut sometimes you might need to return ",[414,676,677],{},"ReturnState.NO_PERMISSION"," or something else for special use cases.",[680,681,682],"blockquote",{},[410,683,684,685,687,688,691,692,694,695,697],{},"Note that we have direct access to the player (or command sender) that executed the command.",[423,686],{},"\nUsing the ",[414,689,690],{},"@VitalCommand.Info"," annotation, you can also mark your command to only be executable by players, by default, this is turned off, and your commands can also be executed by non-players, like your server console.",[423,693],{},"\nImportant: Obviously, you cant set your parameter to a ",[414,696,624],{}," if you can also receive non-players as a sender, be careful of that when you build your commands!",[410,699,700],{},"We can also restrict specific arg handlers to players or restrict their permissions.",[430,702,704],{"className":432,"code":703,"filename":434,"language":435,"meta":99,"style":99},"@ArgHandler(arg = @Arg(name = \"myarg0 myarg1\", permission = \"myserver.mycommand.permission\", playerOnly = true))\n",[414,705,706],{"__ignoreMap":99},[439,707,708,710,712,714,716,718,720,722,724,726,728,730,732,734,737,740,742,744,747,749,751,754,756,760],{"class":441,"line":442},[439,709,446],{"class":445},[439,711,576],{"class":449},[439,713,452],{"class":445},[439,715,581],{"class":455},[439,717,460],{"class":459},[439,719,586],{"class":445},[439,721,589],{"class":449},[439,723,452],{"class":445},[439,725,456],{"class":455},[439,727,460],{"class":459},[439,729,464],{"class":463},[439,731,600],{"class":467},[439,733,471],{"class":463},[439,735,736],{"class":445},",",[439,738,739],{"class":455}," permission",[439,741,460],{"class":459},[439,743,464],{"class":463},[439,745,746],{"class":467},"myserver.mycommand.permission",[439,748,471],{"class":463},[439,750,736],{"class":445},[439,752,753],{"class":455}," playerOnly",[439,755,460],{"class":459},[439,757,759],{"class":758},"s39Yj"," true",[439,761,605],{"class":445},[510,763,765],{"id":764},"parameters","Parameters",[410,767,768,769,771,772,775],{},"Sometimes we need to get some input from a player.",[423,770],{},"\nTo do this, we can use the ",[414,773,774],{},"\u003C...>"," syntax.",[430,777,779],{"className":432,"code":778,"filename":434,"language":435,"meta":99,"style":99},"@VitalCommand.Info(name = \"mycommand\")\npublic class MyCommand extends VitalCommand.Spigot {\n  @ArgHandler(arg = @Arg(name = \"myarg0 \u003Cmyarg1>\"))\n  public ReturnState onMyArg0MyArg1SomethingBlaBla(Player player, String[] values) {\n    \u002F\u002F ...\n  }\n}\n",[414,780,781,801,819,850,879,883,887],{"__ignoreMap":99},[439,782,783,785,787,789,791,793,795,797,799],{"class":441,"line":442},[439,784,446],{"class":445},[439,786,420],{"class":449},[439,788,452],{"class":445},[439,790,456],{"class":455},[439,792,460],{"class":459},[439,794,464],{"class":463},[439,796,468],{"class":467},[439,798,471],{"class":463},[439,800,474],{"class":445},[439,802,803,805,807,809,811,813,815,817],{"class":441,"line":477},[439,804,480],{"class":449},[439,806,483],{"class":449},[439,808,487],{"class":486},[439,810,490],{"class":449},[439,812,493],{"class":486},[439,814,421],{"class":496},[439,816,499],{"class":486},[439,818,502],{"class":445},[439,820,821,823,825,827,829,831,833,835,837,839,841,843,846,848],{"class":441,"line":505},[439,822,573],{"class":445},[439,824,576],{"class":449},[439,826,452],{"class":445},[439,828,581],{"class":455},[439,830,460],{"class":459},[439,832,586],{"class":445},[439,834,589],{"class":449},[439,836,452],{"class":445},[439,838,456],{"class":455},[439,840,460],{"class":459},[439,842,464],{"class":463},[439,844,845],{"class":467},"myarg0 \u003Cmyarg1>",[439,847,471],{"class":463},[439,849,605],{"class":445},[439,851,852,854,856,858,860,862,864,866,869,872,875,877],{"class":441,"line":608},[439,853,611],{"class":449},[439,855,615],{"class":614},[439,857,619],{"class":618},[439,859,452],{"class":445},[439,861,624],{"class":614},[439,863,628],{"class":627},[439,865,736],{"class":445},[439,867,868],{"class":449}," String",[439,870,871],{"class":445},"[]",[439,873,874],{"class":627}," values",[439,876,631],{"class":445},[439,878,502],{"class":445},[439,880,881],{"class":441,"line":399},[439,882,639],{"class":638},[439,884,885],{"class":441,"line":642},[439,886,645],{"class":445},[439,888,889],{"class":441,"line":648},[439,890,508],{"class":445},[410,892,893,894,421,897,899,900,421,903,905],{},"The arg handler defined above will now be called when someone executes ",[414,895,896],{},"\u002Fmycommand myarg0 somethinghere",[423,898],{},"\nTo get the value that was input in this variable, add a new parameter to your arg handler method: ",[414,901,902],{},"String[] values",[423,904],{},"\nThis array holds all values for all variables in your command arg handler.",[410,907,908,909,912,913,915,916,421],{},"E.g., when someone executes ",[414,910,911],{},"\u002Fmycommand myarg0 hello",", the ",[414,914,902],{}," array will be ",[414,917,918],{},"[\"hello\"]",[410,920,921,922,924,925,928,929,931],{},"Note that you cannot receive values that are delimited by spaces.",[423,923],{},"\nSo this ",[414,926,927],{},"\u002Fmycommand myarg0 hello 123"," will not work.",[423,930],{},"\nFor space-delimited values, use varargs.",[510,933,935],{"id":934},"varargs","Varargs",[410,937,938,939,942],{},"To also receive values delimited by spaces, you can use the vararg syntax ",[414,940,941],{},"\u003C...>*"," in your arg handlers.",[430,944,946],{"className":432,"code":945,"filename":434,"language":435,"meta":99,"style":99},"  @ArgHandler(arg = @Arg(name = \"myarg0 \u003Cmyarg1>*\"))\n  public ReturnState onMyArg0MyArg1SomethingBlaBla(Player player, String[] values) {\n    \u002F\u002F ...\n  }\n",[414,947,948,979,1006,1010],{"__ignoreMap":99},[439,949,950,952,954,956,958,960,962,964,966,968,970,972,975,977],{"class":441,"line":442},[439,951,573],{"class":445},[439,953,576],{"class":449},[439,955,452],{"class":445},[439,957,581],{"class":455},[439,959,460],{"class":459},[439,961,586],{"class":445},[439,963,589],{"class":449},[439,965,452],{"class":445},[439,967,456],{"class":455},[439,969,460],{"class":459},[439,971,464],{"class":463},[439,973,974],{"class":467},"myarg0 \u003Cmyarg1>*",[439,976,471],{"class":463},[439,978,605],{"class":445},[439,980,981,983,985,987,989,991,994,996,998,1000,1002,1004],{"class":441,"line":477},[439,982,611],{"class":449},[439,984,615],{"class":614},[439,986,619],{"class":618},[439,988,452],{"class":445},[439,990,624],{"class":614},[439,992,628],{"class":993},"su5hD",[439,995,736],{"class":445},[439,997,868],{"class":449},[439,999,871],{"class":445},[439,1001,874],{"class":993},[439,1003,631],{"class":445},[439,1005,502],{"class":445},[439,1007,1008],{"class":441,"line":505},[439,1009,639],{"class":638},[439,1011,1012],{"class":441,"line":608},[439,1013,645],{"class":445},[410,1015,908,1016,912,1018,915,1020,421,1022,1024,1025,912,1027,915,1029,421],{},[414,1017,911],{},[414,1019,902],{},[414,1021,918],{},[423,1023],{},"\nIf someone executes ",[414,1026,927],{},[414,1028,902],{},[414,1030,1031],{},"[\"hello\", \"123\"]",[680,1033,1034],{},[410,1035,1036,1037,1039,1040,1042,1043,1045],{},"Note that varargs behave the same as they do in Java.",[423,1038],{},"\nVarargs ",[655,1041,657],{}," be the last variable in your arg handler and can only exist once.",[423,1044],{},"\nYou CANNOT have multiple varargs in a single arg handler, you can also NOT define another variable AFTER a vararg.",[510,1047,61],{"id":1048},"lifecycles",[1050,1051,1052,1066],"table",{},[1053,1054,1055],"thead",{},[1056,1057,1058,1063],"tr",{},[1059,1060,1062],"th",{"align":1061},"left","Lifecycle",[1059,1064,1065],{"align":1061},"Usage",[1067,1068,1069,1080,1094,1104,1114],"tbody",{},[1056,1070,1071,1077],{},[1072,1073,1074],"td",{"align":1061},[414,1075,1076],{},"onCommandError(CS, Arg?, Throwable)",[1072,1078,1079],{"align":1061},"Perform an action when an exception was thrown during command execution. This lifecycle is called as the last resort if any other exception handler (arg exception handler, global exception handler) cannot handle the exception that was thrown during your command.",[1056,1081,1082,1087],{},[1072,1083,1084],{"align":1061},[414,1085,1086],{},"onCommandTabComplete(CS, String)",[1072,1088,1089,1090,1093],{"align":1061},"Add your own tab-completions to the ones Vital automatically generates for you. The ",[414,1091,1092],{},"String"," passed to this lifecycle will be your command arg string name.",[1056,1095,1096,1101],{},[1072,1097,1098],{"align":1061},[414,1099,1100],{},"onCommandInvalidArgs(CS, String)",[1072,1102,1103],{"align":1061},"Perform an action when a command was executed with invalid or incomplete args.",[1056,1105,1106,1111],{},[1072,1107,1108],{"align":1061},[414,1109,1110],{},"onCommandRequiresPermission(CS, String, Arg?)",[1072,1112,1113],{"align":1061},"Perform an action when a command was executed with insufficient permissions.",[1056,1115,1116,1121],{},[1072,1117,1118],{"align":1061},[414,1119,1120],{},"onCommandRequiresPlayer(CS, String, Arg?)",[1072,1122,1123],{"align":1061},"Perform an action when a command was executed as a non-player but the command requires a player.",[1125,1126,1127],"style",{},"html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sbsja, html code.shiki .sbsja{--shiki-light:#9C3EDA;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sZMiF, html code.shiki .sZMiF{--shiki-light:#E2931D;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .smGrS, html code.shiki .smGrS{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sjJ54, html code.shiki .sjJ54{--shiki-light:#39ADB5;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .s_sjI, html code.shiki .s_sjI{--shiki-light:#91B859;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sbgvK, html code.shiki .sbgvK{--shiki-light:#E2931D;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .stp6e, html code.shiki .stp6e{--shiki-light:#39ADB5;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s_bVq, html code.shiki .s_bVq{--shiki-light:#9C3EDA;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sGLFI, html code.shiki .sGLFI{--shiki-light:#6182B8;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .s99_P, html code.shiki .s99_P{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#E36209;--shiki-default-font-style:inherit;--shiki-dark:#FFAB70;--shiki-dark-font-style:inherit}html pre.shiki code .sutJx, html code.shiki .sutJx{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#6A737D;--shiki-default-font-style:inherit;--shiki-dark:#6A737D;--shiki-dark-font-style:inherit}html pre.shiki code .s39Yj, html code.shiki .s39Yj{--shiki-light:#39ADB5;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}",{"title":99,"searchDepth":477,"depth":477,"links":1129},[1130,1131,1132,1133],{"id":512,"depth":477,"text":513},{"id":764,"depth":477,"text":765},{"id":934,"depth":477,"text":935},{"id":1048,"depth":477,"text":61},"This page explains how you can create commands using the `vital-commands` module.","md",{},{"title":119},"---\ntitle: Commands\ndescription: This page explains how you can create commands using the `vital-commands` module.\nnavigation:\n  title: Commands\n---\n\n# Commands\n\nEvery command will be a class that extends `VitalCommand.Spigot` and is annotated with `VitalCommand.Info`.  \nA command can have n-number of arg handlers; each arg handler is essentially a method executed when the command is executed with the configured argument.  \n\nSince Vital can determine the structure of your command by simply just looking at your class, it will automatically build tab-completions without you having to do anything!  \n\n```java [MyCommand.java]\n@VitalCommand.Info(name = \"mycommand\")\npublic class MyCommand extends VitalCommand.Spigot {\n}\n```\n\n## Arguments\n\nThe following example shows a command that has an arg handler for `\u002Fmycommand myarg0 myarg1`.  \nWhen this command is executed, Vital automatically calls the method annotated with `@ArgHandler`.\n\n```java [MyCommand.java]\n@VitalCommand.Info(name = \"mycommand\")\npublic class MyCommand extends VitalCommand.Spigot {\n  @ArgHandler(arg = @Arg(name = \"myarg0 myarg1\"))\n  public ReturnState onMyArg0MyArg1SomethingBlaBla(Player player) {\n    \u002F\u002F ...\n  }\n}\n```\n\nEvery arg handler **MUST** return a `ReturnState`.  \nThis type determines the status of your command arg execution.\n\nBy default, this will most likely be `ReturnState.SUCCESS` for almost any of your arg handlers.  \nBut sometimes you might need to return `ReturnState.NO_PERMISSION` or something else for special use cases.\n\n> Note that we have direct access to the player (or command sender) that executed the command.  \n> Using the `@VitalCommand.Info` annotation, you can also mark your command to only be executable by players, by default, this is turned off, and your commands can also be executed by non-players, like your server console.  \n> Important: Obviously, you cant set your parameter to a `Player` if you can also receive non-players as a sender, be careful of that when you build your commands!\n\nWe can also restrict specific arg handlers to players or restrict their permissions.\n```java [MyCommand.java]\n@ArgHandler(arg = @Arg(name = \"myarg0 myarg1\", permission = \"myserver.mycommand.permission\", playerOnly = true))\n```\n\n## Parameters\n\nSometimes we need to get some input from a player.  \nTo do this, we can use the `\u003C...>` syntax.\n\n```java [MyCommand.java]\n@VitalCommand.Info(name = \"mycommand\")\npublic class MyCommand extends VitalCommand.Spigot {\n  @ArgHandler(arg = @Arg(name = \"myarg0 \u003Cmyarg1>\"))\n  public ReturnState onMyArg0MyArg1SomethingBlaBla(Player player, String[] values) {\n    \u002F\u002F ...\n  }\n}\n```\n\nThe arg handler defined above will now be called when someone executes `\u002Fmycommand myarg0 somethinghere`.  \nTo get the value that was input in this variable, add a new parameter to your arg handler method: `String[] values`.  \nThis array holds all values for all variables in your command arg handler.\n\nE.g., when someone executes `\u002Fmycommand myarg0 hello`, the `String[] values` array will be `[\"hello\"]`.\n\nNote that you cannot receive values that are delimited by spaces.  \nSo this `\u002Fmycommand myarg0 hello 123` will not work.  \nFor space-delimited values, use varargs.\n\n## Varargs\n\nTo also receive values delimited by spaces, you can use the vararg syntax `\u003C...>*` in your arg handlers.\n\n```java [MyCommand.java]\n  @ArgHandler(arg = @Arg(name = \"myarg0 \u003Cmyarg1>*\"))\n  public ReturnState onMyArg0MyArg1SomethingBlaBla(Player player, String[] values) {\n    \u002F\u002F ...\n  }\n```\n\nE.g., when someone executes `\u002Fmycommand myarg0 hello`, the `String[] values` array will be `[\"hello\"]`.  \nIf someone executes `\u002Fmycommand myarg0 hello 123`, the `String[] values` array will be `[\"hello\", \"123\"]`.\n\n> Note that varargs behave the same as they do in Java.  \n> Varargs **MUST** be the last variable in your arg handler and can only exist once.  \n> You CANNOT have multiple varargs in a single arg handler, you can also NOT define another variable AFTER a vararg.\n\n## Lifecycles\n\n| Lifecycle                                       | Usage                                                                                                                                                                                                                                                                  |\n|:------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `onCommandError(CS, Arg?, Throwable)`           | Perform an action when an exception was thrown during command execution. This lifecycle is called as the last resort if any other exception handler (arg exception handler, global exception handler) cannot handle the exception that was thrown during your command. |\n| `onCommandTabComplete(CS, String)`              | Add your own tab-completions to the ones Vital automatically generates for you. The `String` passed to this lifecycle will be your command arg string name.                                                                                                            |\n| `onCommandInvalidArgs(CS, String)`              | Perform an action when a command was executed with invalid or incomplete args.                                                                                                                                                                                         |\n| `onCommandRequiresPermission(CS, String, Arg?)` | Perform an action when a command was executed with insufficient permissions.                                                                                                                                                                                           |\n| `onCommandRequiresPlayer(CS, String, Arg?)`     | Perform an action when a command was executed as a non-player but the command requires a player.                                                                                                                                                                       |\n",{"title":119,"description":1134},"Fl7sgi81zTCffOnMhmq9xu62FtJ4YqKJYosqMCz0CCw",1789308658758]