[{"data":1,"prerenderedAt":922},["ShallowReactive",2],{"docs-navigation:\u002Fdocs\u002Fmodules\u002Fvital-inventories\u002Fnormal-inventories":3,"docs-page-estimated-read-time:\u002Fdocs\u002Fmodules\u002Fvital-inventories\u002Fnormal-inventories":399,"docs-page:\u002Fdocs\u002Fmodules\u002Fvital-inventories\u002Fnormal-inventories":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",4,{"id":401,"title":157,"body":402,"description":915,"extension":916,"meta":917,"navigation":918,"path":158,"rawbody":919,"seo":920,"stem":159,"__hash__":921},"docs\u002Fdocs\u002F4.modules\u002Fvital-inventories\u002F2.normal-inventories.md",{"type":403,"value":404,"toc":912},"minimark",[405,409,422,538,545,560,567,752,758,781,784,808,811,832,836,908],[406,407,157],"h1",{"id":408},"normal-inventories",[410,411,412,413,417,418,421],"p",{},"Every normal inventory will be a class that extends ",[414,415,416],"code",{},"VitalInventory"," and is annotated with ",[414,419,420],{},"@VitalInventory.Info",".",[423,424,429],"pre",{"className":425,"code":426,"filename":427,"language":428,"meta":99,"style":99},"language-java shiki shiki-themes material-theme-lighter github-light github-dark","@VitalInventory.Info(type = VitalInventory.Type.GENERIC_9X1, name = \"My inventory\", background = Material.COBBLESTONE)\npublic class MyInventory extends VitalInventory {\n  \n}\n","MyInventory.java","java",[414,430,431,506,527,533],{"__ignoreMap":99},[432,433,436,440,444,447,451,455,459,461,464,466,469,472,475,477,481,485,488,490,493,495,498,500,503],"span",{"class":434,"line":435},"line",1,[432,437,439],{"class":438},"sP7_E","@",[432,441,443],{"class":442},"sbsja","VitalInventory.Info",[432,445,446],{"class":438},"(",[432,448,450],{"class":449},"sZMiF","type",[432,452,454],{"class":453},"smGrS"," =",[432,456,458],{"class":457},"su5hD"," VitalInventory",[432,460,421],{"class":438},[432,462,463],{"class":457},"Type",[432,465,421],{"class":438},[432,467,468],{"class":457},"GENERIC_9X1",[432,470,471],{"class":438},",",[432,473,474],{"class":449}," name",[432,476,454],{"class":453},[432,478,480],{"class":479},"sjJ54"," \"",[432,482,484],{"class":483},"s_sjI","My inventory",[432,486,487],{"class":479},"\"",[432,489,471],{"class":438},[432,491,492],{"class":449}," background",[432,494,454],{"class":453},[432,496,497],{"class":457}," Material",[432,499,421],{"class":438},[432,501,502],{"class":457},"COBBLESTONE",[432,504,505],{"class":438},")\n",[432,507,509,512,515,519,522,524],{"class":434,"line":508},2,[432,510,511],{"class":442},"public",[432,513,514],{"class":442}," class",[432,516,518],{"class":517},"sbgvK"," MyInventory",[432,520,521],{"class":442}," extends",[432,523,458],{"class":517},[432,525,526],{"class":438}," {\n",[432,528,530],{"class":434,"line":529},3,[432,531,532],{"class":457},"  \n",[432,534,535],{"class":434,"line":399},[432,536,537],{"class":438},"}\n",[410,539,540,541,544],{},"You define a background for your inventory using the info annotation, by default, the background will be ",[414,542,543],{},"AIR"," (empty slots).",[410,546,547,548,551,552,555,556,559],{},"To fill this inventory with items, use the ",[414,549,550],{},"setItem(Player, int, ItemStack, Function\u003CInventoryClickEvent>)"," method.",[553,554],"br",{},"\nAs you can see from the method signature, this method can receive a function that takes in an ",[414,557,558],{},"InventoryClickEvent",", which will automatically be called when this item is clicked by a player.",[410,561,562,563,566],{},"Simply set all items in the ",[414,564,565],{},"onUpdate(Player)"," lifecycle.",[423,568,570],{"className":425,"code":569,"filename":427,"language":428,"meta":99,"style":99},"@VitalInventory.Info(type = VitalInventory.Type.GENERIC_9X1, name = \"My inventory\", background = Material.COBBLESTONE)\npublic class MyInventory extends VitalInventory {\n  @Override\n  public void onUpdate(Player player) {\n    setItem(player, 0, new ItemStack(Material.STICK), e -> {\n      \u002F\u002F Do something when this item is clicked.\n    });\n    \n    \u002F\u002F ...\n  }\n}\n",[414,571,572,620,634,642,669,716,723,729,735,741,747],{"__ignoreMap":99},[432,573,574,576,578,580,582,584,586,588,590,592,594,596,598,600,602,604,606,608,610,612,614,616,618],{"class":434,"line":435},[432,575,439],{"class":438},[432,577,443],{"class":442},[432,579,446],{"class":438},[432,581,450],{"class":449},[432,583,454],{"class":453},[432,585,458],{"class":457},[432,587,421],{"class":438},[432,589,463],{"class":457},[432,591,421],{"class":438},[432,593,468],{"class":457},[432,595,471],{"class":438},[432,597,474],{"class":449},[432,599,454],{"class":453},[432,601,480],{"class":479},[432,603,484],{"class":483},[432,605,487],{"class":479},[432,607,471],{"class":438},[432,609,492],{"class":449},[432,611,454],{"class":453},[432,613,497],{"class":457},[432,615,421],{"class":438},[432,617,502],{"class":457},[432,619,505],{"class":438},[432,621,622,624,626,628,630,632],{"class":434,"line":508},[432,623,511],{"class":442},[432,625,514],{"class":442},[432,627,518],{"class":517},[432,629,521],{"class":442},[432,631,458],{"class":517},[432,633,526],{"class":438},[432,635,636,639],{"class":434,"line":529},[432,637,638],{"class":438},"  @",[432,640,641],{"class":442},"Override\n",[432,643,644,647,650,654,656,660,664,667],{"class":434,"line":399},[432,645,646],{"class":442},"  public",[432,648,649],{"class":442}," void",[432,651,653],{"class":652},"sGLFI"," onUpdate",[432,655,446],{"class":438},[432,657,659],{"class":658},"s_bVq","Player",[432,661,663],{"class":662},"s99_P"," player",[432,665,666],{"class":438},")",[432,668,526],{"class":438},[432,670,672,675,677,680,682,686,688,692,695,697,700,702,705,708,711,714],{"class":434,"line":671},5,[432,673,674],{"class":652},"    setItem",[432,676,446],{"class":438},[432,678,679],{"class":457},"player",[432,681,471],{"class":438},[432,683,685],{"class":684},"srdBf"," 0",[432,687,471],{"class":438},[432,689,691],{"class":690},"sVHd0"," new",[432,693,694],{"class":652}," ItemStack",[432,696,446],{"class":438},[432,698,699],{"class":457},"Material",[432,701,421],{"class":438},[432,703,704],{"class":457},"STICK",[432,706,707],{"class":438},"),",[432,709,710],{"class":457}," e ",[432,712,713],{"class":442},"->",[432,715,526],{"class":438},[432,717,719],{"class":434,"line":718},6,[432,720,722],{"class":721},"sutJx","      \u002F\u002F Do something when this item is clicked.\n",[432,724,726],{"class":434,"line":725},7,[432,727,728],{"class":438},"    });\n",[432,730,732],{"class":434,"line":731},8,[432,733,734],{"class":457},"    \n",[432,736,738],{"class":434,"line":737},9,[432,739,740],{"class":721},"    \u002F\u002F ...\n",[432,742,744],{"class":434,"line":743},10,[432,745,746],{"class":438},"  }\n",[432,748,750],{"class":434,"line":749},11,[432,751,537],{"class":438},[410,753,754,755,421],{},"To open this inventory for a player, use ",[414,756,757],{},"open(Player)",[423,759,761],{"className":425,"code":760,"language":428,"meta":99,"style":99},"myInventory.open(myPlayer);\n",[414,762,763],{"__ignoreMap":99},[432,764,765,768,770,773,775,778],{"class":434,"line":435},[432,766,767],{"class":457},"myInventory",[432,769,421],{"class":438},[432,771,772],{"class":652},"open",[432,774,446],{"class":438},[432,776,777],{"class":457},"myPlayer",[432,779,780],{"class":438},");\n",[410,782,783],{},"Additionally, you can also pass in a previous inventory, so players can automatically navigate back to a previous inventory by just clicking outside the inventory view (background).",[423,785,787],{"className":425,"code":786,"language":428,"meta":99,"style":99},"myInventory.open(myPlayer, myPreviousInventory);\n",[414,788,789],{"__ignoreMap":99},[432,790,791,793,795,797,799,801,803,806],{"class":434,"line":435},[432,792,767],{"class":457},[432,794,421],{"class":438},[432,796,772],{"class":652},[432,798,446],{"class":438},[432,800,777],{"class":457},[432,802,471],{"class":438},[432,804,805],{"class":457}," myPreviousInventory",[432,807,780],{"class":438},[410,809,810],{},"Vital will automatically handle all events and route them to your correct inventory and the item that was clicked.",[812,813,814,829],"blockquote",{},[410,815,816,817,819,820,822,823,825,826,421],{},"Note that every player that opens an inventory menu will have its very own and unique inventory.",[553,818],{},"\nInventories are never shared across multiple players and will always be different when newly opened.",[553,821],{},"\nThat's why we want to mostly set our items during the ",[414,824,565],{}," lifecycle instead of ",[414,827,828],{},"onUpdate()",[410,830,831],{},"Some special cases are, of course, if you do not need to show translated items or player-specific data.",[833,834,61],"h2",{"id":835},"lifecycles",[837,838,839,853],"table",{},[840,841,842],"thead",{},[843,844,845,850],"tr",{},[846,847,849],"th",{"align":848},"left","Lifecycle",[846,851,852],{"align":848},"Usage",[854,855,856,867,876,885,898],"tbody",{},[843,857,858,864],{},[859,860,861],"td",{"align":848},[414,862,863],{},"onOpen(Player)",[859,865,866],{"align":848},"Perform an action when the given player opens this inventory (set items ONCE, etc.).",[843,868,869,873],{},[859,870,871],{"align":848},[414,872,828],{},[859,874,875],{"align":848},"Perform an action when this inventory is updated for all players (set items that are always the same for all players, no translations, no specific data, etc.).",[843,877,878,882],{},[859,879,880],{"align":848},[414,881,565],{},[859,883,884],{"align":848},"Perform an action when this inventory is updated for the given player (set items for that player, translated data, specific data, etc.).",[843,886,887,892],{},[859,888,889],{"align":848},[414,890,891],{},"onClick(InventoryClickEvent)",[859,893,894,895,421],{"align":848},"Perform an action when a slot is clicked in this inventory. Should only rarely be used since all click events are automatically routed to your item when you use ",[414,896,897],{},"setItem",[843,899,900,905],{},[859,901,902],{"align":848},[414,903,904],{},"onClose(Player)",[859,906,907],{"align":848},"Perform an action when this inventory is closed for the given player (play sound, remove stuff, etc.).",[909,910,911],"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 .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}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 .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 .sGLFI, html code.shiki .sGLFI{--shiki-light:#6182B8;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .s_bVq, html code.shiki .s_bVq{--shiki-light:#9C3EDA;--shiki-default:#24292E;--shiki-dark:#E1E4E8}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 .srdBf, html code.shiki .srdBf{--shiki-light:#F76D47;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sVHd0, html code.shiki .sVHd0{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#D73A49;--shiki-default-font-style:inherit;--shiki-dark:#F97583;--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}",{"title":99,"searchDepth":508,"depth":508,"links":913},[914],{"id":835,"depth":508,"text":61},"This page explains how you can create inventories that your players can interact with.","md",{},{"title":157},"---\ntitle: Normal inventories\ndescription: This page explains how you can create inventories that your players can interact with.\nnavigation:\n  title: Normal inventories\n---\n\n# Normal inventories\n\nEvery normal inventory will be a class that extends `VitalInventory` and is annotated with `@VitalInventory.Info`.  \n\n```java [MyInventory.java]\n@VitalInventory.Info(type = VitalInventory.Type.GENERIC_9X1, name = \"My inventory\", background = Material.COBBLESTONE)\npublic class MyInventory extends VitalInventory {\n  \n}\n```\n\nYou define a background for your inventory using the info annotation, by default, the background will be `AIR` (empty slots).  \n\nTo fill this inventory with items, use the `setItem(Player, int, ItemStack, Function\u003CInventoryClickEvent>)` method.  \nAs you can see from the method signature, this method can receive a function that takes in an `InventoryClickEvent`, which will automatically be called when this item is clicked by a player.  \n\nSimply set all items in the `onUpdate(Player)` lifecycle.  \n\n```java [MyInventory.java]\n@VitalInventory.Info(type = VitalInventory.Type.GENERIC_9X1, name = \"My inventory\", background = Material.COBBLESTONE)\npublic class MyInventory extends VitalInventory {\n  @Override\n  public void onUpdate(Player player) {\n    setItem(player, 0, new ItemStack(Material.STICK), e -> {\n      \u002F\u002F Do something when this item is clicked.\n    });\n    \n    \u002F\u002F ...\n  }\n}\n```\n\nTo open this inventory for a player, use `open(Player)`.  \n\n```java\nmyInventory.open(myPlayer);\n```\n\nAdditionally, you can also pass in a previous inventory, so players can automatically navigate back to a previous inventory by just clicking outside the inventory view (background).  \n\n```java\nmyInventory.open(myPlayer, myPreviousInventory);\n```\n\nVital will automatically handle all events and route them to your correct inventory and the item that was clicked.\n\n> Note that every player that opens an inventory menu will have its very own and unique inventory.  \n> Inventories are never shared across multiple players and will always be different when newly opened.  \n> That's why we want to mostly set our items during the `onUpdate(Player)` lifecycle instead of `onUpdate()`.\n> \n> Some special cases are, of course, if you do not need to show translated items or player-specific data.\n\n## Lifecycles\n\n| Lifecycle                      | Usage                                                                                                                                                                       |\n|:-------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `onOpen(Player)`               | Perform an action when the given player opens this inventory (set items ONCE, etc.).                                                                                        |\n| `onUpdate()`                   | Perform an action when this inventory is updated for all players (set items that are always the same for all players, no translations, no specific data, etc.).             |\n| `onUpdate(Player)`             | Perform an action when this inventory is updated for the given player (set items for that player, translated data, specific data, etc.).                                    |\n| `onClick(InventoryClickEvent)` | Perform an action when a slot is clicked in this inventory. Should only rarely be used since all click events are automatically routed to your item when you use `setItem`. |\n| `onClose(Player)`              | Perform an action when this inventory is closed for the given player (play sound, remove stuff, etc.).                                                                      |\n",{"title":157,"description":915},"bu23QMj7TwbBriyS4mFk9FCDLTlMytbkkSg-cMPoyvI",1789308658758]