[{"data":1,"prerenderedAt":1728},["ShallowReactive",2],{"docs-navigation:\u002Fdocs\u002Fmodules\u002Fvital-inventories\u002Fpaged-inventories":3,"docs-page-estimated-read-time:\u002Fdocs\u002Fmodules\u002Fvital-inventories\u002Fpaged-inventories":399,"docs-page:\u002Fdocs\u002Fmodules\u002Fvital-inventories\u002Fpaged-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",7,{"id":401,"title":161,"body":402,"description":1721,"extension":1722,"meta":1723,"navigation":1724,"path":162,"rawbody":1725,"seo":1726,"stem":163,"__hash__":1727},"docs\u002Fdocs\u002F4.modules\u002Fvital-inventories\u002F3.paged-inventories.md",{"type":403,"value":404,"toc":1717},"minimark",[405,409,430,579,601,615,629,636,843,849,872,875,899,902,923,928,945,957,960,1623,1629,1632,1713],[406,407,161],"h1",{"id":408},"paged-inventories",[410,411,412,413,417,418,421,422,425,426,429],"p",{},"Every inventory will be a class that extends ",[414,415,416],"code",{},"VitalInventory"," and is annotated with ",[414,419,420],{},"@VitalInventory.Info",", as well as ",[414,423,424],{},"@VitalPagedInventory.Info",".",[427,428],"br",{},"\nBoth annotations are needed here because a paged inventory is essentially a normal inventory.",[431,432,437],"pre",{"className":433,"code":434,"filename":435,"language":436,"meta":99,"style":99},"language-java shiki shiki-themes material-theme-lighter github-light github-dark","@VitalPagedInventory.Info(fromSlot = 10, toSlot = 16)\n@VitalInventory.Info(type = VitalInventory.Type.GENERIC_9X1, name = \"My paged inventory\", background = Material.COBBLESTONE)\npublic class MyPagedInventory extends VitalPagedInventory {\n  \n}\n","MyPagedInventory.java","java",[414,438,439,481,545,567,573],{"__ignoreMap":99},[440,441,444,448,452,455,459,463,467,470,473,475,478],"span",{"class":442,"line":443},"line",1,[440,445,447],{"class":446},"sP7_E","@",[440,449,451],{"class":450},"sbsja","VitalPagedInventory.Info",[440,453,454],{"class":446},"(",[440,456,458],{"class":457},"sZMiF","fromSlot",[440,460,462],{"class":461},"smGrS"," =",[440,464,466],{"class":465},"srdBf"," 10",[440,468,469],{"class":446},",",[440,471,472],{"class":457}," toSlot",[440,474,462],{"class":461},[440,476,477],{"class":465}," 16",[440,479,480],{"class":446},")\n",[440,482,484,486,489,491,494,496,500,502,505,507,510,512,515,517,521,525,528,530,533,535,538,540,543],{"class":442,"line":483},2,[440,485,447],{"class":446},[440,487,488],{"class":450},"VitalInventory.Info",[440,490,454],{"class":446},[440,492,493],{"class":457},"type",[440,495,462],{"class":461},[440,497,499],{"class":498},"su5hD"," VitalInventory",[440,501,425],{"class":446},[440,503,504],{"class":498},"Type",[440,506,425],{"class":446},[440,508,509],{"class":498},"GENERIC_9X1",[440,511,469],{"class":446},[440,513,514],{"class":457}," name",[440,516,462],{"class":461},[440,518,520],{"class":519},"sjJ54"," \"",[440,522,524],{"class":523},"s_sjI","My paged inventory",[440,526,527],{"class":519},"\"",[440,529,469],{"class":446},[440,531,532],{"class":457}," background",[440,534,462],{"class":461},[440,536,537],{"class":498}," Material",[440,539,425],{"class":446},[440,541,542],{"class":498},"COBBLESTONE",[440,544,480],{"class":446},[440,546,548,551,554,558,561,564],{"class":442,"line":547},3,[440,549,550],{"class":450},"public",[440,552,553],{"class":450}," class",[440,555,557],{"class":556},"sbgvK"," MyPagedInventory",[440,559,560],{"class":450}," extends",[440,562,563],{"class":556}," VitalPagedInventory",[440,565,566],{"class":446}," {\n",[440,568,570],{"class":442,"line":569},4,[440,571,572],{"class":498},"  \n",[440,574,576],{"class":442,"line":575},5,[440,577,578],{"class":446},"}\n",[410,580,581,582,585,586,588,589,591,592,594,595,425,598,600],{},"You define a background for your paged inventory using the info annotation, by default, the background will be ",[414,583,584],{},"AIR"," (empty slots).",[427,587],{},"\nThe ",[414,590,424],{}," annotation will define all of your paged inventory specific data, like ",[414,593,458],{}," and ",[414,596,597],{},"toSlot",[427,599],{},"\nThese properties define the \"paged area\" of your inventory.",[410,602,603,604,606,607,610,611,614],{},"Essentially, a paged inventory is a normal inventory, where a specific area may contain content that changes based on the current page you are on.",[427,605],{},"\nThe example shown above defines an inventory where slot ",[414,608,609],{},"10"," to ",[414,612,613],{},"16"," will change depending on what page you are currently on.",[410,616,617,618,621,622,624,625,628],{},"To fill this inventory with items, just like in a normal inventory, use the ",[414,619,620],{},"setItem(Player, int, ItemStack, Function\u003CInventoryClickEvent>)"," method.",[427,623],{},"\nAs you can see from the method signature, this method can receive a function that takes in an ",[414,626,627],{},"InventoryClickEvent",", which will automatically be called when this item is clicked by a player.",[410,630,631,632,635],{},"Simply set all items in the ",[414,633,634],{},"onUpdate(Player)"," lifecycle.",[431,637,639],{"className":433,"code":638,"filename":435,"language":436,"meta":99,"style":99},"@VitalPagedInventory.Info(fromSlot = 10, toSlot = 16)\n@VitalInventory.Info(type = VitalInventory.Type.GENERIC_9X1, name = \"My paged inventory\", background = Material.COBBLESTONE)\npublic class MyPagedInventory extends VitalPagedInventory {\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,640,641,665,713,727,735,762,808,814,820,826,832,838],{"__ignoreMap":99},[440,642,643,645,647,649,651,653,655,657,659,661,663],{"class":442,"line":443},[440,644,447],{"class":446},[440,646,451],{"class":450},[440,648,454],{"class":446},[440,650,458],{"class":457},[440,652,462],{"class":461},[440,654,466],{"class":465},[440,656,469],{"class":446},[440,658,472],{"class":457},[440,660,462],{"class":461},[440,662,477],{"class":465},[440,664,480],{"class":446},[440,666,667,669,671,673,675,677,679,681,683,685,687,689,691,693,695,697,699,701,703,705,707,709,711],{"class":442,"line":483},[440,668,447],{"class":446},[440,670,488],{"class":450},[440,672,454],{"class":446},[440,674,493],{"class":457},[440,676,462],{"class":461},[440,678,499],{"class":498},[440,680,425],{"class":446},[440,682,504],{"class":498},[440,684,425],{"class":446},[440,686,509],{"class":498},[440,688,469],{"class":446},[440,690,514],{"class":457},[440,692,462],{"class":461},[440,694,520],{"class":519},[440,696,524],{"class":523},[440,698,527],{"class":519},[440,700,469],{"class":446},[440,702,532],{"class":457},[440,704,462],{"class":461},[440,706,537],{"class":498},[440,708,425],{"class":446},[440,710,542],{"class":498},[440,712,480],{"class":446},[440,714,715,717,719,721,723,725],{"class":442,"line":547},[440,716,550],{"class":450},[440,718,553],{"class":450},[440,720,557],{"class":556},[440,722,560],{"class":450},[440,724,563],{"class":556},[440,726,566],{"class":446},[440,728,729,732],{"class":442,"line":569},[440,730,731],{"class":446},"  @",[440,733,734],{"class":450},"Override\n",[440,736,737,740,743,747,749,753,757,760],{"class":442,"line":575},[440,738,739],{"class":450},"  public",[440,741,742],{"class":450}," void",[440,744,746],{"class":745},"sGLFI"," onUpdate",[440,748,454],{"class":446},[440,750,752],{"class":751},"s_bVq","Player",[440,754,756],{"class":755},"s99_P"," player",[440,758,759],{"class":446},")",[440,761,566],{"class":446},[440,763,765,768,770,773,775,778,780,784,787,789,792,794,797,800,803,806],{"class":442,"line":764},6,[440,766,767],{"class":745},"    setItem",[440,769,454],{"class":446},[440,771,772],{"class":498},"player",[440,774,469],{"class":446},[440,776,777],{"class":465}," 0",[440,779,469],{"class":446},[440,781,783],{"class":782},"sVHd0"," new",[440,785,786],{"class":745}," ItemStack",[440,788,454],{"class":446},[440,790,791],{"class":498},"Material",[440,793,425],{"class":446},[440,795,796],{"class":498},"STICK",[440,798,799],{"class":446},"),",[440,801,802],{"class":498}," e ",[440,804,805],{"class":450},"->",[440,807,566],{"class":446},[440,809,810],{"class":442,"line":399},[440,811,813],{"class":812},"sutJx","      \u002F\u002F Do something when this item is clicked.\n",[440,815,817],{"class":442,"line":816},8,[440,818,819],{"class":446},"    });\n",[440,821,823],{"class":442,"line":822},9,[440,824,825],{"class":498},"    \n",[440,827,829],{"class":442,"line":828},10,[440,830,831],{"class":812},"    \u002F\u002F ...\n",[440,833,835],{"class":442,"line":834},11,[440,836,837],{"class":446},"  }\n",[440,839,841],{"class":442,"line":840},12,[440,842,578],{"class":446},[410,844,845,846,425],{},"To open this inventory for a player, use ",[414,847,848],{},"open(Player)",[431,850,852],{"className":433,"code":851,"language":436,"meta":99,"style":99},"myPagedInventory.open(myPlayer);\n",[414,853,854],{"__ignoreMap":99},[440,855,856,859,861,864,866,869],{"class":442,"line":443},[440,857,858],{"class":498},"myPagedInventory",[440,860,425],{"class":446},[440,862,863],{"class":745},"open",[440,865,454],{"class":446},[440,867,868],{"class":498},"myPlayer",[440,870,871],{"class":446},");\n",[410,873,874],{},"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).",[431,876,878],{"className":433,"code":877,"language":436,"meta":99,"style":99},"myPagedInventory.open(myPlayer, myPreviousInventory);\n",[414,879,880],{"__ignoreMap":99},[440,881,882,884,886,888,890,892,894,897],{"class":442,"line":443},[440,883,858],{"class":498},[440,885,425],{"class":446},[440,887,863],{"class":745},[440,889,454],{"class":446},[440,891,868],{"class":498},[440,893,469],{"class":446},[440,895,896],{"class":498}," myPreviousInventory",[440,898,871],{"class":446},[410,900,901],{},"Vital will automatically handle all events and route them to your correct inventory and the item that was clicked.",[903,904,905,920],"blockquote",{},[410,906,907,908,910,911,913,914,916,917,425],{},"Note that every player that opens an inventory menu will have its very own and unique inventory.",[427,909],{},"\nInventories are never shared across multiple players and will always be different when newly opened.",[427,912],{},"\nThat's why we want to mostly set our items during the ",[414,915,634],{}," lifecycle instead of ",[414,918,919],{},"onUpdate()",[410,921,922],{},"Some special cases are, of course, if you do not need to show translated items or player-specific data.",[924,925,927],"h2",{"id":926},"set-page-content","Set page content",[410,929,930,931,934,935,937,938,942,943,635],{},"To display items that change depending on what page you are on, you would use the ",[414,932,933],{},"onPageChange(int, Player)"," lifecycle to set items.",[427,936],{},"\nFor all other items that will ",[939,940,941],"strong",{},"NOT"," change even if you switch pages, you can keep using the ",[414,944,634],{},[903,946,947],{},[410,948,949,950,952,953,956],{},"Note that every player will always have its own unique current page and max page just like they have their own unique inventory view every time they open an inventory.",[427,951],{},"\nThat's why we have to also pass in the player when we want to change pages using ",[414,954,955],{},"setPage(int, Player)",", etc.",[410,958,959],{},"Your paged inventory may look something like this:",[431,961,963],{"className":433,"code":962,"filename":435,"language":436,"meta":99,"style":99},"@VitalPagedInventory.Info(fromSlot = 10, toSlot = 16)\n@VitalInventory.Info(type = VitalInventory.Type.GENERIC_9X1, name = \"My paged inventory\", background = Material.COBBLESTONE)\npublic class MyPagedInventory extends VitalPagedInventory {\n  private final List\u003CString> SOME_DATA_I_GOT_FROM_MY_DATABASE = List.of(\n    \"One\",\n    \"Two\",\n    \"Three\",\n    \"Four\",\n    \"Five\"\n  );\n  \n  @Override\n  public void onUpdate(Player player) {\n    \u002F\u002F Slot 9 and 17 are the \"page changers\".\n    \u002F\u002F Here we use the size of SOME_DATA_I_GOT_FROM_MY_DATABASE to set the new page so Vital can automatically calculate and update the max page for our player.\n    \u002F\u002F We can then (if we want) display this max page somewhere. If you don't need it, you can ignore this.\n    setItem(player, 9, new ItemStack(Material.RED_STAINED_GLASS_PANE), e -> setPage(getPage(player) - 1, player, SOME_DATA_I_GOT_FROM_MY_DATABASE.size()));\n    setItem(player, 17, new ItemStack(Material.GREEN_STAINED_GLASS_PANE), e -> setPage(getPage(player) + 1, player, SOME_DATA_I_GOT_FROM_MY_DATABASE.size()));\n  }\n  \n  @Override\n  public void onPageChange(int page, Player player) {\n    \u002F\u002F \"sliceForPage\" automatically gives us a list of elements that matches our current page.\n    \u002F\u002F Vital calculates the number of items that can exist per page from our @VitalPagedInventory.Info annotation (fromSlot, toSlot).\n    final var pageContent = sliceForPage(player, SOME_DATA_I_GOT_FROM_MY_DATABASE);\n    \n    \u002F\u002F Then we can simply set all slots to the elements we got from \"sliceForPage\".\n    final var fromSlot = getInfo(VitalPagedInventory.Info.class).fromSlot();\n    for (int i = 0; i \u003C pageContent.size(); i++) {\n      final var content = pageContent.get(i);\n      final var slot = fromSlot + i;\n      setItem(player, slot, build a new item with the content name or something, e -> {\n        \u002F\u002F Do something when this item is clicked.\n      });\n    }\n  }\n}\n",[414,964,965,989,1037,1051,1087,1100,1111,1122,1133,1143,1148,1152,1158,1177,1183,1189,1195,1267,1333,1338,1343,1350,1379,1385,1391,1418,1423,1429,1467,1512,1539,1561,1595,1601,1607,1613,1618],{"__ignoreMap":99},[440,966,967,969,971,973,975,977,979,981,983,985,987],{"class":442,"line":443},[440,968,447],{"class":446},[440,970,451],{"class":450},[440,972,454],{"class":446},[440,974,458],{"class":457},[440,976,462],{"class":461},[440,978,466],{"class":465},[440,980,469],{"class":446},[440,982,472],{"class":457},[440,984,462],{"class":461},[440,986,477],{"class":465},[440,988,480],{"class":446},[440,990,991,993,995,997,999,1001,1003,1005,1007,1009,1011,1013,1015,1017,1019,1021,1023,1025,1027,1029,1031,1033,1035],{"class":442,"line":483},[440,992,447],{"class":446},[440,994,488],{"class":450},[440,996,454],{"class":446},[440,998,493],{"class":457},[440,1000,462],{"class":461},[440,1002,499],{"class":498},[440,1004,425],{"class":446},[440,1006,504],{"class":498},[440,1008,425],{"class":446},[440,1010,509],{"class":498},[440,1012,469],{"class":446},[440,1014,514],{"class":457},[440,1016,462],{"class":461},[440,1018,520],{"class":519},[440,1020,524],{"class":523},[440,1022,527],{"class":519},[440,1024,469],{"class":446},[440,1026,532],{"class":457},[440,1028,462],{"class":461},[440,1030,537],{"class":498},[440,1032,425],{"class":446},[440,1034,542],{"class":498},[440,1036,480],{"class":446},[440,1038,1039,1041,1043,1045,1047,1049],{"class":442,"line":547},[440,1040,550],{"class":450},[440,1042,553],{"class":450},[440,1044,557],{"class":556},[440,1046,560],{"class":450},[440,1048,563],{"class":556},[440,1050,566],{"class":446},[440,1052,1053,1056,1059,1062,1065,1068,1071,1074,1077,1079,1081,1084],{"class":442,"line":569},[440,1054,1055],{"class":450},"  private",[440,1057,1058],{"class":450}," final",[440,1060,1061],{"class":751}," List",[440,1063,1064],{"class":446},"\u003C",[440,1066,1067],{"class":450},"String",[440,1069,1070],{"class":446},">",[440,1072,1073],{"class":498}," SOME_DATA_I_GOT_FROM_MY_DATABASE ",[440,1075,1076],{"class":461},"=",[440,1078,1061],{"class":498},[440,1080,425],{"class":446},[440,1082,1083],{"class":745},"of",[440,1085,1086],{"class":446},"(\n",[440,1088,1089,1092,1095,1097],{"class":442,"line":575},[440,1090,1091],{"class":519},"    \"",[440,1093,1094],{"class":523},"One",[440,1096,527],{"class":519},[440,1098,1099],{"class":446},",\n",[440,1101,1102,1104,1107,1109],{"class":442,"line":764},[440,1103,1091],{"class":519},[440,1105,1106],{"class":523},"Two",[440,1108,527],{"class":519},[440,1110,1099],{"class":446},[440,1112,1113,1115,1118,1120],{"class":442,"line":399},[440,1114,1091],{"class":519},[440,1116,1117],{"class":523},"Three",[440,1119,527],{"class":519},[440,1121,1099],{"class":446},[440,1123,1124,1126,1129,1131],{"class":442,"line":816},[440,1125,1091],{"class":519},[440,1127,1128],{"class":523},"Four",[440,1130,527],{"class":519},[440,1132,1099],{"class":446},[440,1134,1135,1137,1140],{"class":442,"line":822},[440,1136,1091],{"class":519},[440,1138,1139],{"class":523},"Five",[440,1141,1142],{"class":519},"\"\n",[440,1144,1145],{"class":442,"line":828},[440,1146,1147],{"class":446},"  );\n",[440,1149,1150],{"class":442,"line":834},[440,1151,572],{"class":498},[440,1153,1154,1156],{"class":442,"line":840},[440,1155,731],{"class":446},[440,1157,734],{"class":450},[440,1159,1161,1163,1165,1167,1169,1171,1173,1175],{"class":442,"line":1160},13,[440,1162,739],{"class":450},[440,1164,742],{"class":450},[440,1166,746],{"class":745},[440,1168,454],{"class":446},[440,1170,752],{"class":751},[440,1172,756],{"class":755},[440,1174,759],{"class":446},[440,1176,566],{"class":446},[440,1178,1180],{"class":442,"line":1179},14,[440,1181,1182],{"class":812},"    \u002F\u002F Slot 9 and 17 are the \"page changers\".\n",[440,1184,1186],{"class":442,"line":1185},15,[440,1187,1188],{"class":812},"    \u002F\u002F Here we use the size of SOME_DATA_I_GOT_FROM_MY_DATABASE to set the new page so Vital can automatically calculate and update the max page for our player.\n",[440,1190,1192],{"class":442,"line":1191},16,[440,1193,1194],{"class":812},"    \u002F\u002F We can then (if we want) display this max page somewhere. If you don't need it, you can ignore this.\n",[440,1196,1198,1200,1202,1204,1206,1209,1211,1213,1215,1217,1219,1221,1224,1226,1228,1230,1233,1235,1238,1240,1242,1244,1247,1250,1252,1254,1256,1259,1261,1264],{"class":442,"line":1197},17,[440,1199,767],{"class":745},[440,1201,454],{"class":446},[440,1203,772],{"class":498},[440,1205,469],{"class":446},[440,1207,1208],{"class":465}," 9",[440,1210,469],{"class":446},[440,1212,783],{"class":782},[440,1214,786],{"class":745},[440,1216,454],{"class":446},[440,1218,791],{"class":498},[440,1220,425],{"class":446},[440,1222,1223],{"class":498},"RED_STAINED_GLASS_PANE",[440,1225,799],{"class":446},[440,1227,802],{"class":498},[440,1229,805],{"class":450},[440,1231,1232],{"class":745}," setPage",[440,1234,454],{"class":446},[440,1236,1237],{"class":745},"getPage",[440,1239,454],{"class":446},[440,1241,772],{"class":498},[440,1243,759],{"class":446},[440,1245,1246],{"class":461}," -",[440,1248,1249],{"class":465}," 1",[440,1251,469],{"class":446},[440,1253,756],{"class":498},[440,1255,469],{"class":446},[440,1257,1258],{"class":498}," SOME_DATA_I_GOT_FROM_MY_DATABASE",[440,1260,425],{"class":446},[440,1262,1263],{"class":745},"size",[440,1265,1266],{"class":446},"()));\n",[440,1268,1270,1272,1274,1276,1278,1281,1283,1285,1287,1289,1291,1293,1296,1298,1300,1302,1304,1306,1308,1310,1312,1314,1317,1319,1321,1323,1325,1327,1329,1331],{"class":442,"line":1269},18,[440,1271,767],{"class":745},[440,1273,454],{"class":446},[440,1275,772],{"class":498},[440,1277,469],{"class":446},[440,1279,1280],{"class":465}," 17",[440,1282,469],{"class":446},[440,1284,783],{"class":782},[440,1286,786],{"class":745},[440,1288,454],{"class":446},[440,1290,791],{"class":498},[440,1292,425],{"class":446},[440,1294,1295],{"class":498},"GREEN_STAINED_GLASS_PANE",[440,1297,799],{"class":446},[440,1299,802],{"class":498},[440,1301,805],{"class":450},[440,1303,1232],{"class":745},[440,1305,454],{"class":446},[440,1307,1237],{"class":745},[440,1309,454],{"class":446},[440,1311,772],{"class":498},[440,1313,759],{"class":446},[440,1315,1316],{"class":461}," +",[440,1318,1249],{"class":465},[440,1320,469],{"class":446},[440,1322,756],{"class":498},[440,1324,469],{"class":446},[440,1326,1258],{"class":498},[440,1328,425],{"class":446},[440,1330,1263],{"class":745},[440,1332,1266],{"class":446},[440,1334,1336],{"class":442,"line":1335},19,[440,1337,837],{"class":446},[440,1339,1341],{"class":442,"line":1340},20,[440,1342,572],{"class":498},[440,1344,1346,1348],{"class":442,"line":1345},21,[440,1347,731],{"class":446},[440,1349,734],{"class":450},[440,1351,1353,1355,1357,1360,1362,1365,1368,1370,1373,1375,1377],{"class":442,"line":1352},22,[440,1354,739],{"class":450},[440,1356,742],{"class":450},[440,1358,1359],{"class":745}," onPageChange",[440,1361,454],{"class":446},[440,1363,1364],{"class":450},"int",[440,1366,1367],{"class":755}," page",[440,1369,469],{"class":446},[440,1371,1372],{"class":751}," Player",[440,1374,756],{"class":755},[440,1376,759],{"class":446},[440,1378,566],{"class":446},[440,1380,1382],{"class":442,"line":1381},23,[440,1383,1384],{"class":812},"    \u002F\u002F \"sliceForPage\" automatically gives us a list of elements that matches our current page.\n",[440,1386,1388],{"class":442,"line":1387},24,[440,1389,1390],{"class":812},"    \u002F\u002F Vital calculates the number of items that can exist per page from our @VitalPagedInventory.Info annotation (fromSlot, toSlot).\n",[440,1392,1394,1397,1400,1403,1405,1408,1410,1412,1414,1416],{"class":442,"line":1393},25,[440,1395,1396],{"class":450},"    final",[440,1398,1399],{"class":450}," var",[440,1401,1402],{"class":498}," pageContent ",[440,1404,1076],{"class":461},[440,1406,1407],{"class":745}," sliceForPage",[440,1409,454],{"class":446},[440,1411,772],{"class":498},[440,1413,469],{"class":446},[440,1415,1258],{"class":498},[440,1417,871],{"class":446},[440,1419,1421],{"class":442,"line":1420},26,[440,1422,825],{"class":498},[440,1424,1426],{"class":442,"line":1425},27,[440,1427,1428],{"class":812},"    \u002F\u002F Then we can simply set all slots to the elements we got from \"sliceForPage\".\n",[440,1430,1432,1434,1436,1439,1441,1444,1446,1449,1451,1454,1456,1459,1462,1464],{"class":442,"line":1431},28,[440,1433,1396],{"class":450},[440,1435,1399],{"class":450},[440,1437,1438],{"class":498}," fromSlot ",[440,1440,1076],{"class":461},[440,1442,1443],{"class":745}," getInfo",[440,1445,454],{"class":446},[440,1447,1448],{"class":498},"VitalPagedInventory",[440,1450,425],{"class":446},[440,1452,1453],{"class":498},"Info",[440,1455,425],{"class":446},[440,1457,1458],{"class":498},"class",[440,1460,1461],{"class":446},").",[440,1463,458],{"class":745},[440,1465,1466],{"class":446},"();\n",[440,1468,1470,1473,1476,1478,1481,1483,1485,1488,1490,1492,1495,1497,1499,1502,1505,1508,1510],{"class":442,"line":1469},29,[440,1471,1472],{"class":782},"    for",[440,1474,1475],{"class":446}," (",[440,1477,1364],{"class":450},[440,1479,1480],{"class":498}," i ",[440,1482,1076],{"class":461},[440,1484,777],{"class":465},[440,1486,1487],{"class":446},";",[440,1489,1480],{"class":498},[440,1491,1064],{"class":461},[440,1493,1494],{"class":498}," pageContent",[440,1496,425],{"class":446},[440,1498,1263],{"class":745},[440,1500,1501],{"class":446},"();",[440,1503,1504],{"class":498}," i",[440,1506,1507],{"class":461},"++",[440,1509,759],{"class":446},[440,1511,566],{"class":446},[440,1513,1515,1518,1520,1523,1525,1527,1529,1532,1534,1537],{"class":442,"line":1514},30,[440,1516,1517],{"class":450},"      final",[440,1519,1399],{"class":450},[440,1521,1522],{"class":498}," content ",[440,1524,1076],{"class":461},[440,1526,1494],{"class":498},[440,1528,425],{"class":446},[440,1530,1531],{"class":745},"get",[440,1533,454],{"class":446},[440,1535,1536],{"class":498},"i",[440,1538,871],{"class":446},[440,1540,1542,1544,1546,1549,1551,1553,1556,1558],{"class":442,"line":1541},31,[440,1543,1517],{"class":450},[440,1545,1399],{"class":450},[440,1547,1548],{"class":498}," slot ",[440,1550,1076],{"class":461},[440,1552,1438],{"class":498},[440,1554,1555],{"class":461},"+",[440,1557,1504],{"class":498},[440,1559,1560],{"class":446},";\n",[440,1562,1564,1567,1569,1571,1573,1576,1578,1581,1584,1587,1589,1591,1593],{"class":442,"line":1563},32,[440,1565,1566],{"class":745},"      setItem",[440,1568,454],{"class":446},[440,1570,772],{"class":498},[440,1572,469],{"class":446},[440,1574,1575],{"class":498}," slot",[440,1577,469],{"class":446},[440,1579,1580],{"class":498}," build a ",[440,1582,1583],{"class":782},"new",[440,1585,1586],{"class":498}," item with the content name or something",[440,1588,469],{"class":446},[440,1590,802],{"class":498},[440,1592,805],{"class":450},[440,1594,566],{"class":446},[440,1596,1598],{"class":442,"line":1597},33,[440,1599,1600],{"class":812},"        \u002F\u002F Do something when this item is clicked.\n",[440,1602,1604],{"class":442,"line":1603},34,[440,1605,1606],{"class":446},"      });\n",[440,1608,1610],{"class":442,"line":1609},35,[440,1611,1612],{"class":446},"    }\n",[440,1614,1616],{"class":442,"line":1615},36,[440,1617,837],{"class":446},[440,1619,1621],{"class":442,"line":1620},37,[440,1622,578],{"class":446},[410,1624,1625,1626,1628],{},"The example shown above can be used as a good starting point for your own paged inventory.",[427,1627],{},"\nPlease refer to the Javadoc for more detailed information on certain methods.",[924,1630,61],{"id":1631},"lifecycles",[1633,1634,1635,1649],"table",{},[1636,1637,1638],"thead",{},[1639,1640,1641,1646],"tr",{},[1642,1643,1645],"th",{"align":1644},"left","Lifecycle",[1642,1647,1648],{"align":1644},"Usage",[1650,1651,1652,1663,1672,1681,1694,1703],"tbody",{},[1639,1653,1654,1660],{},[1655,1656,1657],"td",{"align":1644},[414,1658,1659],{},"onOpen(Player)",[1655,1661,1662],{"align":1644},"Perform an action when the given player opens this inventory (set items ONCE, etc.).",[1639,1664,1665,1669],{},[1655,1666,1667],{"align":1644},[414,1668,919],{},[1655,1670,1671],{"align":1644},"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.).",[1639,1673,1674,1678],{},[1655,1675,1676],{"align":1644},[414,1677,634],{},[1655,1679,1680],{"align":1644},"Perform an action when this inventory is updated for the given player (set items for that player, translated data, specific data, etc.).",[1639,1682,1683,1688],{},[1655,1684,1685],{"align":1644},[414,1686,1687],{},"onClick(InventoryClickEvent)",[1655,1689,1690,1691,425],{"align":1644},"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,1692,1693],{},"setItem",[1639,1695,1696,1700],{},[1655,1697,1698],{"align":1644},[414,1699,933],{},[1655,1701,1702],{"align":1644},"Use this method to set your page-specific content (items that will change depending on what page you are currently on).",[1639,1704,1705,1710],{},[1655,1706,1707],{"align":1644},[414,1708,1709],{},"onClose(Player)",[1655,1711,1712],{"align":1644},"Perform an action when this inventory is closed for the given player (play sound, remove stuff, etc.).",[1714,1715,1716],"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 .srdBf, html code.shiki .srdBf{--shiki-light:#F76D47;--shiki-default:#005CC5;--shiki-dark:#79B8FF}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 .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":483,"depth":483,"links":1718},[1719,1720],{"id":926,"depth":483,"text":927},{"id":1631,"depth":483,"text":61},"This page explains how you can create multi-paged inventories that your players can interact with.","md",{},{"title":161},"---\ntitle: Paged inventories\ndescription: This page explains how you can create multi-paged inventories that your players can interact with.\nnavigation:\n  title: Paged inventories\n---\n\n# Paged inventories\n\nEvery inventory will be a class that extends `VitalInventory` and is annotated with `@VitalInventory.Info`, as well as `@VitalPagedInventory.Info`.  \nBoth annotations are needed here because a paged inventory is essentially a normal inventory.  \n\n```java [MyPagedInventory.java]\n@VitalPagedInventory.Info(fromSlot = 10, toSlot = 16)\n@VitalInventory.Info(type = VitalInventory.Type.GENERIC_9X1, name = \"My paged inventory\", background = Material.COBBLESTONE)\npublic class MyPagedInventory extends VitalPagedInventory {\n  \n}\n```\n\nYou define a background for your paged inventory using the info annotation, by default, the background will be `AIR` (empty slots).  \nThe `@VitalPagedInventory.Info` annotation will define all of your paged inventory specific data, like `fromSlot` and `toSlot`.  \nThese properties define the \"paged area\" of your inventory.  \n\nEssentially, a paged inventory is a normal inventory, where a specific area may contain content that changes based on the current page you are on.  \nThe example shown above defines an inventory where slot `10` to `16` will change depending on what page you are currently on.  \n\nTo fill this inventory with items, just like in a normal inventory, 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 [MyPagedInventory.java]\n@VitalPagedInventory.Info(fromSlot = 10, toSlot = 16)\n@VitalInventory.Info(type = VitalInventory.Type.GENERIC_9X1, name = \"My paged inventory\", background = Material.COBBLESTONE)\npublic class MyPagedInventory extends VitalPagedInventory {\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\nmyPagedInventory.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\nmyPagedInventory.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## Set page content\n\nTo display items that change depending on what page you are on, you would use the `onPageChange(int, Player)` lifecycle to set items.  \nFor all other items that will **NOT** change even if you switch pages, you can keep using the `onUpdate(Player)` lifecycle.  \n\n> Note that every player will always have its own unique current page and max page just like they have their own unique inventory view every time they open an inventory.  \n> That's why we have to also pass in the player when we want to change pages using `setPage(int, Player)`, etc. \n\nYour paged inventory may look something like this:  \n\n```java [MyPagedInventory.java]\n@VitalPagedInventory.Info(fromSlot = 10, toSlot = 16)\n@VitalInventory.Info(type = VitalInventory.Type.GENERIC_9X1, name = \"My paged inventory\", background = Material.COBBLESTONE)\npublic class MyPagedInventory extends VitalPagedInventory {\n  private final List\u003CString> SOME_DATA_I_GOT_FROM_MY_DATABASE = List.of(\n    \"One\",\n    \"Two\",\n    \"Three\",\n    \"Four\",\n    \"Five\"\n  );\n  \n  @Override\n  public void onUpdate(Player player) {\n    \u002F\u002F Slot 9 and 17 are the \"page changers\".\n    \u002F\u002F Here we use the size of SOME_DATA_I_GOT_FROM_MY_DATABASE to set the new page so Vital can automatically calculate and update the max page for our player.\n    \u002F\u002F We can then (if we want) display this max page somewhere. If you don't need it, you can ignore this.\n    setItem(player, 9, new ItemStack(Material.RED_STAINED_GLASS_PANE), e -> setPage(getPage(player) - 1, player, SOME_DATA_I_GOT_FROM_MY_DATABASE.size()));\n    setItem(player, 17, new ItemStack(Material.GREEN_STAINED_GLASS_PANE), e -> setPage(getPage(player) + 1, player, SOME_DATA_I_GOT_FROM_MY_DATABASE.size()));\n  }\n  \n  @Override\n  public void onPageChange(int page, Player player) {\n    \u002F\u002F \"sliceForPage\" automatically gives us a list of elements that matches our current page.\n    \u002F\u002F Vital calculates the number of items that can exist per page from our @VitalPagedInventory.Info annotation (fromSlot, toSlot).\n    final var pageContent = sliceForPage(player, SOME_DATA_I_GOT_FROM_MY_DATABASE);\n    \n    \u002F\u002F Then we can simply set all slots to the elements we got from \"sliceForPage\".\n    final var fromSlot = getInfo(VitalPagedInventory.Info.class).fromSlot();\n    for (int i = 0; i \u003C pageContent.size(); i++) {\n      final var content = pageContent.get(i);\n      final var slot = fromSlot + i;\n      setItem(player, slot, build a new item with the content name or something, e -> {\n        \u002F\u002F Do something when this item is clicked.\n      });\n    }\n  }\n}\n```\n\nThe example shown above can be used as a good starting point for your own paged inventory.  \nPlease refer to the Javadoc for more detailed information on certain methods.  \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| `onPageChange(int, Player)`    | Use this method to set your page-specific content (items that will change depending on what page you are currently on).                                                     |\n| `onClose(Player)`              | Perform an action when this inventory is closed for the given player (play sound, remove stuff, etc.).                                                                      |\n",{"title":161,"description":1721},"FpsmlRXM8UvcouewHVy5M8lr78T11B-ij8wYZI3rz0U",1789308658758]