[{"data":1,"prerenderedAt":697},["ShallowReactive",2],{"docs-navigation:\u002Fdocs\u002Fconventions\u002Fadvanced-classloading":3,"docs-page-estimated-read-time:\u002Fdocs\u002Fconventions\u002Fadvanced-classloading":399,"docs-page:\u002Fdocs\u002Fconventions\u002Fadvanced-classloading":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":402,"body":403,"description":690,"extension":691,"meta":692,"navigation":693,"path":66,"rawbody":694,"seo":695,"stem":67,"__hash__":696},"docs\u002Fdocs\u002F3.conventions\u002F6.advanced-classloading.md","Class loading",{"type":404,"value":405,"toc":688},"minimark",[406,410,414,422,431,437,446,455,458,503,506,509,517,527,533,646,652,674,676,680,684],[407,408,65],"h1",{"id":409},"optional-advanced-class-loading",[407,411,413],{"id":412},"this-section-is-only-required-for-very-advanced-use-cases-and-99-of-all-developers-might-not-even-know-that-this-exists","This section is only required for very advanced use cases, and 99% of all developers might not even know that this exists",[415,416,417,418,421],"p",{},"Vital does some serious stuff regarding class loading and resource location to make all of its features and functionalities possible with Spigot, Paper and BungeeCord.",[419,420],"br",{},"\nAn effect of this is that some platform implementation specifics clash with the ones Vital uses, like duplicate resources in your plugin JAR file and in the server's runtime library, or logging providers, etc.",[415,423,424,425,427,428,430],{},"Here's an example. Let's say that you want to use a library in your plugin; that library happens to also be part of the server's runtime stack (So your server, like Spigot, Paper or BungeeCord, internally also uses this library).",[419,426],{},"\nNow when your server tries to load your plugin, your plugin now has access to two different implementations of that library, which one should it use?",[419,429],{},"\nThe first thought would be to just use the one your plugin has, right?",[415,432,433,434,436],{},"Well yes, but actually no.",[419,435],{},"\nBecause this introduces a weird problem.",[415,438,439,440,442,443,445],{},"Let's say that your plugin just uses the library it is shipped with.",[419,441],{},"\nYour plugin starts up, no problem, but now one of your players performs an action that calls the library you included (that clashes with your server).",[419,444],{},"\nIF the library you included contains everything it needs, this won't be a problem, but if the library is just an SPI and basically just an interface to call specific logic, you run into an error.",[415,447,448,449,451,452,454],{},"The best example of this is the SpigotAPI, PaperAPI and BungeeCordAPI.",[419,450],{},"\nAll of these libraries are just interfaces for you to communicate with your server.",[419,453],{},"\nIf you try to use them outside a Minecraft server, nothing happens, or an error is thrown.",[415,456,457],{},"Most of these issues can be fixed by simply adding your library as a compile-only dependency.",[459,460,465],"pre",{"className":461,"code":462,"filename":463,"language":464,"meta":99,"style":99},"language-kotlin shiki shiki-themes material-theme-lighter github-light github-dark","dependencies {\n  compileOnly(\"my.awesome.library:artifact:1.0.0\")\n}\n","build.gradle.kts","kotlin",[466,467,468,481,497],"code",{"__ignoreMap":99},[469,470,473,477],"span",{"class":471,"line":472},"line",1,[469,474,476],{"class":475},"sGLFI","dependencies",[469,478,480],{"class":479},"su5hD"," {\n",[469,482,484,487,490,494],{"class":471,"line":483},2,[469,485,486],{"class":475},"  compileOnly",[469,488,489],{"class":479},"(",[469,491,493],{"class":492},"s_sjI","\"my.awesome.library:artifact:1.0.0\"",[469,495,496],{"class":479},")\n",[469,498,500],{"class":471,"line":499},3,[469,501,502],{"class":479},"}\n",[415,504,505],{},"But sometimes you have a library that transitively pulls in other artifacts, and then this solution won't do much.",[507,508],"hr",{},[415,510,511,512,516],{},"To fix this, Vital already configures all it needs to get 99% of all plugins working, ",[513,514,515],"strong",{},"BUT"," if you are one of the unlucky 1%, this section might be your rescue.",[415,518,519,520,522,523,526],{},"Vital provides a hidden way to configure how resources and classes are loaded when it starts up.",[419,521],{},"\nYou can use the ",[466,524,525],{},"vital.properties"," file to define class locations that should be loaded from the parent loader (your server's runtime) first, before attempting to load it from your plugin JAR.",[415,528,529,530,532],{},"Simply create this file in your resource location (so it is moved to your plugin JAR root when you build your plugin).",[419,531],{},"\nThe following configuration is the default, any manual configurations are overridden and should always start with at least this:",[459,534,538],{"className":535,"code":536,"filename":525,"language":537,"meta":99,"style":99},"language-properties shiki shiki-themes material-theme-lighter github-light github-dark","vital.classloader.spigot.parent-first-packages=\\\n  org.bukkit, \\\n  net.kyori, \\\n  org.slf4j, \\\n  ch.qos.logback, \\\n  org.apache.logging\nvital.classloader.paper.parent-first-packages=\\\n  org.bukkit, \\\n  net.kyori, \\\n  org.slf4j, \\\n  ch.qos.logback, \\\n  org.apache.logging\nvital.classloader.bungee.parent-first-packages=\\\n  net.md_5.bungee, \\\n  org.slf4j, \\\n  ch.qos.logback, \\\n  org.apache.logging\n","properties",[466,539,540,553,558,563,569,574,580,590,595,600,605,610,615,625,631,636,641],{"__ignoreMap":99},[469,541,542,546,550],{"class":471,"line":472},[469,543,545],{"class":544},"sFlF4","vital.classloader.spigot.parent-first-packages",[469,547,549],{"class":548},"sP7_E","=",[469,551,552],{"class":479},"\\\n",[469,554,555],{"class":471,"line":483},[469,556,557],{"class":479},"  org.bukkit, \\\n",[469,559,560],{"class":471,"line":499},[469,561,562],{"class":479},"  net.kyori, \\\n",[469,564,566],{"class":471,"line":565},4,[469,567,568],{"class":479},"  org.slf4j, \\\n",[469,570,571],{"class":471,"line":399},[469,572,573],{"class":479},"  ch.qos.logback, \\\n",[469,575,577],{"class":471,"line":576},6,[469,578,579],{"class":479},"  org.apache.logging\n",[469,581,583,586,588],{"class":471,"line":582},7,[469,584,585],{"class":544},"vital.classloader.paper.parent-first-packages",[469,587,549],{"class":548},[469,589,552],{"class":479},[469,591,593],{"class":471,"line":592},8,[469,594,557],{"class":479},[469,596,598],{"class":471,"line":597},9,[469,599,562],{"class":479},[469,601,603],{"class":471,"line":602},10,[469,604,568],{"class":479},[469,606,608],{"class":471,"line":607},11,[469,609,573],{"class":479},[469,611,613],{"class":471,"line":612},12,[469,614,579],{"class":479},[469,616,618,621,623],{"class":471,"line":617},13,[469,619,620],{"class":544},"vital.classloader.bungee.parent-first-packages",[469,622,549],{"class":548},[469,624,552],{"class":479},[469,626,628],{"class":471,"line":627},14,[469,629,630],{"class":479},"  net.md_5.bungee, \\\n",[469,632,634],{"class":471,"line":633},15,[469,635,568],{"class":479},[469,637,639],{"class":471,"line":638},16,[469,640,573],{"class":479},[469,642,644],{"class":471,"line":643},17,[469,645,579],{"class":479},[415,647,648,649,651],{},"What this configuration file does is, it tells Vital's internal class loader where to load specific classes or other resources from.",[419,650],{},"\nHere's how it works:",[653,654,655,659,662,665,668,671],"ol",{},[656,657,658],"li",{},"Your plugin wants to use a specific class and automatically (you don't have to do anything. just use your stuff) loads the class it needs.",[656,660,661],{},"Vital's internal class loader is used to load the class.",[656,663,664],{},"It looks into the configuration file above and checks if the requested class or resource needs to be loaded from one of the configured locations.",[656,666,667],{},"If the requested class or resource needs to be loaded from a location mentioned in this configuration file, Vital first asks Spigot, Paper or BungeeCord to load it.",[656,669,670],{},"If Spigot, Paper or BungeeCord knows this class or resource, it is used. Nothing else happens anymore.",[656,672,673],{},"But if Spigot, Paper or BungeeCord doesn't know the requested class or resource, Vital falls back to your plugin and tries to load it from your plugin JAR file.",[507,675],{},[407,677,679],{"id":678},"again-this-section-is-only-required-for-very-advanced-use-cases-and-99-of-all-developers-might-not-even-know-that-this-exists","Again, this section is only required for very advanced use cases, and 99% of all developers might not even know that this exists.",[407,681,683],{"id":682},"but-if-you-are-experiencing-class-loading-issues-and-this-section-did-not-resolve-your-issue-please-open-up-an-issue-on-github-immediately","But, if you are experiencing class loading issues and this section did not resolve your issue, please open up an issue on GitHub immediately!",[685,686,687],"style",{},"html pre.shiki code .sGLFI, html code.shiki .sGLFI{--shiki-light:#6182B8;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s_sjI, html code.shiki .s_sjI{--shiki-light:#91B859;--shiki-default:#032F62;--shiki-dark:#9ECBFF}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 .sFlF4, html code.shiki .sFlF4{--shiki-light:#E53935;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}",{"title":99,"searchDepth":483,"depth":483,"links":689},[],"This page is only meant for very advanced use cases and goes in detail about the internal class loading mechanisms used by Vital.","md",{},{"title":65},"---\ntitle: Class loading\ndescription: This page is only meant for very advanced use cases and goes in detail about the internal class loading mechanisms used by Vital.\nnavigation:\n  title: (Optional) Advanced class loading\n---\n\n# (Optional) Advanced class loading\n# This section is only required for very advanced use cases, and 99% of all developers might not even know that this exists\n\nVital does some serious stuff regarding class loading and resource location to make all of its features and functionalities possible with Spigot, Paper and BungeeCord.  \nAn effect of this is that some platform implementation specifics clash with the ones Vital uses, like duplicate resources in your plugin JAR file and in the server's runtime library, or logging providers, etc.\n\nHere's an example. Let's say that you want to use a library in your plugin; that library happens to also be part of the server's runtime stack (So your server, like Spigot, Paper or BungeeCord, internally also uses this library).  \nNow when your server tries to load your plugin, your plugin now has access to two different implementations of that library, which one should it use?  \nThe first thought would be to just use the one your plugin has, right?  \n\nWell yes, but actually no.  \nBecause this introduces a weird problem.  \n\nLet's say that your plugin just uses the library it is shipped with.  \nYour plugin starts up, no problem, but now one of your players performs an action that calls the library you included (that clashes with your server).  \nIF the library you included contains everything it needs, this won't be a problem, but if the library is just an SPI and basically just an interface to call specific logic, you run into an error.  \n\nThe best example of this is the SpigotAPI, PaperAPI and BungeeCordAPI.  \nAll of these libraries are just interfaces for you to communicate with your server.  \nIf you try to use them outside a Minecraft server, nothing happens, or an error is thrown.\n\nMost of these issues can be fixed by simply adding your library as a compile-only dependency.  \n```kotlin [build.gradle.kts]\ndependencies {\n  compileOnly(\"my.awesome.library:artifact:1.0.0\")\n}\n```\n\nBut sometimes you have a library that transitively pulls in other artifacts, and then this solution won't do much.\n\n---\n\nTo fix this, Vital already configures all it needs to get 99% of all plugins working, **BUT** if you are one of the unlucky 1%, this section might be your rescue.\n\nVital provides a hidden way to configure how resources and classes are loaded when it starts up.  \nYou can use the `vital.properties` file to define class locations that should be loaded from the parent loader (your server's runtime) first, before attempting to load it from your plugin JAR.  \n\nSimply create this file in your resource location (so it is moved to your plugin JAR root when you build your plugin).  \nThe following configuration is the default, any manual configurations are overridden and should always start with at least this:  \n```properties [vital.properties]\nvital.classloader.spigot.parent-first-packages=\\\n  org.bukkit, \\\n  net.kyori, \\\n  org.slf4j, \\\n  ch.qos.logback, \\\n  org.apache.logging\nvital.classloader.paper.parent-first-packages=\\\n  org.bukkit, \\\n  net.kyori, \\\n  org.slf4j, \\\n  ch.qos.logback, \\\n  org.apache.logging\nvital.classloader.bungee.parent-first-packages=\\\n  net.md_5.bungee, \\\n  org.slf4j, \\\n  ch.qos.logback, \\\n  org.apache.logging\n```\n\nWhat this configuration file does is, it tells Vital's internal class loader where to load specific classes or other resources from.  \nHere's how it works:  \n\n1. Your plugin wants to use a specific class and automatically (you don't have to do anything. just use your stuff) loads the class it needs.\n2. Vital's internal class loader is used to load the class.\n3. It looks into the configuration file above and checks if the requested class or resource needs to be loaded from one of the configured locations.\n4. If the requested class or resource needs to be loaded from a location mentioned in this configuration file, Vital first asks Spigot, Paper or BungeeCord to load it.\n5. If Spigot, Paper or BungeeCord knows this class or resource, it is used. Nothing else happens anymore.\n6. But if Spigot, Paper or BungeeCord doesn't know the requested class or resource, Vital falls back to your plugin and tries to load it from your plugin JAR file.\n\n---\n\n# Again, this section is only required for very advanced use cases, and 99% of all developers might not even know that this exists.\n# But, if you are experiencing class loading issues and this section did not resolve your issue, please open up an issue on GitHub immediately!\n",{"title":402,"description":690},"D7TS0PWyEX3bkSciYKZpcK026b4tmGM6wqjzT3orKDM",1789308658758]