├── .gitignore ├── Core Modals.md ├── License ├── Nodepad++ Highlighter.xml ├── README-DE.md ├── README.md ├── _changelog.md ├── bin ├── add.js ├── modal.js ├── test-module.js └── watch.js ├── docs ├── 404.html ├── CNAME ├── assets │ ├── css │ │ └── 0.styles.8fb87093.css │ ├── img │ │ └── search.83621669.svg │ └── js │ │ ├── 1.5479b213.js │ │ ├── 10.8b540692.js │ │ ├── 11.0ed310e9.js │ │ ├── 12.9c113e20.js │ │ ├── 13.d369c8ce.js │ │ ├── 14.7ad13bec.js │ │ ├── 15.23e5a4b1.js │ │ ├── 16.aff869ed.js │ │ ├── 17.ee31f493.js │ │ ├── 18.6835bd74.js │ │ ├── 19.45b387b0.js │ │ ├── 2.d6bda53c.js │ │ ├── 20.1738fba5.js │ │ ├── 21.4d692b32.js │ │ ├── 22.1731b443.js │ │ ├── 23.20d2c32d.js │ │ ├── 24.b1ba9dd1.js │ │ ├── 25.67a04e6a.js │ │ ├── 26.392aa713.js │ │ ├── 27.e7f229ed.js │ │ ├── 28.c07ad597.js │ │ ├── 29.5b2137c1.js │ │ ├── 3.f5aa00b7.js │ │ ├── 30.5ba13f75.js │ │ ├── 31.05e43755.js │ │ ├── 32.1b6a87f1.js │ │ ├── 33.6042f44a.js │ │ ├── 34.1f5f89dd.js │ │ ├── 35.3514db4a.js │ │ ├── 4.e4be212d.js │ │ ├── 5.65c44daf.js │ │ ├── 6.734ecb4e.js │ │ ├── 7.d77b33d9.js │ │ ├── app.85345d5f.js │ │ └── vendors~docsearch.03d43e08.js ├── cli │ └── index.html ├── code_icon.svg ├── de │ ├── cli │ │ └── index.html │ ├── files │ │ └── index.html │ ├── guide │ │ └── index.html │ ├── ides │ │ └── index.html │ ├── index.html │ └── syntax │ │ └── index.html ├── documentation_icon.svg ├── files │ └── index.html ├── gitHub_icon.svg ├── guide │ └── index.html ├── icons │ ├── icon-128x128.png │ ├── icon-144x144.png │ ├── icon-152x152.png │ ├── icon-192x192.png │ ├── icon-384x384.png │ ├── icon-512x512.png │ ├── icon-72x72.png │ └── icon-96x96.png ├── ides │ └── index.html ├── index.html ├── logo.png ├── manifest.json ├── rocket_icon.svg ├── service-worker.js └── syntax │ └── index.html ├── documentation ├── .vuepress │ ├── config.js │ ├── public │ │ ├── code_icon.svg │ │ ├── documentation_icon.svg │ │ ├── gitHub_icon.svg │ │ ├── icons │ │ │ ├── icon-128x128.png │ │ │ ├── icon-144x144.png │ │ │ ├── icon-152x152.png │ │ │ ├── icon-192x192.png │ │ │ ├── icon-384x384.png │ │ │ ├── icon-512x512.png │ │ │ ├── icon-72x72.png │ │ │ └── icon-96x96.png │ │ ├── logo.png │ │ ├── manifest.json │ │ └── rocket_icon.svg │ └── styles │ │ └── palette.styl ├── README.md ├── cli │ └── README.md ├── de │ ├── README.md │ ├── cli │ │ └── README.md │ ├── files │ │ └── README.md │ ├── guide │ │ └── README.md │ ├── ides │ │ └── README.md │ └── syntax │ │ └── README.md ├── files │ └── README.md ├── guide │ └── README.md ├── ides │ └── README.md ├── package.json └── syntax │ └── README.md ├── examples ├── functions │ ├── advanced_modal.mcfunction │ ├── arrays.mcfunction │ ├── basic_loop.mcfunction │ ├── basic_modal.mcfunction │ ├── boolean.mcfunction │ ├── comments.mcfunction │ ├── consts.mcfunction │ ├── dowhile.mcfunction │ ├── fileloop │ │ ├── 1.mcfunction │ │ ├── 2.mcfunction │ │ ├── 3.mcfunction │ │ └── 4.mcfunction │ ├── foreach.mcfunction │ ├── function.mcfunction │ ├── global.mcfunction │ ├── groups.mcfunction │ ├── hello_world.mcfunction │ ├── if.mcfunction │ ├── maps.mcfunction │ ├── mcscript │ │ ├── dowhile1.mcfunction │ │ ├── dowhile3.mcfunction │ │ ├── dowhile6.mcfunction │ │ ├── forEach2.mcfunction │ │ ├── forEach3.mcfunction │ │ ├── foreach1.mcfunction │ │ ├── foreach5.mcfunction │ │ ├── foreach6.mcfunction │ │ ├── foreach7.mcfunction │ │ ├── foreach8.mcfunction │ │ ├── load.mcfunction │ │ ├── raycast1.mcfunction │ │ ├── raycast2.mcfunction │ │ ├── raycast4.mcfunction │ │ ├── raycast5.mcfunction │ │ ├── raycast9.mcfunction │ │ ├── while10.mcfunction │ │ ├── while2.mcfunction │ │ ├── while3.mcfunction │ │ ├── while4.mcfunction │ │ ├── while5.mcfunction │ │ └── while6.mcfunction │ ├── operators.mcfunction │ ├── raycast.mcfunction │ ├── raycasting.mcfunction │ ├── switches.mcfunction │ ├── test.mcfunction │ ├── variables.mcfunction │ ├── vars.mcfunction │ └── while.mcfunction └── scripts │ ├── Hello World.mcscript │ ├── If Statement.mcscript │ ├── Operators.mcscript │ ├── advanced Modal.mcscript │ ├── arrays.mcscript │ ├── basic Loop.mcscript │ ├── basic Modal.mcscript │ ├── boolean.mcscript │ ├── comments.mcscript │ ├── consts.mcscript │ ├── debugging.mcscript │ ├── do-while-Loops.mcscript │ ├── file Loop.mcscript │ ├── file Setup.mcscript │ ├── forEach.mcscript │ ├── function.mcscript │ ├── global.gl.mcscript │ ├── groups.mcscript │ ├── jsmodal.mcfunction │ ├── maps.mcscript │ ├── modaljs.mcscript │ ├── raycasting.mcscript │ ├── switches.mcscript │ └── while-Loops.mcscript ├── lib ├── consoletheme.js ├── forWeb.js ├── gen_new.js ├── generator.js ├── index.js ├── lexer.js ├── modals │ ├── basic.json │ ├── basic.mcscript │ └── cam.json └── parser.js ├── monaco monarch Highlighter.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | lib/modals/cam.mcscript 4 | examples - Kopie 5 | examples/function 6 | examples 7 | mcscript.tmlanguage.json 8 | Nodepad++ Highlighter.xml 9 | _changelog.md 10 | Core Modals.md 11 | README-DE.md 12 | .bat -------------------------------------------------------------------------------- /Core Modals.md: -------------------------------------------------------------------------------- 1 | # Minecraft Script Core Modals 2 | `- parameter -` 3 | 4 | ` [optional] ` 5 | 6 | ` ` 7 | 8 | ` this | or that` 9 | ### console 10 | > `log( - text - , [target entity] )` 11 | 12 | Logs a message into the Minecraft Chat. 13 | 14 | ### log variable 15 | > `log.var( - objective - , [entityname], [target entity] )` 16 | 17 | Logs a variable into the Minecraft Chat. 18 | 19 | ### newStand 20 | > `newStand( [name] , [position], [tags], [marker], [invisible], [noGravity] )` 21 | 22 | Summons a new armor_stand with opional parameters. 23 | 24 | ### play 25 | > `play(- sound_name - , [target entiy] [type] )` 26 | 27 | Plays a sound 28 | ## Minecraft Cam Modals 29 | These are integrated Modals from my Camera Datapack for Mapmaking. 30 | Install it [here](https://github.com/Stevertus/McCam). 31 | ### cam.pos1 32 | > `cam.pos1( [location ] , [rotation ] )` 33 | 34 | Sets the first position to a optional point. 35 | ### cam.pos2 36 | > `cam.pos2( [location ] , [rotation ] )` 37 | 38 | Sets the second position to a optional point. 39 | ### cam.start 40 | > `cam.start( [entity] )` 41 | 42 | Starts the camera process. 43 | ### cam.stop 44 | > `cam.stop( [entity] )` 45 | 46 | Stops the camera process. 47 | ### cam.time 48 | > `cam.time( length , [entity] )` 49 | 50 | Sets the cam duration to a custom value (for an optional entity). 51 | ### cam.noParticles 52 | > `cam.noParticles( [entity] )` 53 | 54 | Disables the particles for the given entity. 55 | 56 | ### cam.noText 57 | > `cam.noText( [entity] )` 58 | 59 | Disables the messages for the given entity. 60 | -------------------------------------------------------------------------------- /License: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Nodepad++ Highlighter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 00# 00// 01a-z 02 03 04 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | / ! = , # // 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | as at if offset run store unless align x xy xz y yx yz z zy zx xyz xzy yxz yzx zyx zxy asat dimension 29 | advancement ban banlist data clear clone debug defaultgamemode deop difficulty effect execute experience fill function gamemode gamerule give help kick kill list locate me msg op pardon pardon-ip particle playsound publish recipe reload replaceitem save-all save-off save-on say scoreboard seed setblock setidletimeout setworldspawn spawnpoint spreadplayers stop stopsound summon tag team teleport tell tellraw time title trigger w weather whitelist worldborder xp 30 | grant revoke start stop set add remove merge entity block #file #extend 31 | minecraft: paint: inventory. weapon. ActiveEffects: Team: PersistenceRequired: ItemRotation: NoGravity: Marker: Invisible: Invulnerable: Small: ShowArms: Glowing: NoBasePlate: FallFlying: Tags: DisabledSlots: ArmorItems: HandItems: CustomName: display: Name: EntityTag: id: Color: Silent: NoAI: CanPlaceOn: CanDestroy Damage: Count: OnGround: Passengers: Amplifier: Duration: ShowParticles: HurtTime: master music record weather block hostile neutral player ambient voice 32 | nbt gamemode level x y z dx dy dz distance x_rotation y_rotation limit tag type sort scores 33 | ~ for if while do raycast forEach var bool boolean modal log newStand play switch case const 34 | @a @p @r @e @s 35 | 00[ 01 02] 03 04 05 06{ 07 08} 09 10 11 12" 13 14" 15 16 17 18 19 20 21 22 23 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /_changelog.md: -------------------------------------------------------------------------------- 1 | # Minecraft Script Changes 2 | 3 | > Update your Version by running: `npm install -g mcscript@latest` 4 | 5 | ### v0.2.3 6 | 7 | This will be the last update for mcscript fixing the most crucial bugs and simple requests. Thank you so much for all your support, all users of mcscript and the contributers for this update. 8 | 9 | - added: you can now use the keyword `trigger` after a new variables name to convert the scoreboard to trigger 10 | - added: The `in` keyword acts as a alias for `dimension` now 11 | - added: A new unless keyword which does the same as the if keyword, but negates the condition 12 | - added: aside console the Javascript `Math` object is now also accessible in the modaljs block 13 | - fixed: if keyword did not recognize variables with a fakeplayername as entity 14 | - fixed: negative numbers were not allowed 15 | - fixed: possibility to generate packs with uppercase namespaces 16 | - fixed crash if parser returned undefined 17 | - formatting and improved code readability 18 | 19 | Thanks KaidenP and viniciuslrangel for fixing annoying bugs, sorry that this release took so long. 20 | 21 | ### v0.2.2 22 | 23 | - added: log.var core modal and documentation 24 | - fixed: watch did not reset variables, modals and booleans on recompile 25 | 26 | ### v0.2.1 27 | 28 | - added: new JavaScript Modal [here](https://github.com/Stevertus/mcscript#modaljs) by cblech. 29 | - added: Map const type 30 | - added: Array const type 31 | - new structured documentation at [stevertus.com/mcscript/documentation](https://stevertus.com/mcscript/documentation) 32 | - refactored the code 33 | - fixed: extend bugs. I am very sorry that this took so long :( 34 | - fixed: forEach operation 35 | 36 | ### v0.2 37 | 38 | This is the first full release version of Minecraft Script! The language has all the necessary features now. I am open for new suggestions nevertheless. 39 | 40 | - added: a brand new error handling system. If you find some nonsense errors please report an issue and I will fix it. 41 | - added: the function and run function feature. Read more about its capabilities [here](https://github.com/Stevertus/mcscript#functions). 42 | - added: a few more debugging options with the debug keyword. Read more [here](https://github.com/Stevertus/mcscript#debugging). 43 | - added: a -fullErr flag for compile and watch to see full Errors and files references 44 | - changed: if an execute command is generated after an execute command they will be combined now. 45 | - changed: if an error accures in a file you will be notified and the other files generate nevertheless. 46 | - fixed: an load.mcfunction issue that it generates random stuff sometimes 47 | - fixed: modal calls inside modals should work again (thanks to coolsa) 48 | - fixed: the watch mode crashes no longer if an error accures 49 | - fixed: if a #file tag was added after commands the compiler used to create a file with the name of the first command 50 | 51 | ### v0.1.5 52 | 53 | - added: multiline comments 54 | - added: global variables and `.gl.mcscript` files | Take a look at the documentation. 55 | - added: save the command response in a variable `var test = run: command` 56 | - added: a replace function on constant values and modals. 57 | - added: override keyword to change old modals 58 | - fixed: the common asat issue, should run now 59 | - fixed: while declaring the same variable twice, nothing generates 60 | - changed: the watch feature. Now it generates all files on change, not only the changed 61 | - changed the overall variable handling (but outputs are the same) 62 | 63 | ### v0.1.4 64 | 65 | - added: a `mcscript add` package command 66 | - reduced file size 67 | 68 | ### v0.1.3 69 | 70 | - added: Minecraft Cam datapack modals 71 | - added: Core Modal documentation 72 | - changed: the load.mcscript will automaticly generate the mcscript/load file and execute it 73 | - changed: the corresponding file generator for load.mcscript 74 | - changed: . are now allowed in variable names 75 | - changed: the mcscript folder will be automaticly deleted! save important files!! 76 | - fixed: the forWeb.js file 77 | 78 | ### v0.1.2 79 | 80 | - changed: fixed asat to "at @s" 81 | - changed: raycasting is more accurate 82 | - changed raycast performance 83 | - added a not block operator for Raycasting 84 | - added raycast entity option 85 | - added raycast target option 86 | - added Nodepad++ Highlighting 87 | 88 | ## v0.1.1 89 | 90 | - fixed: forEach function was written uppercase, which is not allowed by Minecraft 91 | - fixed: raycast score didn´t reset and messed up 92 | - added: now cases can accept a direct value instead of "== [value]" 93 | 94 | ## v0.1 95 | 96 | - added a changelog 97 | - added table of contents for documentation 98 | - modified documentation 99 | - added asat([selector]) wrapper 100 | - added var++ and var-- 101 | - added new modal play() 102 | - changed: while executes only if the statement at entry is true now 103 | - added do-while loop 104 | - added forEach loop 105 | - added a raycast feature 106 | - added boolean variables (tags) and if check 107 | - changed: selector behaviour with variables 108 | - added a custom scripts folder for all files 109 | - added a switch functionality 110 | 111 | --- 112 | -------------------------------------------------------------------------------- /bin/add.js: -------------------------------------------------------------------------------- 1 | const http = require('https'); 2 | const fs = require('fs'); 3 | 4 | 5 | // Download File From url 6 | const download = function (url, name) { 7 | 8 | console.log("\x1b[36m", "Downloading " + name + ".zip ...", "\x1b[0m"); 9 | 10 | let file = fs.createWriteStream(name + '.zip'); 11 | let request = http.get(url, function (response) { 12 | 13 | response.pipe(file); 14 | response.on('end', () => { 15 | console.log("\x1b[32m", "Download of " + name + ".zip finished!", "\x1b[0m") 16 | }); 17 | 18 | }).on('error', function (e) { 19 | 20 | console.log("\x1b[31m", "Got error: " + e.message, "\x1b[0m"); 21 | 22 | }); 23 | }; 24 | // Add Pack (downloading pack from mediafire) 25 | exports.addPack = function (name) { 26 | 27 | let patt = new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)/); 28 | 29 | if (patt.test(name)) { 30 | 31 | download(name, "external") 32 | 33 | } else http.get("https://download1350.mediafire.com/q7aa9e774jug/oyrbdi6fbpqo1bl/mcscri%27%2B%27pt+packages.json", (res) => { 34 | 35 | res.setEncoding('utf8'); 36 | res.on('data', function (chunk) { 37 | 38 | let packs = JSON.parse(chunk); 39 | let obj = packs.find(obj => obj.name === name.toLowerCase()); 40 | 41 | if (obj && obj.url) { 42 | console.log(obj.url.slice(0, 17)); 43 | if (obj.url.slice(0, 17) === "https://github.com" || obj.url.slice(0, 16) === "http://github.com") downloadFromRedirectLink(obj.url, obj.name); 44 | 45 | else download(obj.url, obj.name) 46 | 47 | } else { 48 | 49 | let packStr = ""; 50 | packs.forEach((e, i) => { 51 | 52 | packStr += e.name; 53 | if (i !== packs.length - 1) packStr += ", " 54 | 55 | }); 56 | 57 | console.log("\x1b[31m", "Your pack was not found! Please use one of these: ", "\x1b[0m"); 58 | console.log("\x1b[36m", packStr, "\x1b[0m") 59 | 60 | } 61 | }); 62 | 63 | }).on('error', function (e) { 64 | 65 | console.log("\x1b[31m", "Got error: " + e.message, "\x1b[0m"); 66 | 67 | }); 68 | }; 69 | 70 | // Download File From Redirected-Url (in this programm mostly github.com) 71 | function downloadFromRedirectLink(url, file) { 72 | 73 | http.get(url, function (res) { 74 | 75 | if (res.statusCode !== 302) { // No redirect 76 | 77 | console.log("error: no redirect found"); 78 | return; 79 | 80 | } 81 | 82 | download(res.headers.location, file); 83 | 84 | }).on('error', function (e) { 85 | 86 | console.log("\x1b[31m", "Got error: " + e.message, "\x1b[0m"); 87 | 88 | }); 89 | } 90 | -------------------------------------------------------------------------------- /bin/modal.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | const lib = require('../lib/index.js'); 3 | lib.genModals(process.argv[2] || './'); 4 | -------------------------------------------------------------------------------- /bin/test-module.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const lib = require('../lib/index.js'); 4 | const addPack = require('./add.js'); 5 | const gen_new = require('../lib/gen_new.js'); 6 | const consoletheme = require('../lib/consoletheme.js'); 7 | 8 | let fullError = false; 9 | if(process.argv.indexOf("-fullErr") !== -1){ //does our flag exist? 10 | fullError = true; 11 | process.argv.splice(process.argv.indexOf("-fullErr"),1) 12 | } 13 | 14 | switch(process.argv[2]){ 15 | case 'compile': 16 | lib.compile(process.argv[3] || './',fullError); 17 | break; 18 | case 'watch': 19 | lib.watch(process.argv[3] || './',fullError); 20 | break; 21 | case 'modal': 22 | lib.genModals(process.argv[3] || './'); 23 | break; 24 | case 'new': 25 | if(process.argv[3]) gen_new.new(process.argv[3]); 26 | else console.log(consoletheme.FgRed,"You have to enter a datapack id!",consoletheme.Reset); 27 | break; 28 | case 'add': 29 | addPack.addPack(process.argv[3] || ""); 30 | break; 31 | default: 32 | console.log(consoletheme.FgRed,"Please select a sub command",consoletheme.Reset); 33 | break; 34 | } 35 | -------------------------------------------------------------------------------- /bin/watch.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | const lib = require('../lib/index.js'); 3 | lib.watch(process.argv[2] || './'); 4 | -------------------------------------------------------------------------------- /docs/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | mcscript 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |

404

There's nothing here.
24 | Take me home. 25 |
26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/CNAME: -------------------------------------------------------------------------------- 1 | mcscript.stevertus.com -------------------------------------------------------------------------------- /docs/assets/img/search.83621669.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/assets/js/11.0ed310e9.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[11,15,17],{242:function(t,e,n){"use strict";n.d(e,"d",(function(){return r})),n.d(e,"a",(function(){return a})),n.d(e,"i",(function(){return s})),n.d(e,"f",(function(){return u})),n.d(e,"g",(function(){return c})),n.d(e,"h",(function(){return l})),n.d(e,"b",(function(){return p})),n.d(e,"e",(function(){return f})),n.d(e,"k",(function(){return d})),n.d(e,"l",(function(){return h})),n.d(e,"c",(function(){return v})),n.d(e,"j",(function(){return m}));n(93);const r=/#.*$/,i=/\.(md|html)$/,a=/\/$/,s=/^[a-z]+:/i;function o(t){return decodeURI(t).replace(r,"").replace(i,"")}function u(t){return s.test(t)}function c(t){return/^mailto:/.test(t)}function l(t){return/^tel:/.test(t)}function p(t){if(u(t))return t;const e=t.match(r),n=e?e[0]:"",i=o(t);return a.test(i)?t:i+".html"+n}function f(t,e){const n=decodeURIComponent(t.hash),i=function(t){const e=t.match(r);if(e)return e[0]}(e);if(i&&n!==i)return!1;return o(t.path)===o(e)}function d(t,e,n){if(u(e))return{type:"external",path:e};n&&(e=function(t,e,n){const r=t.charAt(0);if("/"===r)return t;if("?"===r||"#"===r)return e+t;const i=e.split("/");n&&i[i.length-1]||i.pop();const a=t.replace(/^\//,"").split("/");for(let t=0;tfunction t(e,n,r,i=1){if("string"==typeof e)return d(n,e,r);if(Array.isArray(e))return Object.assign(d(n,e[0],r),{title:e[1]});{const a=e.children||[];return 0===a.length&&e.path?Object.assign(d(n,e.path,r),{title:e.title}):{type:"group",path:e.path,title:e.title,sidebarDepth:e.sidebarDepth,initialOpenGroupIndex:e.initialOpenGroupIndex,children:a.map(e=>t(e,n,r,i+1)),collapsable:!1!==e.collapsable}}}(t,i,n)):[]}return[]}function g(t){const e=v(t.headers||[]);return[{type:"group",collapsable:!1,title:t.title,path:null,children:e.map(e=>({type:"auto",title:e.title,basePath:t.path,path:t.path+"#"+e.slug,children:e.children||[]}))}]}function v(t){let e;return(t=t.map(t=>Object.assign({},t))).forEach(t=>{2===t.level?e=t:e&&(e.children||(e.children=[])).push(t)}),t.filter(t=>2===t.level)}function m(t){return Object.assign(t,{type:t.items&&t.items.length?"links":"link"})}},249:function(t,e){t.exports=function(t){return null==t}},251:function(t,e,n){},252:function(t,e,n){},262:function(t,e,n){"use strict";n(251)},263:function(t,e,n){var r=n(14),i=n(6),a=n(12);t.exports=function(t){return"string"==typeof t||!i(t)&&a(t)&&"[object String]"==r(t)}},264:function(t,e,n){"use strict";n(252)},265:function(t,e,n){},270:function(t,e,n){"use strict";n.r(e);var r=n(249),i=n.n(r),a=n(242),s={name:"PageEdit",computed:{lastUpdated(){return this.$page.lastUpdated},lastUpdatedText(){return"string"==typeof this.$themeLocaleConfig.lastUpdated?this.$themeLocaleConfig.lastUpdated:"string"==typeof this.$site.themeConfig.lastUpdated?this.$site.themeConfig.lastUpdated:"Last Updated"},editLink(){const t=i()(this.$page.frontmatter.editLink)?this.$site.themeConfig.editLinks:this.$page.frontmatter.editLink,{repo:e,docsDir:n="",docsBranch:r="master",docsRepo:a=e}=this.$site.themeConfig;return t&&a&&this.$page.relativePath?this.createEditLink(e,a,n,r,this.$page.relativePath):null},editLinkText(){return this.$themeLocaleConfig.editLinkText||this.$site.themeConfig.editLinkText||"Edit this page"}},methods:{createEditLink(t,e,n,r,i){if(/bitbucket.org/.test(e)){return e.replace(a.a,"")+"/src"+`/${r}/`+(n?n.replace(a.a,"")+"/":"")+i+`?mode=edit&spa=0&at=${r}&fileviewer=file-view-default`}if(/gitlab.com/.test(e)){return e.replace(a.a,"")+"/-/edit"+`/${r}/`+(n?n.replace(a.a,"")+"/":"")+i}return(a.i.test(e)?e:"https://github.com/"+e).replace(a.a,"")+"/edit"+`/${r}/`+(n?n.replace(a.a,"")+"/":"")+i}}},o=(n(262),n(17)),u=Object(o.a)(s,(function(){var t=this,e=t._self._c;return e("footer",{staticClass:"page-edit"},[t.editLink?e("div",{staticClass:"edit-link"},[e("a",{attrs:{href:t.editLink,target:"_blank",rel:"noopener noreferrer"}},[t._v(t._s(t.editLinkText))]),t._v(" "),e("OutboundLink")],1):t._e(),t._v(" "),t.lastUpdated?e("div",{staticClass:"last-updated"},[e("span",{staticClass:"prefix"},[t._v(t._s(t.lastUpdatedText)+":")]),t._v(" "),e("span",{staticClass:"time"},[t._v(t._s(t.lastUpdated))])]):t._e()])}),[],!1,null,null,null);e.default=u.exports},271:function(t,e,n){"use strict";n.r(e);n(93);var r=n(242),i=n(263),a=n.n(i),s=n(249),o=n.n(s),u={name:"PageNav",props:["sidebarItems"],computed:{prev(){return l(c.PREV,this)},next(){return l(c.NEXT,this)}}};const c={NEXT:{resolveLink:function(t,e){return p(t,e,1)},getThemeLinkConfig:({nextLinks:t})=>t,getPageLinkConfig:({frontmatter:t})=>t.next},PREV:{resolveLink:function(t,e){return p(t,e,-1)},getThemeLinkConfig:({prevLinks:t})=>t,getPageLinkConfig:({frontmatter:t})=>t.prev}};function l(t,{$themeConfig:e,$page:n,$route:i,$site:s,sidebarItems:u}){const{resolveLink:c,getThemeLinkConfig:l,getPageLinkConfig:p}=t,f=l(e),d=p(n),h=o()(d)?f:d;return!1===h?void 0:a()(h)?Object(r.k)(s.pages,h,i.path):c(n,u)}function p(t,e,n){const r=[];!function t(e,n){for(let r=0,i=e.length;rfunction t(e,n,i,r=1){if("string"==typeof e)return f(n,e,i);if(Array.isArray(e))return Object.assign(f(n,e[0],i),{title:e[1]});{const s=e.children||[];return 0===s.length&&e.path?Object.assign(f(n,e.path,i),{title:e.title}):{type:"group",path:e.path,title:e.title,sidebarDepth:e.sidebarDepth,initialOpenGroupIndex:e.initialOpenGroupIndex,children:s.map(e=>t(e,n,i,r+1)),collapsable:!1!==e.collapsable}}}(t,r,n)):[]}return[]}function m(t){const e=b(t.headers||[]);return[{type:"group",collapsable:!1,title:t.title,path:null,children:e.map(e=>({type:"auto",title:e.title,basePath:t.path,path:t.path+"#"+e.slug,children:e.children||[]}))}]}function b(t){let e;return(t=t.map(t=>Object.assign({},t))).forEach(t=>{2===t.level?e=t:e&&(e.children||(e.children=[])).push(t)}),t.filter(t=>2===t.level)}function g(t){return Object.assign(t,{type:t.items&&t.items.length?"links":"link"})}},243:function(t,e,n){},244:function(t,e,n){"use strict";n.r(e);var i=n(242),r={name:"NavLink",props:{item:{required:!0}},computed:{link(){return Object(i.b)(this.item.link)},exact(){return this.$site.locales?Object.keys(this.$site.locales).some(t=>t===this.link):"/"===this.link},isNonHttpURI(){return Object(i.g)(this.link)||Object(i.h)(this.link)},isBlankTarget(){return"_blank"===this.target},isInternal(){return!Object(i.f)(this.link)&&!this.isBlankTarget},target(){return this.isNonHttpURI?null:this.item.target?this.item.target:Object(i.f)(this.link)?"_blank":""},rel(){return this.isNonHttpURI||!1===this.item.rel?null:this.item.rel?this.item.rel:this.isBlankTarget?"noopener noreferrer":null}},methods:{focusoutAction(){this.$emit("focusout")}}},s=n(17),a=Object(s.a)(r,(function(){var t=this,e=t._self._c;return t.isInternal?e("RouterLink",{staticClass:"nav-link",attrs:{to:t.link,exact:t.exact},nativeOn:{focusout:function(e){return t.focusoutAction.apply(null,arguments)}}},[t._v("\n "+t._s(t.item.text)+"\n")]):e("a",{staticClass:"nav-link external",attrs:{href:t.link,target:t.target,rel:t.rel},on:{focusout:t.focusoutAction}},[t._v("\n "+t._s(t.item.text)+"\n "),t.isBlankTarget?e("OutboundLink"):t._e()],1)}),[],!1,null,null,null);e.default=a.exports},245:function(t,e,n){"use strict";n.r(e);var i={name:"DropdownTransition",methods:{setHeight(t){t.style.height=t.scrollHeight+"px"},unsetHeight(t){t.style.height=""}}},r=(n(246),n(17)),s=Object(r.a)(i,(function(){return(0,this._self._c)("transition",{attrs:{name:"dropdown"},on:{enter:this.setHeight,"after-enter":this.unsetHeight,"before-leave":this.setHeight}},[this._t("default")],2)}),[],!1,null,null,null);e.default=s.exports},246:function(t,e,n){"use strict";n(243)},247:function(t,e,n){},250:function(t,e,n){},254:function(t,e,n){"use strict";n(247)},257:function(t,e,n){"use strict";n.r(e);var i=n(244),r=n(245),s=n(94),a=n.n(s),o={name:"DropdownLink",components:{NavLink:i.default,DropdownTransition:r.default},props:{item:{required:!0}},data:()=>({open:!1}),computed:{dropdownAriaLabel(){return this.item.ariaLabel||this.item.text}},watch:{$route(){this.open=!1}},methods:{setOpen(t){this.open=t},isLastItemOfArray:(t,e)=>a()(e)===t,handleDropdown(){0===event.detail&&this.setOpen(!this.open)}}},l=(n(254),n(17)),u=Object(l.a)(o,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"dropdown-wrapper",class:{open:t.open}},[e("button",{staticClass:"dropdown-title",attrs:{type:"button","aria-label":t.dropdownAriaLabel},on:{click:t.handleDropdown}},[e("span",{staticClass:"title"},[t._v(t._s(t.item.text))]),t._v(" "),e("span",{staticClass:"arrow down"})]),t._v(" "),e("button",{staticClass:"mobile-dropdown-title",attrs:{type:"button","aria-label":t.dropdownAriaLabel},on:{click:function(e){return t.setOpen(!t.open)}}},[e("span",{staticClass:"title"},[t._v(t._s(t.item.text))]),t._v(" "),e("span",{staticClass:"arrow",class:t.open?"down":"right"})]),t._v(" "),e("DropdownTransition",[e("ul",{directives:[{name:"show",rawName:"v-show",value:t.open,expression:"open"}],staticClass:"nav-dropdown"},t._l(t.item.items,(function(n,i){return e("li",{key:n.link||i,staticClass:"dropdown-item"},["links"===n.type?e("h4",[t._v("\n "+t._s(n.text)+"\n ")]):t._e(),t._v(" "),"links"===n.type?e("ul",{staticClass:"dropdown-subitem-wrapper"},t._l(n.items,(function(i){return e("li",{key:i.link,staticClass:"dropdown-subitem"},[e("NavLink",{attrs:{item:i},on:{focusout:function(e){t.isLastItemOfArray(i,n.items)&&t.isLastItemOfArray(n,t.item.items)&&t.setOpen(!1)}}})],1)})),0):e("NavLink",{attrs:{item:n},on:{focusout:function(e){t.isLastItemOfArray(n,t.item.items)&&t.setOpen(!1)}}})],1)})),0)])],1)}),[],!1,null,null,null);e.default=u.exports},261:function(t,e,n){"use strict";n(250)},268:function(t,e,n){"use strict";n.r(e);var i=n(257),r=n(242),s={name:"NavLinks",components:{NavLink:n(244).default,DropdownLink:i.default},computed:{userNav(){return this.$themeLocaleConfig.nav||this.$site.themeConfig.nav||[]},nav(){const{locales:t}=this.$site;if(t&&Object.keys(t).length>1){const e=this.$page.path,n=this.$router.options.routes,i=this.$site.themeConfig.locales||{},r={text:this.$themeLocaleConfig.selectText||"Languages",ariaLabel:this.$themeLocaleConfig.ariaLabel||"Select language",items:Object.keys(t).map(r=>{const s=t[r],a=i[r]&&i[r].label||s.lang;let o;return s.lang===this.$lang?o=e:(o=e.replace(this.$localeConfig.path,r),n.some(t=>t.path===o)||(o=r)),{text:a,link:o}})};return[...this.userNav,r]}return this.userNav},userLinks(){return(this.nav||[]).map(t=>Object.assign(Object(r.j)(t),{items:(t.items||[]).map(r.j)}))},repoLink(){const{repo:t}=this.$site.themeConfig;return t?/^https?:/.test(t)?t:"https://github.com/"+t:null},repoLabel(){if(!this.repoLink)return;if(this.$site.themeConfig.repoLabel)return this.$site.themeConfig.repoLabel;const t=this.repoLink.match(/^https?:\/\/[^/]+/)[0],e=["GitHub","GitLab","Bitbucket"];for(let n=0;n({placeholder:void 0}),watch:{$lang(e){this.update(this.options,e)},options(e){this.update(e,this.$lang)}},mounted(){this.initialize(this.options,this.$lang),this.placeholder=this.$site.themeConfig.searchPlaceholder||""},methods:{initialize(e,t){Promise.all([Promise.all([a.e(0),a.e(9)]).then(a.t.bind(null,301,7)),Promise.all([a.e(0),a.e(9)]).then(a.t.bind(null,302,7))]).then(([a])=>{a=a.default;const{algoliaOptions:i={}}=e;a(Object.assign({},e,{inputSelector:"#algolia-search-input",algoliaOptions:{...i,facetFilters:["lang:"+t].concat(i.facetFilters||[])},handleSelected:(e,t,a)=>{const{pathname:i,hash:n}=new URL(a.url),r=i.replace(this.$site.base,"/"),s=decodeURIComponent(n);this.$router.push(`${r}${s}`)}}))})},update(e,t){this.$el.innerHTML='',this.initialize(e,t)}}},n=(a(292),a(17)),r=Object(n.a)(i,(function(){var e=this._self._c;return e("form",{staticClass:"algolia-search-wrapper search-box",attrs:{id:"search-form",role:"search"}},[e("input",{staticClass:"search-query",attrs:{id:"algolia-search-input",placeholder:this.placeholder}})])}),[],!1,null,null,null);t.default=r.exports}}]); -------------------------------------------------------------------------------- /docs/assets/js/14.7ad13bec.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[14,20,22],{242:function(t,e,n){"use strict";n.d(e,"d",(function(){return i})),n.d(e,"a",(function(){return s})),n.d(e,"i",(function(){return o})),n.d(e,"f",(function(){return l})),n.d(e,"g",(function(){return u})),n.d(e,"h",(function(){return c})),n.d(e,"b",(function(){return p})),n.d(e,"e",(function(){return f})),n.d(e,"k",(function(){return h})),n.d(e,"l",(function(){return d})),n.d(e,"c",(function(){return b})),n.d(e,"j",(function(){return g}));n(93);const i=/#.*$/,r=/\.(md|html)$/,s=/\/$/,o=/^[a-z]+:/i;function a(t){return decodeURI(t).replace(i,"").replace(r,"")}function l(t){return o.test(t)}function u(t){return/^mailto:/.test(t)}function c(t){return/^tel:/.test(t)}function p(t){if(l(t))return t;const e=t.match(i),n=e?e[0]:"",r=a(t);return s.test(r)?t:r+".html"+n}function f(t,e){const n=decodeURIComponent(t.hash),r=function(t){const e=t.match(i);if(e)return e[0]}(e);if(r&&n!==r)return!1;return a(t.path)===a(e)}function h(t,e,n){if(l(e))return{type:"external",path:e};n&&(e=function(t,e,n){const i=t.charAt(0);if("/"===i)return t;if("?"===i||"#"===i)return e+t;const r=e.split("/");n&&r[r.length-1]||r.pop();const s=t.replace(/^\//,"").split("/");for(let t=0;tfunction t(e,n,i,r=1){if("string"==typeof e)return h(n,e,i);if(Array.isArray(e))return Object.assign(h(n,e[0],i),{title:e[1]});{const s=e.children||[];return 0===s.length&&e.path?Object.assign(h(n,e.path,i),{title:e.title}):{type:"group",path:e.path,title:e.title,sidebarDepth:e.sidebarDepth,initialOpenGroupIndex:e.initialOpenGroupIndex,children:s.map(e=>t(e,n,i,r+1)),collapsable:!1!==e.collapsable}}}(t,r,n)):[]}return[]}function m(t){const e=b(t.headers||[]);return[{type:"group",collapsable:!1,title:t.title,path:null,children:e.map(e=>({type:"auto",title:e.title,basePath:t.path,path:t.path+"#"+e.slug,children:e.children||[]}))}]}function b(t){let e;return(t=t.map(t=>Object.assign({},t))).forEach(t=>{2===t.level?e=t:e&&(e.children||(e.children=[])).push(t)}),t.filter(t=>2===t.level)}function g(t){return Object.assign(t,{type:t.items&&t.items.length?"links":"link"})}},243:function(t,e,n){},244:function(t,e,n){"use strict";n.r(e);var i=n(242),r={name:"NavLink",props:{item:{required:!0}},computed:{link(){return Object(i.b)(this.item.link)},exact(){return this.$site.locales?Object.keys(this.$site.locales).some(t=>t===this.link):"/"===this.link},isNonHttpURI(){return Object(i.g)(this.link)||Object(i.h)(this.link)},isBlankTarget(){return"_blank"===this.target},isInternal(){return!Object(i.f)(this.link)&&!this.isBlankTarget},target(){return this.isNonHttpURI?null:this.item.target?this.item.target:Object(i.f)(this.link)?"_blank":""},rel(){return this.isNonHttpURI||!1===this.item.rel?null:this.item.rel?this.item.rel:this.isBlankTarget?"noopener noreferrer":null}},methods:{focusoutAction(){this.$emit("focusout")}}},s=n(17),o=Object(s.a)(r,(function(){var t=this,e=t._self._c;return t.isInternal?e("RouterLink",{staticClass:"nav-link",attrs:{to:t.link,exact:t.exact},nativeOn:{focusout:function(e){return t.focusoutAction.apply(null,arguments)}}},[t._v("\n "+t._s(t.item.text)+"\n")]):e("a",{staticClass:"nav-link external",attrs:{href:t.link,target:t.target,rel:t.rel},on:{focusout:t.focusoutAction}},[t._v("\n "+t._s(t.item.text)+"\n "),t.isBlankTarget?e("OutboundLink"):t._e()],1)}),[],!1,null,null,null);e.default=o.exports},245:function(t,e,n){"use strict";n.r(e);var i={name:"DropdownTransition",methods:{setHeight(t){t.style.height=t.scrollHeight+"px"},unsetHeight(t){t.style.height=""}}},r=(n(246),n(17)),s=Object(r.a)(i,(function(){return(0,this._self._c)("transition",{attrs:{name:"dropdown"},on:{enter:this.setHeight,"after-enter":this.unsetHeight,"before-leave":this.setHeight}},[this._t("default")],2)}),[],!1,null,null,null);e.default=s.exports},246:function(t,e,n){"use strict";n(243)},247:function(t,e,n){},254:function(t,e,n){"use strict";n(247)},257:function(t,e,n){"use strict";n.r(e);var i=n(244),r=n(245),s=n(94),o=n.n(s),a={name:"DropdownLink",components:{NavLink:i.default,DropdownTransition:r.default},props:{item:{required:!0}},data:()=>({open:!1}),computed:{dropdownAriaLabel(){return this.item.ariaLabel||this.item.text}},watch:{$route(){this.open=!1}},methods:{setOpen(t){this.open=t},isLastItemOfArray:(t,e)=>o()(e)===t,handleDropdown(){0===event.detail&&this.setOpen(!this.open)}}},l=(n(254),n(17)),u=Object(l.a)(a,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"dropdown-wrapper",class:{open:t.open}},[e("button",{staticClass:"dropdown-title",attrs:{type:"button","aria-label":t.dropdownAriaLabel},on:{click:t.handleDropdown}},[e("span",{staticClass:"title"},[t._v(t._s(t.item.text))]),t._v(" "),e("span",{staticClass:"arrow down"})]),t._v(" "),e("button",{staticClass:"mobile-dropdown-title",attrs:{type:"button","aria-label":t.dropdownAriaLabel},on:{click:function(e){return t.setOpen(!t.open)}}},[e("span",{staticClass:"title"},[t._v(t._s(t.item.text))]),t._v(" "),e("span",{staticClass:"arrow",class:t.open?"down":"right"})]),t._v(" "),e("DropdownTransition",[e("ul",{directives:[{name:"show",rawName:"v-show",value:t.open,expression:"open"}],staticClass:"nav-dropdown"},t._l(t.item.items,(function(n,i){return e("li",{key:n.link||i,staticClass:"dropdown-item"},["links"===n.type?e("h4",[t._v("\n "+t._s(n.text)+"\n ")]):t._e(),t._v(" "),"links"===n.type?e("ul",{staticClass:"dropdown-subitem-wrapper"},t._l(n.items,(function(i){return e("li",{key:i.link,staticClass:"dropdown-subitem"},[e("NavLink",{attrs:{item:i},on:{focusout:function(e){t.isLastItemOfArray(i,n.items)&&t.isLastItemOfArray(n,t.item.items)&&t.setOpen(!1)}}})],1)})),0):e("NavLink",{attrs:{item:n},on:{focusout:function(e){t.isLastItemOfArray(n,t.item.items)&&t.setOpen(!1)}}})],1)})),0)])],1)}),[],!1,null,null,null);e.default=u.exports}}]); -------------------------------------------------------------------------------- /docs/assets/js/15.23e5a4b1.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[15],{242:function(t,n,e){"use strict";e.d(n,"d",(function(){return r})),e.d(n,"a",(function(){return o})),e.d(n,"i",(function(){return a})),e.d(n,"f",(function(){return u})),e.d(n,"g",(function(){return c})),e.d(n,"h",(function(){return p})),e.d(n,"b",(function(){return l})),e.d(n,"e",(function(){return f})),e.d(n,"k",(function(){return h})),e.d(n,"l",(function(){return d})),e.d(n,"c",(function(){return v})),e.d(n,"j",(function(){return b}));e(93);const r=/#.*$/,i=/\.(md|html)$/,o=/\/$/,a=/^[a-z]+:/i;function s(t){return decodeURI(t).replace(r,"").replace(i,"")}function u(t){return a.test(t)}function c(t){return/^mailto:/.test(t)}function p(t){return/^tel:/.test(t)}function l(t){if(u(t))return t;const n=t.match(r),e=n?n[0]:"",i=s(t);return o.test(i)?t:i+".html"+e}function f(t,n){const e=decodeURIComponent(t.hash),i=function(t){const n=t.match(r);if(n)return n[0]}(n);if(i&&e!==i)return!1;return s(t.path)===s(n)}function h(t,n,e){if(u(n))return{type:"external",path:n};e&&(n=function(t,n,e){const r=t.charAt(0);if("/"===r)return t;if("?"===r||"#"===r)return n+t;const i=n.split("/");e&&i[i.length-1]||i.pop();const o=t.replace(/^\//,"").split("/");for(let t=0;tfunction t(n,e,r,i=1){if("string"==typeof n)return h(e,n,r);if(Array.isArray(n))return Object.assign(h(e,n[0],r),{title:n[1]});{const o=n.children||[];return 0===o.length&&n.path?Object.assign(h(e,n.path,r),{title:n.title}):{type:"group",path:n.path,title:n.title,sidebarDepth:n.sidebarDepth,initialOpenGroupIndex:n.initialOpenGroupIndex,children:o.map(n=>t(n,e,r,i+1)),collapsable:!1!==n.collapsable}}}(t,i,e)):[]}return[]}function g(t){const n=v(t.headers||[]);return[{type:"group",collapsable:!1,title:t.title,path:null,children:n.map(n=>({type:"auto",title:n.title,basePath:t.path,path:t.path+"#"+n.slug,children:n.children||[]}))}]}function v(t){let n;return(t=t.map(t=>Object.assign({},t))).forEach(t=>{2===t.level?n=t:n&&(n.children||(n.children=[])).push(t)}),t.filter(t=>2===t.level)}function b(t){return Object.assign(t,{type:t.items&&t.items.length?"links":"link"})}},249:function(t,n){t.exports=function(t){return null==t}},252:function(t,n,e){},263:function(t,n,e){var r=e(14),i=e(6),o=e(12);t.exports=function(t){return"string"==typeof t||!i(t)&&o(t)&&"[object String]"==r(t)}},264:function(t,n,e){"use strict";e(252)},271:function(t,n,e){"use strict";e.r(n);e(93);var r=e(242),i=e(263),o=e.n(i),a=e(249),s=e.n(a),u={name:"PageNav",props:["sidebarItems"],computed:{prev(){return p(c.PREV,this)},next(){return p(c.NEXT,this)}}};const c={NEXT:{resolveLink:function(t,n){return l(t,n,1)},getThemeLinkConfig:({nextLinks:t})=>t,getPageLinkConfig:({frontmatter:t})=>t.next},PREV:{resolveLink:function(t,n){return l(t,n,-1)},getThemeLinkConfig:({prevLinks:t})=>t,getPageLinkConfig:({frontmatter:t})=>t.prev}};function p(t,{$themeConfig:n,$page:e,$route:i,$site:a,sidebarItems:u}){const{resolveLink:c,getThemeLinkConfig:p,getPageLinkConfig:l}=t,f=p(n),h=l(e),d=s()(h)?f:h;return!1===d?void 0:o()(d)?Object(r.k)(a.pages,d,i.path):c(e,u)}function l(t,n,e){const r=[];!function t(n,e){for(let r=0,i=n.length;rfunction t(e,n,i,r=1){if("string"==typeof e)return d(n,e,i);if(Array.isArray(e))return Object.assign(d(n,e[0],i),{title:e[1]});{const a=e.children||[];return 0===a.length&&e.path?Object.assign(d(n,e.path,i),{title:e.title}):{type:"group",path:e.path,title:e.title,sidebarDepth:e.sidebarDepth,initialOpenGroupIndex:e.initialOpenGroupIndex,children:a.map(e=>t(e,n,i,r+1)),collapsable:!1!==e.collapsable}}}(t,r,n)):[]}return[]}function m(t){const e=g(t.headers||[]);return[{type:"group",collapsable:!1,title:t.title,path:null,children:e.map(e=>({type:"auto",title:e.title,basePath:t.path,path:t.path+"#"+e.slug,children:e.children||[]}))}]}function g(t){let e;return(t=t.map(t=>Object.assign({},t))).forEach(t=>{2===t.level?e=t:e&&(e.children||(e.children=[])).push(t)}),t.filter(t=>2===t.level)}function b(t){return Object.assign(t,{type:t.items&&t.items.length?"links":"link"})}},244:function(t,e,n){"use strict";n.r(e);var i=n(242),r={name:"NavLink",props:{item:{required:!0}},computed:{link(){return Object(i.b)(this.item.link)},exact(){return this.$site.locales?Object.keys(this.$site.locales).some(t=>t===this.link):"/"===this.link},isNonHttpURI(){return Object(i.g)(this.link)||Object(i.h)(this.link)},isBlankTarget(){return"_blank"===this.target},isInternal(){return!Object(i.f)(this.link)&&!this.isBlankTarget},target(){return this.isNonHttpURI?null:this.item.target?this.item.target:Object(i.f)(this.link)?"_blank":""},rel(){return this.isNonHttpURI||!1===this.item.rel?null:this.item.rel?this.item.rel:this.isBlankTarget?"noopener noreferrer":null}},methods:{focusoutAction(){this.$emit("focusout")}}},a=n(17),s=Object(a.a)(r,(function(){var t=this,e=t._self._c;return t.isInternal?e("RouterLink",{staticClass:"nav-link",attrs:{to:t.link,exact:t.exact},nativeOn:{focusout:function(e){return t.focusoutAction.apply(null,arguments)}}},[t._v("\n "+t._s(t.item.text)+"\n")]):e("a",{staticClass:"nav-link external",attrs:{href:t.link,target:t.target,rel:t.rel},on:{focusout:t.focusoutAction}},[t._v("\n "+t._s(t.item.text)+"\n "),t.isBlankTarget?e("OutboundLink"):t._e()],1)}),[],!1,null,null,null);e.default=s.exports},259:function(t,e,n){},272:function(t,e,n){"use strict";n(259)},284:function(t,e,n){"use strict";n.r(e);var i={name:"Home",components:{NavLink:n(244).default},computed:{data(){return this.$page.frontmatter},actionLink(){return{link:this.data.actionLink,text:this.data.actionText}}}},r=(n(272),n(17)),a=Object(r.a)(i,(function(){var t=this,e=t._self._c;return e("main",{staticClass:"home",attrs:{"aria-labelledby":null!==t.data.heroText?"main-title":null}},[e("header",{staticClass:"hero"},[t.data.heroImage?e("img",{attrs:{src:t.$withBase(t.data.heroImage),alt:t.data.heroAlt||"hero"}}):t._e(),t._v(" "),null!==t.data.heroText?e("h1",{attrs:{id:"main-title"}},[t._v("\n "+t._s(t.data.heroText||t.$title||"Hello")+"\n ")]):t._e(),t._v(" "),null!==t.data.tagline?e("p",{staticClass:"description"},[t._v("\n "+t._s(t.data.tagline||t.$description||"Welcome to your VuePress site")+"\n ")]):t._e(),t._v(" "),t.data.actionText&&t.data.actionLink?e("p",{staticClass:"action"},[e("NavLink",{staticClass:"action-button",attrs:{item:t.actionLink}})],1):t._e()]),t._v(" "),t.data.features&&t.data.features.length?e("div",{staticClass:"features"},t._l(t.data.features,(function(n,i){return e("div",{key:i,staticClass:"feature"},[e("h2",[t._v(t._s(n.title))]),t._v(" "),e("p",[t._v(t._s(n.details))])])})),0):t._e(),t._v(" "),e("Content",{staticClass:"theme-default-content custom"}),t._v(" "),t.data.footer?e("div",{staticClass:"footer"},[t._v("\n "+t._s(t.data.footer)+"\n ")]):e("Content",{staticClass:"footer",attrs:{"slot-key":"footer"}})],1)}),[],!1,null,null,null);e.default=a.exports}}]); -------------------------------------------------------------------------------- /docs/assets/js/17.ee31f493.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[17],{242:function(t,e,n){"use strict";n.d(e,"d",(function(){return i})),n.d(e,"a",(function(){return a})),n.d(e,"i",(function(){return s})),n.d(e,"f",(function(){return c})),n.d(e,"g",(function(){return u})),n.d(e,"h",(function(){return l})),n.d(e,"b",(function(){return d})),n.d(e,"e",(function(){return p})),n.d(e,"k",(function(){return f})),n.d(e,"l",(function(){return h})),n.d(e,"c",(function(){return m})),n.d(e,"j",(function(){return b}));n(93);const i=/#.*$/,r=/\.(md|html)$/,a=/\/$/,s=/^[a-z]+:/i;function o(t){return decodeURI(t).replace(i,"").replace(r,"")}function c(t){return s.test(t)}function u(t){return/^mailto:/.test(t)}function l(t){return/^tel:/.test(t)}function d(t){if(c(t))return t;const e=t.match(i),n=e?e[0]:"",r=o(t);return a.test(r)?t:r+".html"+n}function p(t,e){const n=decodeURIComponent(t.hash),r=function(t){const e=t.match(i);if(e)return e[0]}(e);if(r&&n!==r)return!1;return o(t.path)===o(e)}function f(t,e,n){if(c(e))return{type:"external",path:e};n&&(e=function(t,e,n){const i=t.charAt(0);if("/"===i)return t;if("?"===i||"#"===i)return e+t;const r=e.split("/");n&&r[r.length-1]||r.pop();const a=t.replace(/^\//,"").split("/");for(let t=0;tfunction t(e,n,i,r=1){if("string"==typeof e)return f(n,e,i);if(Array.isArray(e))return Object.assign(f(n,e[0],i),{title:e[1]});{const a=e.children||[];return 0===a.length&&e.path?Object.assign(f(n,e.path,i),{title:e.title}):{type:"group",path:e.path,title:e.title,sidebarDepth:e.sidebarDepth,initialOpenGroupIndex:e.initialOpenGroupIndex,children:a.map(e=>t(e,n,i,r+1)),collapsable:!1!==e.collapsable}}}(t,r,n)):[]}return[]}function g(t){const e=m(t.headers||[]);return[{type:"group",collapsable:!1,title:t.title,path:null,children:e.map(e=>({type:"auto",title:e.title,basePath:t.path,path:t.path+"#"+e.slug,children:e.children||[]}))}]}function m(t){let e;return(t=t.map(t=>Object.assign({},t))).forEach(t=>{2===t.level?e=t:e&&(e.children||(e.children=[])).push(t)}),t.filter(t=>2===t.level)}function b(t){return Object.assign(t,{type:t.items&&t.items.length?"links":"link"})}},249:function(t,e){t.exports=function(t){return null==t}},251:function(t,e,n){},262:function(t,e,n){"use strict";n(251)},270:function(t,e,n){"use strict";n.r(e);var i=n(249),r=n.n(i),a=n(242),s={name:"PageEdit",computed:{lastUpdated(){return this.$page.lastUpdated},lastUpdatedText(){return"string"==typeof this.$themeLocaleConfig.lastUpdated?this.$themeLocaleConfig.lastUpdated:"string"==typeof this.$site.themeConfig.lastUpdated?this.$site.themeConfig.lastUpdated:"Last Updated"},editLink(){const t=r()(this.$page.frontmatter.editLink)?this.$site.themeConfig.editLinks:this.$page.frontmatter.editLink,{repo:e,docsDir:n="",docsBranch:i="master",docsRepo:a=e}=this.$site.themeConfig;return t&&a&&this.$page.relativePath?this.createEditLink(e,a,n,i,this.$page.relativePath):null},editLinkText(){return this.$themeLocaleConfig.editLinkText||this.$site.themeConfig.editLinkText||"Edit this page"}},methods:{createEditLink(t,e,n,i,r){if(/bitbucket.org/.test(e)){return e.replace(a.a,"")+"/src"+`/${i}/`+(n?n.replace(a.a,"")+"/":"")+r+`?mode=edit&spa=0&at=${i}&fileviewer=file-view-default`}if(/gitlab.com/.test(e)){return e.replace(a.a,"")+"/-/edit"+`/${i}/`+(n?n.replace(a.a,"")+"/":"")+r}return(a.i.test(e)?e:"https://github.com/"+e).replace(a.a,"")+"/edit"+`/${i}/`+(n?n.replace(a.a,"")+"/":"")+r}}},o=(n(262),n(17)),c=Object(o.a)(s,(function(){var t=this,e=t._self._c;return e("footer",{staticClass:"page-edit"},[t.editLink?e("div",{staticClass:"edit-link"},[e("a",{attrs:{href:t.editLink,target:"_blank",rel:"noopener noreferrer"}},[t._v(t._s(t.editLinkText))]),t._v(" "),e("OutboundLink")],1):t._e(),t._v(" "),t.lastUpdated?e("div",{staticClass:"last-updated"},[e("span",{staticClass:"prefix"},[t._v(t._s(t.lastUpdatedText)+":")]),t._v(" "),e("span",{staticClass:"time"},[t._v(t._s(t.lastUpdated))])]):t._e()])}),[],!1,null,null,null);e.default=c.exports}}]); -------------------------------------------------------------------------------- /docs/assets/js/18.6835bd74.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[18],{242:function(t,e,n){"use strict";n.d(e,"d",(function(){return r})),n.d(e,"a",(function(){return a})),n.d(e,"i",(function(){return s})),n.d(e,"f",(function(){return o})),n.d(e,"g",(function(){return c})),n.d(e,"h",(function(){return l})),n.d(e,"b",(function(){return p})),n.d(e,"e",(function(){return f})),n.d(e,"k",(function(){return d})),n.d(e,"l",(function(){return h})),n.d(e,"c",(function(){return g})),n.d(e,"j",(function(){return m}));n(93);const r=/#.*$/,i=/\.(md|html)$/,a=/\/$/,s=/^[a-z]+:/i;function u(t){return decodeURI(t).replace(r,"").replace(i,"")}function o(t){return s.test(t)}function c(t){return/^mailto:/.test(t)}function l(t){return/^tel:/.test(t)}function p(t){if(o(t))return t;const e=t.match(r),n=e?e[0]:"",i=u(t);return a.test(i)?t:i+".html"+n}function f(t,e){const n=decodeURIComponent(t.hash),i=function(t){const e=t.match(r);if(e)return e[0]}(e);if(i&&n!==i)return!1;return u(t.path)===u(e)}function d(t,e,n){if(o(e))return{type:"external",path:e};n&&(e=function(t,e,n){const r=t.charAt(0);if("/"===r)return t;if("?"===r||"#"===r)return e+t;const i=e.split("/");n&&i[i.length-1]||i.pop();const a=t.replace(/^\//,"").split("/");for(let t=0;tfunction t(e,n,r,i=1){if("string"==typeof e)return d(n,e,r);if(Array.isArray(e))return Object.assign(d(n,e[0],r),{title:e[1]});{const a=e.children||[];return 0===a.length&&e.path?Object.assign(d(n,e.path,r),{title:e.title}):{type:"group",path:e.path,title:e.title,sidebarDepth:e.sidebarDepth,initialOpenGroupIndex:e.initialOpenGroupIndex,children:a.map(e=>t(e,n,r,i+1)),collapsable:!1!==e.collapsable}}}(t,i,n)):[]}return[]}function b(t){const e=g(t.headers||[]);return[{type:"group",collapsable:!1,title:t.title,path:null,children:e.map(e=>({type:"auto",title:e.title,basePath:t.path,path:t.path+"#"+e.slug,children:e.children||[]}))}]}function g(t){let e;return(t=t.map(t=>Object.assign({},t))).forEach(t=>{2===t.level?e=t:e&&(e.children||(e.children=[])).push(t)}),t.filter(t=>2===t.level)}function m(t){return Object.assign(t,{type:t.items&&t.items.length?"links":"link"})}},248:function(t,e,n){},255:function(t,e,n){"use strict";n(248)},258:function(t,e,n){"use strict";n.r(e);var r=n(242);function i(t,e,n,r,i){const a={props:{to:e,activeClass:"",exactActiveClass:""},class:{active:r,"sidebar-link":!0}};return i>2&&(a.style={"padding-left":i+"rem"}),t("RouterLink",a,n)}function a(t,e,n,s,u,o=1){return!e||o>u?null:t("ul",{class:"sidebar-sub-headers"},e.map(e=>{const c=Object(r.e)(s,n+"#"+e.slug);return t("li",{class:"sidebar-sub-header"},[i(t,n+"#"+e.slug,e.title,c,e.level-1),a(t,e.children,n,s,u,o+1)])}))}var s={functional:!0,props:["item","sidebarDepth"],render(t,{parent:{$page:e,$site:n,$route:s,$themeConfig:u,$themeLocaleConfig:o},props:{item:c,sidebarDepth:l}}){const p=Object(r.e)(s,c.path),f="auto"===c.type?p||c.children.some(t=>Object(r.e)(s,c.basePath+"#"+t.slug)):p,d="external"===c.type?function(t,e,n){return t("a",{attrs:{href:e,target:"_blank",rel:"noopener noreferrer"},class:{"sidebar-link":!0}},[n,t("OutboundLink")])}(t,c.path,c.title||c.path):i(t,c.path,c.title||c.path,f),h=[e.frontmatter.sidebarDepth,l,o.sidebarDepth,u.sidebarDepth,1].find(t=>void 0!==t),b=o.displayAllHeaders||u.displayAllHeaders;if("auto"===c.type)return[d,a(t,c.children,c.basePath,s,h)];if((f||b)&&c.headers&&!r.d.test(c.path)){return[d,a(t,Object(r.c)(c.headers),c.path,s,h)]}return d}},u=(n(255),n(17)),o=Object(u.a)(s,void 0,void 0,!1,null,null,null);e.default=o.exports}}]); -------------------------------------------------------------------------------- /docs/assets/js/19.45b387b0.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[19],{283:function(t,e,n){},298:function(t,e,n){"use strict";n(283)},303:function(t,e,n){"use strict";n.r(e);var s=n(13),a=n(1);const o={"/":{message:"New content is available.",buttonText:"Refresh"},"/zh/":{message:"发现新内容可用",buttonText:"刷新"},"/ru/":{message:"Доступен новый контент.",buttonText:"Обновить"},"/uk/":{message:"Доступний новий контент.",buttonText:"Оновити"},"/ja/":{message:"新しいコンテンツがあります。",buttonText:"更新する"},"/es/":{message:"Hay nuevo contenido disponible.",buttonText:"Actualizar"}};var u={name:"SWUpdatePopup",data:()=>({rawPopupConfig:!0,updateEvent:null}),computed:{popupConfig(){return Object(a.g)(this,this.rawPopupConfig)},enabled(){return Boolean(this.popupConfig&&this.updateEvent)},message(){const t=this.popupConfig;return t&&t.message||o["/"].message},buttonText(){const t=this.popupConfig;return t&&t.buttonText||o["/"].buttonText}},created(){s.a.$on("sw-updated",this.onSWUpdated),this.rawPopupConfig=o},methods:{onSWUpdated(t){this.updateEvent=t},reload(){this.updateEvent&&(this.updateEvent.skipWaiting().then(()=>{location.reload(!0)}),this.updateEvent=null)}}},p=(n(298),n(17)),i=Object(p.a)(u,(function(){var t=this,e=t._self._c;return e("transition",{attrs:{name:"sw-update-popup"}},[t._t("default",(function(){return[t.enabled?e("div",{staticClass:"sw-update-popup"},[t._v("\n "+t._s(t.message)+"\n\n "),e("br"),t._v(" "),e("button",{on:{click:t.reload}},[t._v("\n "+t._s(t.buttonText)+"\n ")])]):t._e()]}),{reload:t.reload,enabled:t.enabled,message:t.message,buttonText:t.buttonText})],2)}),[],!1,null,"fec8b358",null);e.default=i.exports}}]); -------------------------------------------------------------------------------- /docs/assets/js/20.1738fba5.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[20],{243:function(t,e,n){},245:function(t,e,n){"use strict";n.r(e);var s={name:"DropdownTransition",methods:{setHeight(t){t.style.height=t.scrollHeight+"px"},unsetHeight(t){t.style.height=""}}},i=(n(246),n(17)),o=Object(i.a)(s,(function(){return(0,this._self._c)("transition",{attrs:{name:"dropdown"},on:{enter:this.setHeight,"after-enter":this.unsetHeight,"before-leave":this.setHeight}},[this._t("default")],2)}),[],!1,null,null,null);e.default=o.exports},246:function(t,e,n){"use strict";n(243)}}]); -------------------------------------------------------------------------------- /docs/assets/js/21.4d692b32.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[21],{260:function(t,c,n){},273:function(t,c,n){"use strict";n(260)},287:function(t,c,n){"use strict";n.r(c);n(273);var i=n(17),s=Object(i.a)({},(function(){var t=this,c=t._self._c;return c("div",{staticClass:"sidebar-button",on:{click:function(c){return t.$emit("toggle-sidebar")}}},[c("svg",{staticClass:"icon",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",viewBox:"0 0 448 512"}},[c("path",{attrs:{fill:"currentColor",d:"M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"}})])])}),[],!1,null,null,null);c.default=s.exports}}]); -------------------------------------------------------------------------------- /docs/assets/js/22.1731b443.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[22],{242:function(t,n,e){"use strict";e.d(n,"d",(function(){return r})),e.d(n,"a",(function(){return s})),e.d(n,"i",(function(){return u})),e.d(n,"f",(function(){return a})),e.d(n,"g",(function(){return l})),e.d(n,"h",(function(){return c})),e.d(n,"b",(function(){return f})),e.d(n,"e",(function(){return h})),e.d(n,"k",(function(){return p})),e.d(n,"l",(function(){return d})),e.d(n,"c",(function(){return b})),e.d(n,"j",(function(){return m}));e(93);const r=/#.*$/,i=/\.(md|html)$/,s=/\/$/,u=/^[a-z]+:/i;function o(t){return decodeURI(t).replace(r,"").replace(i,"")}function a(t){return u.test(t)}function l(t){return/^mailto:/.test(t)}function c(t){return/^tel:/.test(t)}function f(t){if(a(t))return t;const n=t.match(r),e=n?n[0]:"",i=o(t);return s.test(i)?t:i+".html"+e}function h(t,n){const e=decodeURIComponent(t.hash),i=function(t){const n=t.match(r);if(n)return n[0]}(n);if(i&&e!==i)return!1;return o(t.path)===o(n)}function p(t,n,e){if(a(n))return{type:"external",path:n};e&&(n=function(t,n,e){const r=t.charAt(0);if("/"===r)return t;if("?"===r||"#"===r)return n+t;const i=n.split("/");e&&i[i.length-1]||i.pop();const s=t.replace(/^\//,"").split("/");for(let t=0;tfunction t(n,e,r,i=1){if("string"==typeof n)return p(e,n,r);if(Array.isArray(n))return Object.assign(p(e,n[0],r),{title:n[1]});{const s=n.children||[];return 0===s.length&&n.path?Object.assign(p(e,n.path,r),{title:n.title}):{type:"group",path:n.path,title:n.title,sidebarDepth:n.sidebarDepth,initialOpenGroupIndex:n.initialOpenGroupIndex,children:s.map(n=>t(n,e,r,i+1)),collapsable:!1!==n.collapsable}}}(t,i,e)):[]}return[]}function g(t){const n=b(t.headers||[]);return[{type:"group",collapsable:!1,title:t.title,path:null,children:n.map(n=>({type:"auto",title:n.title,basePath:t.path,path:t.path+"#"+n.slug,children:n.children||[]}))}]}function b(t){let n;return(t=t.map(t=>Object.assign({},t))).forEach(t=>{2===t.level?n=t:n&&(n.children||(n.children=[])).push(t)}),t.filter(t=>2===t.level)}function m(t){return Object.assign(t,{type:t.items&&t.items.length?"links":"link"})}},244:function(t,n,e){"use strict";e.r(n);var r=e(242),i={name:"NavLink",props:{item:{required:!0}},computed:{link(){return Object(r.b)(this.item.link)},exact(){return this.$site.locales?Object.keys(this.$site.locales).some(t=>t===this.link):"/"===this.link},isNonHttpURI(){return Object(r.g)(this.link)||Object(r.h)(this.link)},isBlankTarget(){return"_blank"===this.target},isInternal(){return!Object(r.f)(this.link)&&!this.isBlankTarget},target(){return this.isNonHttpURI?null:this.item.target?this.item.target:Object(r.f)(this.link)?"_blank":""},rel(){return this.isNonHttpURI||!1===this.item.rel?null:this.item.rel?this.item.rel:this.isBlankTarget?"noopener noreferrer":null}},methods:{focusoutAction(){this.$emit("focusout")}}},s=e(17),u=Object(s.a)(i,(function(){var t=this,n=t._self._c;return t.isInternal?n("RouterLink",{staticClass:"nav-link",attrs:{to:t.link,exact:t.exact},nativeOn:{focusout:function(n){return t.focusoutAction.apply(null,arguments)}}},[t._v("\n "+t._s(t.item.text)+"\n")]):n("a",{staticClass:"nav-link external",attrs:{href:t.link,target:t.target,rel:t.rel},on:{focusout:t.focusoutAction}},[t._v("\n "+t._s(t.item.text)+"\n "),t.isBlankTarget?n("OutboundLink"):t._e()],1)}),[],!1,null,null,null);n.default=u.exports}}]); -------------------------------------------------------------------------------- /docs/assets/js/24.b1ba9dd1.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[24],{311:function(a,t,e){"use strict";e.r(t);var r=e(17),c=Object(r.a)({},(function(){var a=this,t=a._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[t("h1",{attrs:{id:"_2-cli-commands"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-cli-commands"}},[a._v("#")]),a._v(" 2) CLI Commands")]),a._v(" "),t("p",[a._v("You can now use the tool by launching the Command Line in your datapacks folder"),t("br"),a._v("\n(with Shift + rightclick on directory -> open command line)"),t("br"),a._v("\nNow you can use the commands like that:")]),a._v(" "),t("h2",{attrs:{id:"_2-1-mcscript-new"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-mcscript-new"}},[a._v("#")]),a._v(" 2.1 mcscript new")]),a._v(" "),t("p",[a._v("Creates a new datapack for you with all basic files in a scripts folder. Takes as argument the datapack id!")]),a._v(" "),t("h2",{attrs:{id:"_2-2-mcscript-compile"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-mcscript-compile"}},[a._v("#")]),a._v(" 2.2 mcscript compile")]),a._v(" "),t("p",[a._v("This command converts all .mcscript files into .mcfunction format. You can read "),t("a",{attrs:{href:"#syntax"}},[a._v("here")]),a._v(" what you can do in the mcscript files."),t("br"),a._v("\nThe console displays all generated files or throws an error if something was not correct.")]),a._v(" "),t("p",[a._v("Alternatively you can use "),t("code",[a._v("mcscript compile *filepath*")]),a._v(" to set an custom directory or file.\nWith an additional "),t("code",[a._v("-fullErr")]),a._v(" flag you can view full errors and code positions.")]),a._v(" "),t("h2",{attrs:{id:"_2-3-mcscript-watch"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-mcscript-watch"}},[a._v("#")]),a._v(" 2.3 mcscript watch")]),a._v(" "),t("p",[a._v("This will automatically compile your code if you make any changes (save). So you do not have to enter the above command with every change.")]),a._v(" "),t("p",[a._v("Again, a path and "),t("code",[a._v("-fullErr")]),a._v(" can be specified.")]),a._v(" "),t("h2",{attrs:{id:"_2-4-mcscript-add-url-or-package"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-mcscript-add-url-or-package"}},[a._v("#")]),a._v(" 2.4 mcscript add [url or package]")]),a._v(" "),t("p",[a._v("This command adds a custom datapack to your directory.\nAs argument an url to the resource or a "),t("em",[a._v("mcScript Extension")]),a._v(" name can be used.")]),a._v(" "),t("p",[a._v("Get a list of all supported packages by running just"),t("code",[a._v("mcscript add")])]),a._v(" "),t("h2",{attrs:{id:"_2-5-dev-mcscript-modals"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-5-dev-mcscript-modals"}},[a._v("#")]),a._v(" 2.5 Dev: mcscript modals")]),a._v(" "),t("p",[a._v("!!This command is intended only for developers who want to install their modals in the compiler."),t("br"),a._v("\nA file must be specified and then the modals out of this file are written to a configuration file.")])])}),[],!1,null,null,null);t.default=c.exports}}]); -------------------------------------------------------------------------------- /docs/assets/js/26.392aa713.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[26],{312:function(e,n,r){"use strict";r.r(n);var t=r(17),a=Object(t.a)({},(function(){var e=this,n=e._self._c;return n("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[n("h1",{attrs:{id:"_2-cli-commands"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_2-cli-commands"}},[e._v("#")]),e._v(" 2) CLI Commands")]),e._v(" "),n("p",[e._v("Das Tool kannst du nun anwenden, indem du die Command Line in deinen Datapacks Ordner startest"),n("br"),e._v("\n(über Shift + Rechtsklick auf Ordner -> Eingabeaufforderung hier öffnen)"),n("br"),e._v("\nNun kannst du die Kommandos benutzen:")]),e._v(" "),n("h2",{attrs:{id:"_2-1-mcscript-new"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-mcscript-new"}},[e._v("#")]),e._v(" 2.1 mcscript new")]),e._v(" "),n("p",[e._v("Dieser Command generiert dir ein vorgefertigtes Datapack mit allen basic Dateien und einem Scripts-Ordner. Als Argument muss die Id des Packs angegeben werden!")]),e._v(" "),n("h2",{attrs:{id:"_2-2-mcscript-compile"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-mcscript-compile"}},[e._v("#")]),e._v(" 2.2 mcscript compile")]),e._v(" "),n("p",[e._v("Dieser Command wandelt alle .mcscript Dateien in .mcfunction Format um. Was in den mcscript Dateien möglich ist, kannst du hier nachlesen."),n("br"),e._v("\nIn der Konsole werden alle generierten Dateien angezeigt oder ein Fehler ausgeworfen, falls etwas nicht korrekt war.")]),e._v(" "),n("p",[e._v("Alternativ kannst mit "),n("code",[e._v("mcscript compile *filepath*")]),e._v(" einen speziellen Pfad oder spezielle Datei angeben.\nMit der zusätzlichen "),n("code",[e._v("-fullErr")]),e._v(" flag können ganze Fehler mit code Referenzen angezeigt werden.")]),e._v(" "),n("h2",{attrs:{id:"_2-3-mcscript-watch"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-mcscript-watch"}},[e._v("#")]),e._v(" 2.3 mcscript watch")]),e._v(" "),n("p",[e._v("Hiermit wird dein Code automatisch compiled, wenn du irgendwelche Änderungen machst (speicherst). So musst du nicht bei jeder Änderung den obigen Command eingeben.")]),e._v(" "),n("p",[e._v("Auch hier kann ein Pfad angegeben und -fullErr verwendet werden.")]),e._v(" "),n("h2",{attrs:{id:"_2-4-mcscript-add-url-or-package"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-mcscript-add-url-or-package"}},[e._v("#")]),e._v(" 2.4 mcscript add [url or package]")]),e._v(" "),n("p",[e._v("Dieser Conmmand kann ein datapack zu deiner Welt hinzufügen.\nAls Argument kann entweder eine Url direkt zur Datei oder der Name einer mcScript Extension genutzt werden.")]),e._v(" "),n("p",[e._v("Eine Liste aller McScript Extensions kann bekommen werden mit "),n("code",[e._v("mcscript add")])]),e._v(" "),n("h2",{attrs:{id:"_2-4-dev-mcscript-modals"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-dev-mcscript-modals"}},[e._v("#")]),e._v(" 2.4 Dev: mcscript modals")]),e._v(" "),n("p",[e._v("!!Dieser Command ist nur für Entwicker gedacht, die ihre Modals in den Compiler einbauen wollen."),n("br"),e._v("\nEs muss eine Datei angegeben werden und die Modals aus dieser Datei werden dann in eine Konfigurationsdatei geschrieben.")])])}),[],!1,null,null,null);n.default=a.exports}}]); -------------------------------------------------------------------------------- /docs/assets/js/27.e7f229ed.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[27],{314:function(e,n,t){"use strict";t.r(n);var a=t(17),i=Object(a.a)({},(function(){var e=this,n=e._self._c;return n("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[n("h1",{attrs:{id:"_3-file-system"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_3-file-system"}},[e._v("#")]),e._v(" 3) File system")]),e._v(" "),n("h2",{attrs:{id:"_3-1-file-setup"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-file-setup"}},[e._v("#")]),e._v(" 3.1 File setup")]),e._v(" "),n("p",[e._v("In einem Minecraft Datapack können alle Datein in ein scripts Ordner gepackt werden, um dann in "),n("code",[e._v("/functions")]),e._v(" den Output zu generieren.\nEs werden immer Dateien mit gleichem Namen, wie ihr Root generiert.")]),e._v(" "),n("p",[e._v("Ein benutzerdefinierter Name kann mit "),n("code",[e._v("#file: *name*")]),e._v(" gesetzt werden."),n("br"),e._v("\nBitte ohne "),n("code",[e._v(".mcfunction")]),e._v("!!")]),e._v(" "),n("p",[e._v("Statt des Namen kann auch gleich ein ganzer Pfad, an dem die neue Datei sein soll, angegeben werden:")]),e._v(" "),n("ul",[n("li",[n("code",[e._v("#file: C:/test/neu")])]),e._v(" "),n("li",[n("code",[e._v("#file: ./neu")]),e._v(" (Im gleichen Ordner)")]),e._v(" "),n("li",[n("code",[e._v("#file: ./unterordner/neu")])]),e._v(" "),n("li",[n("code",[e._v("#file: ../neu")]),e._v(" (Ein Ordner dadrüber)")]),e._v(" "),n("li",[n("code",[e._v("#file: ../unterordner/neu")])])]),e._v(" "),n("p",[e._v("Es können auch mehrere Dateien spezifiziert werden:")]),e._v(" "),n("div",{staticClass:"language- extra-class"},[n("pre",[n("code",[e._v("#file: neu\n//commands hier\n#file: zwei\n//Commands für zwei hier\n")])])]),n("p",[e._v("Auch sehr gut mit "),n("a",{attrs:{href:"#loops"}},[e._v("for-loops")]),e._v(" kombinierbar:")]),e._v(" "),n("div",{staticClass:"language- extra-class"},[n("pre",[n("code",[e._v("#file: neu\n//commands hier\nfor(1,5){\n\t#file: test$(i)\n\t//Commands für jede Datei hier\n}\n")])])]),n("h2",{attrs:{id:"_3-2-dateien-erweitern"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-dateien-erweitern"}},[e._v("#")]),e._v(" 3.2 Dateien erweitern")]),e._v(" "),n("p",[e._v("Eine bereits bestehende Datei, vorher mit "),n("code",[e._v("#file:")]),e._v(", kann nun auch aus anderen Dateien erweitert werden und neuer Code einfach hinten drangehängt werden:")]),e._v(" "),n("div",{staticClass:"language- extra-class"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[e._v("extend: ./test\n/commands kommen hier.\n")])])]),n("h2",{attrs:{id:"_3-3-globale-dateien"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-globale-dateien"}},[e._v("#")]),e._v(" 3.3 Globale Dateien")]),e._v(" "),n("p",[n("a",{attrs:{href:"#vars"}},[e._v("Variablen")]),e._v(", "),n("a",{attrs:{href:"#consts"}},[e._v("Konstanten")]),e._v(" und "),n("a",{attrs:{href:"#modals"}},[e._v("Modals")]),e._v(" werden für jede Datei seperat gespeichert.\nJetzt kann man eine globale Datei mit der Endung "),n("code",[e._v(".gl.mcscript")]),e._v(" erstellen. Der Compiler erkennt diese automatisch und verwendet die deklarierten Objekte auch in anderen Dateien.\nSo kann man die Modals zum Beispiel in eine eigende Datei schreiben.")])])}),[],!1,null,null,null);n.default=i.exports}}]); -------------------------------------------------------------------------------- /docs/assets/js/28.c07ad597.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[28],{315:function(e,n,t){"use strict";t.r(n);var r=t(17),a=Object(r.a)({},(function(){var e=this,n=e._self._c;return n("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[n("h1",{attrs:{id:"minecraft-script-dokumentation"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#minecraft-script-dokumentation"}},[e._v("#")]),e._v(" Minecraft Script Dokumentation")]),e._v(" "),n("blockquote",[n("p",[e._v("Update 0.2.1: "),n("a",{attrs:{href:"https://github.com/Stevertus/mcscript/releases",target:"_blank",rel:"noopener noreferrer"}},[e._v("Alle Änderungen"),n("OutboundLink")],1)])]),e._v(" "),n("p",[e._v("Minecraft Script ist eine Programmiersprache für Entwickler der mcfunctions, sowie für die Minecraft Map und Package Erschaffer. Die .mcscript Dateien werden dabei zu mcfunction compiled und generiert. Dies bietet dem Entwickler erweiterte Möglichkeiten, wie zum Beispiel Modals, Loops, Variablen, Konstanten und Command-Wrapping.")]),e._v(" "),n("h1",{attrs:{id:"_1-installation"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_1-installation"}},[e._v("#")]),e._v(" 1) Installation")]),e._v(" "),n("p",[e._v("Der Compiler wird auch als "),n("a",{attrs:{href:"https://nodejs.org/en/download/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Node.js/"),n("OutboundLink")],1),e._v(" Package angeboten, das lokal auf dem PC installiert wird und viele Features mehr hat: als die Online-Version hat."),n("br"),e._v('\nz.B: Alle Dateien in einem Ordner gleichzeitig compilen, direkter Output in neuen Dateien, auf Dateiänderungen "watchen", uvm.')]),e._v(" "),n("h2",{attrs:{id:"_1-1-installation-von-node-js"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-installation-von-node-js"}},[e._v("#")]),e._v(" 1.1 Installation von Node.js")]),e._v(" "),n("p",[e._v("Für die Installation wird die Node.js Umgebung und der Node Package Manager benötigt.")]),e._v(" "),n("p",[e._v("Diese installiert man am besten über den Installer: "),n("a",{attrs:{href:"https://nodejs.org/en/download/",target:"_blank",rel:"noopener noreferrer"}},[e._v("nodejs.org/en/download/"),n("OutboundLink")],1),n("br"),e._v("\nDen einfach ausführen und installieren lassen.")]),e._v(" "),n("h2",{attrs:{id:"_1-2-installation-von-minecraft-script"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-installation-von-minecraft-script"}},[e._v("#")]),e._v(" 1.2 Installation von Minecraft Script")]),e._v(" "),n("p",[e._v("Öffne nun die Konsole deines PCs (Am besten über Suche unter CMD zu erreichen).")]),e._v(" "),n("p",[e._v("Hier muss nun dieser Command eingegeben werden:")]),e._v(" "),n("blockquote",[n("p",[n("code",[e._v("npm install -g mcscript")])])]),e._v(" "),n("p",[e._v("Bei einer erfolgreichen Antwort hast du alles richtig gemacht und kannst durchstarten.")])])}),[],!1,null,null,null);n.default=a.exports}}]); -------------------------------------------------------------------------------- /docs/assets/js/29.5b2137c1.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[29],{316:function(e,t,r){"use strict";r.r(t);var n=r(17),i=Object(n.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"_4-ides-and-syntax-highlighting"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_4-ides-and-syntax-highlighting"}},[e._v("#")]),e._v(" 4) IDEs and Syntax Highlighting")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("Visual Studio Code:\n"),t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=Stevertus.mcscript",target:"_blank",rel:"noopener noreferrer"}},[e._v("Stevertus.mcscript"),t("OutboundLink")],1)])]),e._v(" "),t("li",[t("p",[e._v("GitHubs Atom Editor:\n"),t("a",{attrs:{href:"https://atom.io/packages/mcscript",target:"_blank",rel:"noopener noreferrer"}},[e._v("mcscript"),t("OutboundLink")],1),e._v(" (credit: "),t("a",{attrs:{href:"https://github.com/TrojanerHD",target:"_blank",rel:"noopener noreferrer"}},[e._v("Trojaner"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("li",[t("p",[e._v("Notepad++:\n"),t("a",{attrs:{href:"https://github.com/Stevertus/mcscript/blob/master/Nodepad%2B%2B%20Highlighter.xml",target:"_blank",rel:"noopener noreferrer"}},[e._v("code"),t("OutboundLink")],1),e._v(" | "),t("a",{attrs:{href:"http://download1496.mediafire.com/x2k7loq5imbg/4534q4tual7zccm/Nodepad+++Highlighter.xml",target:"_blank",rel:"noopener noreferrer"}},[e._v("download"),t("OutboundLink")],1)])])]),e._v(" "),t("h2",{attrs:{id:"jetzt-bleibt-nichts-mehr-ubrig-als-happy-developing"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#jetzt-bleibt-nichts-mehr-ubrig-als-happy-developing"}},[e._v("#")]),e._v(" Jetzt bleibt nichts mehr übrig als: "),t("strong",[e._v("Happy Developing")])]),e._v(" "),t("p",[e._v("Vielen Dank an alle die Minecraft Script benutzen und diese Dokumentation gelesen haben. Bei Vorschlägen, Problemen oder Fehlern bitte mich kontaktieren.\nIch freue mich euch ebenfalls euch auf meinem Discord begrüßen zu dürfen und Vorschläge und Kritik zu hören.")])])}),[],!1,null,null,null);t.default=i.exports}}]); -------------------------------------------------------------------------------- /docs/assets/js/3.f5aa00b7.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[3,18,20],{242:function(t,e,n){"use strict";n.d(e,"d",(function(){return r})),n.d(e,"a",(function(){return s})),n.d(e,"i",(function(){return a})),n.d(e,"f",(function(){return l})),n.d(e,"g",(function(){return u})),n.d(e,"h",(function(){return c})),n.d(e,"b",(function(){return p})),n.d(e,"e",(function(){return d})),n.d(e,"k",(function(){return h})),n.d(e,"l",(function(){return f})),n.d(e,"c",(function(){return g})),n.d(e,"j",(function(){return m}));n(93);const r=/#.*$/,i=/\.(md|html)$/,s=/\/$/,a=/^[a-z]+:/i;function o(t){return decodeURI(t).replace(r,"").replace(i,"")}function l(t){return a.test(t)}function u(t){return/^mailto:/.test(t)}function c(t){return/^tel:/.test(t)}function p(t){if(l(t))return t;const e=t.match(r),n=e?e[0]:"",i=o(t);return s.test(i)?t:i+".html"+n}function d(t,e){const n=decodeURIComponent(t.hash),i=function(t){const e=t.match(r);if(e)return e[0]}(e);if(i&&n!==i)return!1;return o(t.path)===o(e)}function h(t,e,n){if(l(e))return{type:"external",path:e};n&&(e=function(t,e,n){const r=t.charAt(0);if("/"===r)return t;if("?"===r||"#"===r)return e+t;const i=e.split("/");n&&i[i.length-1]||i.pop();const s=t.replace(/^\//,"").split("/");for(let t=0;tfunction t(e,n,r,i=1){if("string"==typeof e)return h(n,e,r);if(Array.isArray(e))return Object.assign(h(n,e[0],r),{title:e[1]});{const s=e.children||[];return 0===s.length&&e.path?Object.assign(h(n,e.path,r),{title:e.title}):{type:"group",path:e.path,title:e.title,sidebarDepth:e.sidebarDepth,initialOpenGroupIndex:e.initialOpenGroupIndex,children:s.map(e=>t(e,n,r,i+1)),collapsable:!1!==e.collapsable}}}(t,i,n)):[]}return[]}function b(t){const e=g(t.headers||[]);return[{type:"group",collapsable:!1,title:t.title,path:null,children:e.map(e=>({type:"auto",title:e.title,basePath:t.path,path:t.path+"#"+e.slug,children:e.children||[]}))}]}function g(t){let e;return(t=t.map(t=>Object.assign({},t))).forEach(t=>{2===t.level?e=t:e&&(e.children||(e.children=[])).push(t)}),t.filter(t=>2===t.level)}function m(t){return Object.assign(t,{type:t.items&&t.items.length?"links":"link"})}},243:function(t,e,n){},245:function(t,e,n){"use strict";n.r(e);var r={name:"DropdownTransition",methods:{setHeight(t){t.style.height=t.scrollHeight+"px"},unsetHeight(t){t.style.height=""}}},i=(n(246),n(17)),s=Object(i.a)(r,(function(){return(0,this._self._c)("transition",{attrs:{name:"dropdown"},on:{enter:this.setHeight,"after-enter":this.unsetHeight,"before-leave":this.setHeight}},[this._t("default")],2)}),[],!1,null,null,null);e.default=s.exports},246:function(t,e,n){"use strict";n(243)},248:function(t,e,n){},253:function(t,e,n){},255:function(t,e,n){"use strict";n(248)},256:function(t,e,n){"use strict";n.r(e);var r=n(269),i=n(258),s=n(242);function a(t,e){if("group"===e.type){const n=e.path&&Object(s.e)(t,e.path),r=e.children.some(e=>"group"===e.type?a(t,e):"page"===e.type&&Object(s.e)(t,e.path));return n||r}return!1}var o={name:"SidebarLinks",components:{SidebarGroup:r.default,SidebarLink:i.default},props:["items","depth","sidebarDepth","initialOpenGroupIndex"],data(){return{openGroupIndex:this.initialOpenGroupIndex||0}},watch:{$route(){this.refreshIndex()}},created(){this.refreshIndex()},methods:{refreshIndex(){const t=function(t,e){for(let n=0;n-1&&(this.openGroupIndex=t)},toggleGroup(t){this.openGroupIndex=t===this.openGroupIndex?-1:t},isActive(t){return Object(s.e)(this.$route,t.regularPath)}}},l=n(17),u=Object(l.a)(o,(function(){var t=this,e=t._self._c;return t.items.length?e("ul",{staticClass:"sidebar-links"},t._l(t.items,(function(n,r){return e("li",{key:r},["group"===n.type?e("SidebarGroup",{attrs:{item:n,open:r===t.openGroupIndex,collapsable:n.collapsable||n.collapsible,depth:t.depth},on:{toggle:function(e){return t.toggleGroup(r)}}}):e("SidebarLink",{attrs:{"sidebar-depth":t.sidebarDepth,item:n}})],1)})),0):t._e()}),[],!1,null,null,null);e.default=u.exports},258:function(t,e,n){"use strict";n.r(e);var r=n(242);function i(t,e,n,r,i){const s={props:{to:e,activeClass:"",exactActiveClass:""},class:{active:r,"sidebar-link":!0}};return i>2&&(s.style={"padding-left":i+"rem"}),t("RouterLink",s,n)}function s(t,e,n,a,o,l=1){return!e||l>o?null:t("ul",{class:"sidebar-sub-headers"},e.map(e=>{const u=Object(r.e)(a,n+"#"+e.slug);return t("li",{class:"sidebar-sub-header"},[i(t,n+"#"+e.slug,e.title,u,e.level-1),s(t,e.children,n,a,o,l+1)])}))}var a={functional:!0,props:["item","sidebarDepth"],render(t,{parent:{$page:e,$site:n,$route:a,$themeConfig:o,$themeLocaleConfig:l},props:{item:u,sidebarDepth:c}}){const p=Object(r.e)(a,u.path),d="auto"===u.type?p||u.children.some(t=>Object(r.e)(a,u.basePath+"#"+t.slug)):p,h="external"===u.type?function(t,e,n){return t("a",{attrs:{href:e,target:"_blank",rel:"noopener noreferrer"},class:{"sidebar-link":!0}},[n,t("OutboundLink")])}(t,u.path,u.title||u.path):i(t,u.path,u.title||u.path,d),f=[e.frontmatter.sidebarDepth,c,l.sidebarDepth,o.sidebarDepth,1].find(t=>void 0!==t),b=l.displayAllHeaders||o.displayAllHeaders;if("auto"===u.type)return[h,s(t,u.children,u.basePath,a,f)];if((d||b)&&u.headers&&!r.d.test(u.path)){return[h,s(t,Object(r.c)(u.headers),u.path,a,f)]}return h}},o=(n(255),n(17)),l=Object(o.a)(a,void 0,void 0,!1,null,null,null);e.default=l.exports},266:function(t,e,n){"use strict";n(253)},269:function(t,e,n){"use strict";n.r(e);var r=n(242),i={name:"SidebarGroup",components:{DropdownTransition:n(245).default},props:["item","open","collapsable","depth"],beforeCreate(){this.$options.components.SidebarLinks=n(256).default},methods:{isActive:r.e}},s=(n(266),n(17)),a=Object(s.a)(i,(function(){var t=this,e=t._self._c;return e("section",{staticClass:"sidebar-group",class:[{collapsable:t.collapsable,"is-sub-group":0!==t.depth},"depth-"+t.depth]},[t.item.path?e("RouterLink",{staticClass:"sidebar-heading clickable",class:{open:t.open,active:t.isActive(t.$route,t.item.path)},attrs:{to:t.item.path},nativeOn:{click:function(e){return t.$emit("toggle")}}},[e("span",[t._v(t._s(t.item.title))]),t._v(" "),t.collapsable?e("span",{staticClass:"arrow",class:t.open?"down":"right"}):t._e()]):e("p",{staticClass:"sidebar-heading",class:{open:t.open},on:{click:function(e){return t.$emit("toggle")}}},[e("span",[t._v(t._s(t.item.title))]),t._v(" "),t.collapsable?e("span",{staticClass:"arrow",class:t.open?"down":"right"}):t._e()]),t._v(" "),e("DropdownTransition",[t.open||!t.collapsable?e("SidebarLinks",{staticClass:"sidebar-group-items",attrs:{items:t.item.children,"sidebar-depth":t.item.sidebarDepth,"initial-open-group-index":t.item.initialOpenGroupIndex,depth:t.depth+1}}):t._e()],1)],1)}),[],!1,null,null,null);e.default=a.exports}}]); -------------------------------------------------------------------------------- /docs/assets/js/31.05e43755.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[31],{319:function(e,a,t){"use strict";t.r(a);var s=t(17),l=Object(s.a)({},(function(){var e=this,a=e._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"_3-file-system"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-file-system"}},[e._v("#")]),e._v(" 3) File system")]),e._v(" "),a("h2",{attrs:{id:"_3-1-file-setup"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-file-setup"}},[e._v("#")]),e._v(" 3.1 File setup")]),e._v(" "),a("p",[e._v("The generated files have always the same name as their root.")]),e._v(" "),a("p",[e._v("A custom name can be set with "),a("code",[e._v("#file: *name*.")]),a("br"),e._v("\nPlease without .mcfunction!!")]),e._v(" "),a("p",[e._v("Instead of the name, you can enter a whole path where the new file should be:")]),e._v(" "),a("ul",[a("li",[a("code",[e._v("#file: C:/test/new")])]),e._v(" "),a("li",[a("code",[e._v("#file: ./new")]),e._v(" (in same directory)")]),e._v(" "),a("li",[a("code",[e._v("#file: ./subfolder/new")])]),e._v(" "),a("li",[a("code",[e._v("#file: ../new")]),e._v(" (a directory above)")]),e._v(" "),a("li",[a("code",[e._v("#file: ../subfolder/new")])])]),e._v(" "),a("p",[e._v("You can also specify several files:")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[e._v("#file: new\n//commands here\n#file: two\n//Commands for two\n")])])]),a("p",[e._v("Also very well combinable with "),a("a",{attrs:{href:"#loops"}},[e._v("for-loops")]),e._v(":")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[e._v("#file: new\n//commands here\nfor(1,5){\n\t#file: test$(i)\n\t//Commands for every file here\n}\n")])])]),a("h2",{attrs:{id:"_3-2-extend-files"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-extend-files"}},[e._v("#")]),e._v(" 3.2 Extend Files")]),e._v(" "),a("p",[e._v("A already existing file, that is generated before with "),a("code",[e._v("#file:")]),e._v(", can be expanded in other files and new code is easily attached:")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("#extend: ./test\n/commands here\n")])])]),a("h2",{attrs:{id:"_3-3-global-files"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-global-files"}},[e._v("#")]),e._v(" 3.3 Global Files")]),e._v(" "),a("p",[e._v("Variables (#vars), [constants] (#consts), and [Modals] (#modals) are stored separately for each file.\nNow you can create a global file with the extension '. gl. mcscript '. The compiler automatically detects globals and uses the declared objects in other files as well.\nFor example, you can write the modals to a separate file.")])])}),[],!1,null,null,null);a.default=l.exports}}]); -------------------------------------------------------------------------------- /docs/assets/js/32.1b6a87f1.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[32],{317:function(e,t,a){"use strict";a.r(t);var n=a(17),r=Object(n.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"minecraft-script-documentation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#minecraft-script-documentation"}},[e._v("#")]),e._v(" Minecraft Script Documentation")]),e._v(" "),t("blockquote",[t("p",[e._v("Update 0.2.3: "),t("a",{attrs:{href:"https://github.com/Stevertus/mcscript/releases",target:"_blank",rel:"noopener noreferrer"}},[e._v("All Changes"),t("OutboundLink")],1)])]),e._v(" "),t("p",[e._v("Minecraft Script is a programming language for developers of mcfunctions, Minecraft maps and packages. The .mcscript files are therefore compiled and generated to the function format. This enables the developer extended possibilities, such as Modals, Loops, Varibles, Constants and Command-Wrapping.")]),e._v(" "),t("h2",{attrs:{id:"_1-installation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-installation"}},[e._v("#")]),e._v(" 1) Installation")]),e._v(" "),t("p",[e._v("The Compiler gets offered as "),t("a",{attrs:{href:"https://nodejs.org/en/download/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Node.js/"),t("OutboundLink")],1),e._v(" Package that is installed locally on your machine. It enables much more features than the online version"),t("br"),e._v("\nFor example: compile all files in a directory, direct output in new files, watch your files on changes, etc.")]),e._v(" "),t("h3",{attrs:{id:"_1-1-installation-of-node-js"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-installation-of-node-js"}},[e._v("#")]),e._v(" 1.1 Installation of Node.js")]),e._v(" "),t("p",[e._v("The installation requires the Node.js environment and the Node Package Manager.")]),e._v(" "),t("p",[e._v("This is achieved the best way by using the installer: "),t("a",{attrs:{href:"https://nodejs.org/en/download/",target:"_blank",rel:"noopener noreferrer"}},[e._v("nodejs.org/en/download/"),t("OutboundLink")],1),t("br"),e._v("\nJust run it and install.")]),e._v(" "),t("h3",{attrs:{id:"_1-2-installation-of-minecraft-script"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-installation-of-minecraft-script"}},[e._v("#")]),e._v(" 1.2 Installation of Minecraft Script")]),e._v(" "),t("p",[e._v("Now open your PCs console. (search CMD).")]),e._v(" "),t("p",[e._v("There you have to type in this command:")]),e._v(" "),t("blockquote",[t("p",[t("code",[e._v("npm install -g mcscript")])])]),e._v(" "),t("p",[e._v("If a successful answer apears you have done everything right and can start.")])])}),[],!1,null,null,null);t.default=r.exports}}]); -------------------------------------------------------------------------------- /docs/assets/js/33.6042f44a.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[33],{318:function(t,e,r){"use strict";r.r(e);var n=r(17),a=Object(n.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"_4-ides-and-syntax-highlighting"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-ides-and-syntax-highlighting"}},[t._v("#")]),t._v(" 4) IDEs and Syntax Highlighting")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("Visual Studio Code:\n"),e("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=Stevertus.mcscript",target:"_blank",rel:"noopener noreferrer"}},[t._v("Stevertus.mcscript"),e("OutboundLink")],1)])]),t._v(" "),e("li",[e("p",[t._v("GitHubs Atom Editor:\n"),e("a",{attrs:{href:"https://atom.io/packages/mcscript",target:"_blank",rel:"noopener noreferrer"}},[t._v("mcscript"),e("OutboundLink")],1),t._v(" (credit: "),e("a",{attrs:{href:"https://github.com/TrojanerHD",target:"_blank",rel:"noopener noreferrer"}},[t._v("Trojaner"),e("OutboundLink")],1),t._v(")")])]),t._v(" "),e("li",[e("p",[t._v("Notepad++:\n"),e("a",{attrs:{href:"https://github.com/Stevertus/mcscript/blob/master/Nodepad%2B%2B%20Highlighter.xml",target:"_blank",rel:"noopener noreferrer"}},[t._v("code"),e("OutboundLink")],1),t._v(" | "),e("a",{attrs:{href:"http://download1496.mediafire.com/x2k7loq5imbg/4534q4tual7zccm/Nodepad+++Highlighter.xml",target:"_blank",rel:"noopener noreferrer"}},[t._v("download"),e("OutboundLink")],1)])])]),t._v(" "),e("p",[t._v("Now there´s nothing left than: "),e("strong",[t._v("Happy Developing")])]),t._v(" "),e("hr"),t._v(" "),e("p",[t._v("Thanks to all who use Minecraft Script and read this documentation. Contact me if you have a proposal, problem or error.")])])}),[],!1,null,null,null);e.default=a.exports}}]); -------------------------------------------------------------------------------- /docs/assets/js/35.3514db4a.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[35],{300:function(n,e,t){"use strict";t.r(e),t.d(e,"register",(function(){return o})),t.d(e,"unregister",(function(){return c}));var r;function o(n,e){void 0===e&&(e={});var t=e.registrationOptions;void 0===t&&(t={}),delete e.registrationOptions;var o=function(n){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];e&&e[n]&&e[n].apply(e,t)};"serviceWorker"in navigator&&r.then((function(){Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/))?(!function(n,e,t){fetch(n).then((function(r){404===r.status?(e("error",new Error("Service worker not found at "+n)),c()):-1===r.headers.get("content-type").indexOf("javascript")?(e("error",new Error("Expected "+n+" to have javascript content-type, but received "+r.headers.get("content-type"))),c()):a(n,e,t)})).catch((function(n){return i(e,n)}))}(n,o,t),navigator.serviceWorker.ready.then((function(n){o("ready",n)})).catch((function(n){return i(o,n)}))):(a(n,o,t),navigator.serviceWorker.ready.then((function(n){o("ready",n)})).catch((function(n){return i(o,n)})))}))}function i(n,e){navigator.onLine||n("offline"),n("error",e)}function a(n,e,t){navigator.serviceWorker.register(n,t).then((function(n){e("registered",n),n.waiting?e("updated",n):n.onupdatefound=function(){e("updatefound",n);var t=n.installing;t.onstatechange=function(){"installed"===t.state&&(navigator.serviceWorker.controller?e("updated",n):e("cached",n))}}})).catch((function(n){return i(e,n)}))}function c(){"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(n){n.unregister()})).catch((function(n){return i(emit,n)}))}"undefined"!=typeof window&&(r="undefined"!=typeof Promise?new Promise((function(n){return window.addEventListener("load",n)})):{then:function(n){return window.addEventListener("load",n)}})}}]); -------------------------------------------------------------------------------- /docs/assets/js/4.e4be212d.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[4],{280:function(t,e,n){},295:function(t,e,n){"use strict";n(280)},309:function(t,e,n){"use strict";n.r(e);var i={functional:!0,props:{type:{type:String,default:"tip"},text:String,vertical:{type:String,default:"top"}},render:(t,{props:e,slots:n})=>t("span",{class:["badge",e.type],style:{verticalAlign:e.vertical}},e.text||n().default)},p=(n(295),n(17)),l=Object(p.a)(i,void 0,void 0,!1,null,"15b7b770",null);e.default=l.exports}}]); -------------------------------------------------------------------------------- /docs/assets/js/5.65c44daf.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[5],{281:function(t,e,a){},296:function(t,e,a){"use strict";a(281)},305:function(t,e,a){"use strict";a.r(e);var s={name:"CodeBlock",props:{title:{type:String,required:!0},active:{type:Boolean,default:!1}},mounted(){this.$parent&&this.$parent.loadTabs&&this.$parent.loadTabs()}},i=(a(296),a(17)),n=Object(i.a)(s,(function(){return(0,this._self._c)("div",{staticClass:"theme-code-block",class:{"theme-code-block__active":this.active}},[this._t("default")],2)}),[],!1,null,"759a7d02",null);e.default=n.exports}}]); -------------------------------------------------------------------------------- /docs/assets/js/6.734ecb4e.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[6],{282:function(e,t,a){},297:function(e,t,a){"use strict";a(282)},306:function(e,t,a){"use strict";a.r(t);var o={name:"CodeGroup",data:()=>({codeTabs:[],activeCodeTabIndex:-1}),watch:{activeCodeTabIndex(e){this.activateCodeTab(e)}},mounted(){this.loadTabs()},methods:{changeCodeTab(e){this.activeCodeTabIndex=e},loadTabs(){this.codeTabs=(this.$slots.default||[]).filter(e=>Boolean(e.componentOptions)).map((e,t)=>(""===e.componentOptions.propsData.active&&(this.activeCodeTabIndex=t),{title:e.componentOptions.propsData.title,elm:e.elm})),-1===this.activeCodeTabIndex&&this.codeTabs.length>0&&(this.activeCodeTabIndex=0),this.activateCodeTab(0)},activateCodeTab(e){this.codeTabs.forEach(e=>{e.elm&&e.elm.classList.remove("theme-code-block__active")}),this.codeTabs[e].elm&&this.codeTabs[e].elm.classList.add("theme-code-block__active")}}},s=(a(297),a(17)),c=Object(s.a)(o,(function(){var e=this,t=e._self._c;return t("ClientOnly",[t("div",{staticClass:"theme-code-group"},[t("div",{staticClass:"theme-code-group__nav"},[t("ul",{staticClass:"theme-code-group__ul"},e._l(e.codeTabs,(function(a,o){return t("li",{key:a.title,staticClass:"theme-code-group__li"},[t("button",{staticClass:"theme-code-group__nav-tab",class:{"theme-code-group__nav-tab-active":o===e.activeCodeTabIndex},on:{click:function(t){return e.changeCodeTab(o)}}},[e._v("\n "+e._s(a.title)+"\n ")])])})),0)]),e._v(" "),e._t("default"),e._v(" "),e.codeTabs.length<1?t("pre",{staticClass:"pre-blank"},[e._v("// Make sure to add code blocks to your code group")]):e._e()],2)])}),[],!1,null,"deefee04",null);t.default=c.exports}}]); -------------------------------------------------------------------------------- /docs/assets/js/7.d77b33d9.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[7],{307:function(t,e,s){"use strict";s.r(e);const o=["There's nothing here.","How did we get here?","That's a Four-Oh-Four.","Looks like we've got some broken links."];var n={methods:{getMsg:()=>o[Math.floor(Math.random()*o.length)]}},h=s(17),i=Object(h.a)(n,(function(){var t=this._self._c;return t("div",{staticClass:"theme-container"},[t("div",{staticClass:"theme-default-content"},[t("h1",[this._v("404")]),this._v(" "),t("blockquote",[this._v(this._s(this.getMsg()))]),this._v(" "),t("RouterLink",{attrs:{to:"/"}},[this._v("\n Take me home.\n ")])],1)])}),[],!1,null,null,null);e.default=i.exports}}]); -------------------------------------------------------------------------------- /docs/code_icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/documentation_icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /docs/gitHub_icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/icons/icon-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stevertus/mcscript/91c8087032182171cf1153b0401662dc339d8676/docs/icons/icon-128x128.png -------------------------------------------------------------------------------- /docs/icons/icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stevertus/mcscript/91c8087032182171cf1153b0401662dc339d8676/docs/icons/icon-144x144.png -------------------------------------------------------------------------------- /docs/icons/icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stevertus/mcscript/91c8087032182171cf1153b0401662dc339d8676/docs/icons/icon-152x152.png -------------------------------------------------------------------------------- /docs/icons/icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stevertus/mcscript/91c8087032182171cf1153b0401662dc339d8676/docs/icons/icon-192x192.png -------------------------------------------------------------------------------- /docs/icons/icon-384x384.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stevertus/mcscript/91c8087032182171cf1153b0401662dc339d8676/docs/icons/icon-384x384.png -------------------------------------------------------------------------------- /docs/icons/icon-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stevertus/mcscript/91c8087032182171cf1153b0401662dc339d8676/docs/icons/icon-512x512.png -------------------------------------------------------------------------------- /docs/icons/icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stevertus/mcscript/91c8087032182171cf1153b0401662dc339d8676/docs/icons/icon-72x72.png -------------------------------------------------------------------------------- /docs/icons/icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stevertus/mcscript/91c8087032182171cf1153b0401662dc339d8676/docs/icons/icon-96x96.png -------------------------------------------------------------------------------- /docs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stevertus/mcscript/91c8087032182171cf1153b0401662dc339d8676/docs/logo.png -------------------------------------------------------------------------------- /docs/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mcscript Documentation", 3 | "short_name": "mcscript Documentation", 4 | "theme_color": "#86d286", 5 | "background_color": "#ffffff", 6 | "display": "standalone", 7 | "Scope": "/", 8 | "start_url": "/", 9 | "icons": [ 10 | { 11 | "src": "icons/icon-72x72.png", 12 | "sizes": "72x72", 13 | "type": "image/png" 14 | }, 15 | { 16 | "src": "icons/icon-96x96.png", 17 | "sizes": "96x96", 18 | "type": "image/png" 19 | }, 20 | { 21 | "src": "icons/icon-128x128.png", 22 | "sizes": "128x128", 23 | "type": "image/png" 24 | }, 25 | { 26 | "src": "icons/icon-144x144.png", 27 | "sizes": "144x144", 28 | "type": "image/png" 29 | }, 30 | { 31 | "src": "icons/icon-152x152.png", 32 | "sizes": "152x152", 33 | "type": "image/png" 34 | }, 35 | { 36 | "src": "icons/icon-192x192.png", 37 | "sizes": "192x192", 38 | "type": "image/png" 39 | }, 40 | { 41 | "src": "icons/icon-384x384.png", 42 | "sizes": "384x384", 43 | "type": "image/png" 44 | }, 45 | { 46 | "src": "icons/icon-512x512.png", 47 | "sizes": "512x512", 48 | "type": "image/png" 49 | } 50 | ], 51 | "splash_pages": null 52 | } -------------------------------------------------------------------------------- /docs/rocket_icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | 26 | 32 | 33 | 34 | 35 | 36 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /documentation/.vuepress/config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | title: "mcscript", 3 | description: "mcscript is a programming language for Minecraft.", 4 | head: [ 5 | ["link", { rel: "icon", href: "/logo.png" }], 6 | ["link", { rel: "manifest", href: "/manifest.json" }], 7 | ["meta", { name: "theme-color", content: "#86d286" }], 8 | ["meta", { name: "apple-mobile-web-app-capable", content: "yes" }], 9 | [ 10 | "meta", 11 | { name: "apple-mobile-web-app-status-bar-style", content: "black" }, 12 | ], 13 | ["link", { rel: "apple-touch-icon", href: "/icons/icon-152x152.png" }], 14 | [ 15 | "link", 16 | { 17 | rel: "mask-icon", 18 | href: "/icons/safari-pinned-tab.svg", 19 | color: "#86d286", 20 | }, 21 | ], 22 | [ 23 | "meta", 24 | { name: "msapplication-TileImage", content: "/icons/icon-144x144.png" }, 25 | ], 26 | ["meta", { name: "msapplication-TileColor", content: "#1069b4" }], 27 | ], 28 | dest: "../docs", 29 | themeConfig: { 30 | sidebar: "auto", 31 | logo: "/logo.png", 32 | lastUpdated: "Last Updated", 33 | nav: [ 34 | { text: "Guide", link: "/guide/" }, 35 | { text: "CLI", link: "/cli/" }, 36 | { text: "File System", link: "/files/" }, 37 | { text: "Syntax", link: "/syntax/" }, 38 | { text: "IDEs", link: "/ides/" }, 39 | ], 40 | 41 | locales: { 42 | "/": { 43 | selectText: "English", 44 | label: "English", 45 | lastUpdated: "Last Updated", 46 | serviceWorker: { 47 | updatePopup: { 48 | message: "New content is available.", 49 | buttonText: "Refresh", 50 | }, 51 | }, 52 | }, 53 | "/de/": { 54 | selectText: "Deutsch", 55 | label: "Deutsch", 56 | lastUpdated: "Zuletzt geändert", 57 | serviceWorker: { 58 | updatePopup: { 59 | message: "Neuer Inhalt ist verfügbar.", 60 | buttonText: "Refresh", 61 | }, 62 | }, 63 | }, 64 | }, 65 | }, 66 | locales: { 67 | "/": { 68 | lang: "en-US", 69 | title: "mcscript", 70 | description: "mcscript is a programming language for Minecraft.", 71 | }, 72 | "/de/": { 73 | lang: "de-DE", 74 | title: "mcscript", 75 | description: "mcscript ist eine Programmiersprache für Minecraft", 76 | }, 77 | }, 78 | plugins: [ 79 | "@vuepress/last-updated", 80 | [ 81 | "@vuepress/pwa", 82 | { 83 | serviceWorker: true, 84 | updatePopup: true, 85 | }, 86 | ], 87 | ], 88 | }; 89 | -------------------------------------------------------------------------------- /documentation/.vuepress/public/code_icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /documentation/.vuepress/public/documentation_icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /documentation/.vuepress/public/gitHub_icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /documentation/.vuepress/public/icons/icon-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stevertus/mcscript/91c8087032182171cf1153b0401662dc339d8676/documentation/.vuepress/public/icons/icon-128x128.png -------------------------------------------------------------------------------- /documentation/.vuepress/public/icons/icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stevertus/mcscript/91c8087032182171cf1153b0401662dc339d8676/documentation/.vuepress/public/icons/icon-144x144.png -------------------------------------------------------------------------------- /documentation/.vuepress/public/icons/icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stevertus/mcscript/91c8087032182171cf1153b0401662dc339d8676/documentation/.vuepress/public/icons/icon-152x152.png -------------------------------------------------------------------------------- /documentation/.vuepress/public/icons/icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stevertus/mcscript/91c8087032182171cf1153b0401662dc339d8676/documentation/.vuepress/public/icons/icon-192x192.png -------------------------------------------------------------------------------- /documentation/.vuepress/public/icons/icon-384x384.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stevertus/mcscript/91c8087032182171cf1153b0401662dc339d8676/documentation/.vuepress/public/icons/icon-384x384.png -------------------------------------------------------------------------------- /documentation/.vuepress/public/icons/icon-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stevertus/mcscript/91c8087032182171cf1153b0401662dc339d8676/documentation/.vuepress/public/icons/icon-512x512.png -------------------------------------------------------------------------------- /documentation/.vuepress/public/icons/icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stevertus/mcscript/91c8087032182171cf1153b0401662dc339d8676/documentation/.vuepress/public/icons/icon-72x72.png -------------------------------------------------------------------------------- /documentation/.vuepress/public/icons/icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stevertus/mcscript/91c8087032182171cf1153b0401662dc339d8676/documentation/.vuepress/public/icons/icon-96x96.png -------------------------------------------------------------------------------- /documentation/.vuepress/public/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stevertus/mcscript/91c8087032182171cf1153b0401662dc339d8676/documentation/.vuepress/public/logo.png -------------------------------------------------------------------------------- /documentation/.vuepress/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mcscript Documentation", 3 | "short_name": "mcscript Documentation", 4 | "theme_color": "#86d286", 5 | "background_color": "#ffffff", 6 | "display": "standalone", 7 | "Scope": "/", 8 | "start_url": "/", 9 | "icons": [ 10 | { 11 | "src": "icons/icon-72x72.png", 12 | "sizes": "72x72", 13 | "type": "image/png" 14 | }, 15 | { 16 | "src": "icons/icon-96x96.png", 17 | "sizes": "96x96", 18 | "type": "image/png" 19 | }, 20 | { 21 | "src": "icons/icon-128x128.png", 22 | "sizes": "128x128", 23 | "type": "image/png" 24 | }, 25 | { 26 | "src": "icons/icon-144x144.png", 27 | "sizes": "144x144", 28 | "type": "image/png" 29 | }, 30 | { 31 | "src": "icons/icon-152x152.png", 32 | "sizes": "152x152", 33 | "type": "image/png" 34 | }, 35 | { 36 | "src": "icons/icon-192x192.png", 37 | "sizes": "192x192", 38 | "type": "image/png" 39 | }, 40 | { 41 | "src": "icons/icon-384x384.png", 42 | "sizes": "384x384", 43 | "type": "image/png" 44 | }, 45 | { 46 | "src": "icons/icon-512x512.png", 47 | "sizes": "512x512", 48 | "type": "image/png" 49 | } 50 | ], 51 | "splash_pages": null 52 | } -------------------------------------------------------------------------------- /documentation/.vuepress/public/rocket_icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | 26 | 32 | 33 | 34 | 35 | 36 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /documentation/.vuepress/styles/palette.styl: -------------------------------------------------------------------------------- 1 | $accentColor = #86d286 2 | $borderColor = #d9d9d9 -------------------------------------------------------------------------------- /documentation/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | home: true 3 | heroImage: /logo.png 4 | title: mcscript 5 | actionText: Get Started → 6 | actionLink: /guide/ 7 | footer: MIT Licensed | Copyright © 2020 Stevertus 8 | --- 9 | 10 | 32 | 33 | 34 | ## A programming language for datapacks! 35 | 36 | Use a programming language built ontop of Minecrafts functions to add new expressions, generators and simplify development. 37 | 38 | # Get Started! 39 | 40 | Start programming with mcscript today with the help of my video course: 41 | 42 | 43 | 44 | --- 45 | 46 | ### Variables 47 | 48 | Variables can store numbers, output these and perform operations. Minecraft Script now brings them to Minecraft Vanilla. 49 | 50 | ```js 51 | var var1; 52 | var var2 = 5; 53 | 54 | var1 = 10; 55 | 56 | var2 += 5; 57 | 58 | var1 += var2; 59 | ``` 60 | 61 | ### Loops 62 | 63 | Have you ever had something that repeats itself over and over again? This is called a loop and is now also available in Minecraft! 64 | 65 | ```js 66 | for(1,5){ 67 | log($(i)) 68 | } 69 | while('entity @s[tag=loop]'){ 70 | 71 | } 72 | ``` 73 | 74 | ### Conditions And If-Statements 75 | 76 | Simply summarize If conditions and name multiple conditions. Everything is controlled by mcscript! 77 | 78 | ```js 79 | if("entity @s"){ 80 | /say entity found 81 | } 82 | 83 | // else statement 84 | if("entity @s"){ 85 | /say entity found 86 | } else { 87 | /say elsewhise command 88 | } 89 | ``` 90 | 91 | ### Clever File Handling 92 | 93 | Generate unlimited new files, merge files or use everything together in a loop. There are no limits in creativity except the space of your computer. 94 | 95 | ``` 96 | #file: file1 97 | #this is file 1 98 | 99 | #file: file2 100 | #this is file 2 101 | ``` 102 | 103 | ## Installation 104 | 105 | The installation requires the Node.js environment and the Node Package Manager. 106 | 107 | This is achieved the best way by using the installer: nodejs.org/en/download/ 108 | 109 | Install the mcscript-cli with: 110 | 111 | ```bash 112 | npm install -g mcscript 113 | ``` 114 | 115 | If a successful answer apears you have done everything right and can start. 116 | 117 | ## Get Connected With the Community and get Update 118 | 119 | 120 | -------------------------------------------------------------------------------- /documentation/cli/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar: auto 3 | footer: MIT Licensed | Copyright © 2020 Stevertus 4 | prev: /guide/ 5 | next: /files/ 6 | --- 7 | 8 | # 2) CLI Commands 9 | 10 | 11 | You can now use the tool by launching the Command Line in your datapacks folder 12 | (with Shift + rightclick on directory -> open command line) 13 | Now you can use the commands like that: 14 | 15 | ## 2.1 mcscript new 16 | 17 | Creates a new datapack for you with all basic files in a scripts folder. Takes as argument the datapack id! 18 | 19 | ## 2.2 mcscript compile 20 | 21 | This command converts all .mcscript files into .mcfunction format. You can read [here](#syntax) what you can do in the mcscript files. 22 | The console displays all generated files or throws an error if something was not correct. 23 | 24 | Alternatively you can use `mcscript compile *filepath*` to set an custom directory or file. 25 | With an additional `-fullErr` flag you can view full errors and code positions. 26 | 27 | ## 2.3 mcscript watch 28 | 29 | This will automatically compile your code if you make any changes (save). So you do not have to enter the above command with every change. 30 | 31 | Again, a path and `-fullErr` can be specified. 32 | 33 | ## 2.4 mcscript add [url or package] 34 | This command adds a custom datapack to your directory. 35 | As argument an url to the resource or a *mcScript Extension* name can be used. 36 | 37 | Get a list of all supported packages by running just`mcscript add` 38 | 39 | 40 | ## 2.5 Dev: mcscript modals 41 | 42 | !!This command is intended only for developers who want to install their modals in the compiler. 43 | A file must be specified and then the modals out of this file are written to a configuration file. -------------------------------------------------------------------------------- /documentation/de/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | home: true 3 | heroImage: /logo.png 4 | title: mcscript 5 | actionText: Lege los → 6 | actionLink: /de/guide/ 7 | footer: MIT Lizensiert | Copyright © 2020 Stevertus 8 | --- 9 | 10 | 32 | 33 | 34 | ## Eine Programmiersprache für Datapacks! 35 | Benutze eine Programmiersprache, die als Erweiterung der Minecraft Functions daher kommt, um neue Ausdrücke, Generatoren zu benutzen und die Entwicklungs von deinen Packs zu vereinfachen. 36 | 37 | # Starte heute! 38 | 39 | Fange heute an mcscript zu lernen mit meinem Videokurs: 40 | 41 | 42 | 43 | ---- 44 | 45 | ### Variablen 46 | Variablen können Zahlen speichern, ausgeben und es können Rechenoperationen durchgeführt werden. Minecraft Script bringt diese nun auch zu Minecraft Vanilla. 47 | ```js 48 | var var1 49 | var var2 = 5 50 | 51 | var1 = 10 52 | 53 | var2 += 5 54 | 55 | var1 += var2 56 | ``` 57 | ### Schleifen 58 | Hattet ihr schonmal etwas, dass sich immer und immer wiederholt? Soetwas wird Loop genannt und ist jetzt auch in Minecraft verfügbar! 59 | ```js 60 | for(1,5){ 61 | log($(i)) 62 | } 63 | while('entity @s[tag=loop]'){ 64 | 65 | } 66 | ``` 67 | 68 | ### Bedingungen und If-Abfragen 69 | Fasse If-Bedingungen ganz einfach zusammen und nenne mehrfache Bedingungen. Es wird alles von MC Script geregelt! 70 | ```js 71 | if("entity @s"){ 72 | /say entity found 73 | } 74 | 75 | // else statement 76 | if("entity @s"){ 77 | /say entity found 78 | } else { 79 | /say elsewhise command 80 | } 81 | ``` 82 | 83 | ### Cleveres Datei Management 84 | Generiere unbegrenzte neue Dateien, füge Dateien zusammen oder verwende alles zusammen im Loop. Der Kreatität sind keine Grenzen gesetzt, außer der Speicherplatz deines Computers. 85 | 86 | ``` 87 | #file: file1 88 | #this is file 1 89 | 90 | #file: file2 91 | #this is file 2 92 | ``` 93 | 94 | ## Installation 95 | 96 | Für die Installation wird die Node.js Umgebung und der Node Package Manager benötigt. 97 | 98 | Diese installiert man am besten über den Installer: nodejs.org/en/download/ 99 | 100 | Installiere die CLI mit: 101 | ```bash 102 | npm install -g mcscript 103 | ``` 104 | 105 | Bei einer erfolgreichen Antwort hast du alles richtig gemacht und kannst durchstarten. 106 | 107 | 108 | ## Trete in Kontakt mit der Community und bekomme Updates 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /documentation/de/cli/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar: auto 3 | footer: MIT Licensed | Copyright © 2020 Stevertus 4 | prev: /de/guide/ 5 | next: /de/files/ 6 | --- 7 | 8 | # 2) CLI Commands 9 | 10 | 11 | Das Tool kannst du nun anwenden, indem du die Command Line in deinen Datapacks Ordner startest 12 | (über Shift + Rechtsklick auf Ordner -> Eingabeaufforderung hier öffnen) 13 | Nun kannst du die Kommandos benutzen: 14 | ## 2.1 mcscript new 15 | 16 | Dieser Command generiert dir ein vorgefertigtes Datapack mit allen basic Dateien und einem Scripts-Ordner. Als Argument muss die Id des Packs angegeben werden! 17 | ## 2.2 mcscript compile 18 | 19 | Dieser Command wandelt alle .mcscript Dateien in .mcfunction Format um. Was in den mcscript Dateien möglich ist, kannst du hier nachlesen. 20 | In der Konsole werden alle generierten Dateien angezeigt oder ein Fehler ausgeworfen, falls etwas nicht korrekt war. 21 | 22 | Alternativ kannst mit `mcscript compile *filepath*` einen speziellen Pfad oder spezielle Datei angeben. 23 | Mit der zusätzlichen `-fullErr` flag können ganze Fehler mit code Referenzen angezeigt werden. 24 | 25 | ## 2.3 mcscript watch 26 | 27 | Hiermit wird dein Code automatisch compiled, wenn du irgendwelche Änderungen machst (speicherst). So musst du nicht bei jeder Änderung den obigen Command eingeben. 28 | 29 | Auch hier kann ein Pfad angegeben und -fullErr verwendet werden. 30 | 31 | ## 2.4 mcscript add [url or package] 32 | Dieser Conmmand kann ein datapack zu deiner Welt hinzufügen. 33 | Als Argument kann entweder eine Url direkt zur Datei oder der Name einer mcScript Extension genutzt werden. 34 | 35 | Eine Liste aller McScript Extensions kann bekommen werden mit `mcscript add` 36 | 37 | ## 2.4 Dev: mcscript modals 38 | 39 | !!Dieser Command ist nur für Entwicker gedacht, die ihre Modals in den Compiler einbauen wollen. 40 | Es muss eine Datei angegeben werden und die Modals aus dieser Datei werden dann in eine Konfigurationsdatei geschrieben. -------------------------------------------------------------------------------- /documentation/de/files/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar: auto 3 | footer: MIT Licensed | Copyright © 2020 Stevertus 4 | prev: /de/cli/ 5 | next: /de/syntax/ 6 | --- 7 | 8 | # 3) File system 9 | ## 3.1 File setup 10 | In einem Minecraft Datapack können alle Datein in ein scripts Ordner gepackt werden, um dann in `/functions` den Output zu generieren. 11 | Es werden immer Dateien mit gleichem Namen, wie ihr Root generiert. 12 | 13 | Ein benutzerdefinierter Name kann mit `#file: *name*` gesetzt werden. 14 | Bitte ohne `.mcfunction`!! 15 | 16 | Statt des Namen kann auch gleich ein ganzer Pfad, an dem die neue Datei sein soll, angegeben werden: 17 | 18 | * `#file: C:/test/neu` 19 | * `#file: ./neu` (Im gleichen Ordner) 20 | * `#file: ./unterordner/neu` 21 | * `#file: ../neu` (Ein Ordner dadrüber) 22 | * `#file: ../unterordner/neu` 23 | 24 | Es können auch mehrere Dateien spezifiziert werden: 25 | 26 | #file: neu 27 | //commands hier 28 | #file: zwei 29 | //Commands für zwei hier 30 | 31 | Auch sehr gut mit [for-loops](#loops) kombinierbar: 32 | 33 | #file: neu 34 | //commands hier 35 | for(1,5){ 36 | #file: test$(i) 37 | //Commands für jede Datei hier 38 | } 39 | 40 | ## 3.2 Dateien erweitern 41 | Eine bereits bestehende Datei, vorher mit `#file:`, kann nun auch aus anderen Dateien erweitert werden und neuer Code einfach hinten drangehängt werden: 42 | ``` 43 | extend: ./test 44 | /commands kommen hier. 45 | ``` 46 | ## 3.3 Globale Dateien 47 | [Variablen](#vars), [Konstanten](#consts) und [Modals](#modals) werden für jede Datei seperat gespeichert. 48 | Jetzt kann man eine globale Datei mit der Endung `.gl.mcscript` erstellen. Der Compiler erkennt diese automatisch und verwendet die deklarierten Objekte auch in anderen Dateien. 49 | So kann man die Modals zum Beispiel in eine eigende Datei schreiben. -------------------------------------------------------------------------------- /documentation/de/guide/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar: auto 3 | footer: MIT Licensed | Copyright © 2020 Stevertus 4 | prev: false 5 | next: /de/cli/ 6 | --- 7 | 8 | # Minecraft Script Dokumentation 9 | > Update 0.2.1: [Alle Änderungen](https://github.com/Stevertus/mcscript/releases) 10 | 11 | Minecraft Script ist eine Programmiersprache für Entwickler der mcfunctions, sowie für die Minecraft Map und Package Erschaffer. Die .mcscript Dateien werden dabei zu mcfunction compiled und generiert. Dies bietet dem Entwickler erweiterte Möglichkeiten, wie zum Beispiel Modals, Loops, Variablen, Konstanten und Command-Wrapping. 12 | 13 | # 1) Installation 14 | 15 | Der Compiler wird auch als [Node.js/](https://nodejs.org/en/download/) Package angeboten, das lokal auf dem PC installiert wird und viele Features mehr hat: als die Online-Version hat. 16 | z.B: Alle Dateien in einem Ordner gleichzeitig compilen, direkter Output in neuen Dateien, auf Dateiänderungen "watchen", uvm. 17 | 18 | ## 1.1 Installation von Node.js 19 | 20 | Für die Installation wird die Node.js Umgebung und der Node Package Manager benötigt. 21 | 22 | Diese installiert man am besten über den Installer: [nodejs.org/en/download/](https://nodejs.org/en/download/) 23 | Den einfach ausführen und installieren lassen. 24 | ## 1.2 Installation von Minecraft Script 25 | 26 | Öffne nun die Konsole deines PCs (Am besten über Suche unter CMD zu erreichen). 27 | 28 | Hier muss nun dieser Command eingegeben werden: 29 | > ```npm install -g mcscript``` 30 | 31 | Bei einer erfolgreichen Antwort hast du alles richtig gemacht und kannst durchstarten. -------------------------------------------------------------------------------- /documentation/de/ides/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar: none 3 | footer: MIT Licensed | Copyright © 2020 Stevertus 4 | prev: /de/syntax/ 5 | next: false 6 | --- 7 | 8 | # 4) IDEs and Syntax Highlighting 9 | 10 | * Visual Studio Code: 11 | [Stevertus.mcscript](https://marketplace.visualstudio.com/items?itemName=Stevertus.mcscript) 12 | 13 | * GitHubs Atom Editor: 14 | [mcscript](https://atom.io/packages/mcscript) (credit: [Trojaner](https://github.com/TrojanerHD)) 15 | 16 | * Notepad++: 17 | [code](https://github.com/Stevertus/mcscript/blob/master/Nodepad%2B%2B%20Highlighter.xml) | [download](http://download1496.mediafire.com/x2k7loq5imbg/4534q4tual7zccm/Nodepad+++Highlighter.xml) 18 | 19 | Jetzt bleibt nichts mehr übrig als: **Happy Developing** 20 | -------------------------------------------------------- 21 | 22 | Vielen Dank an alle die Minecraft Script benutzen und diese Dokumentation gelesen haben. Bei Vorschlägen, Problemen oder Fehlern bitte mich kontaktieren. 23 | Ich freue mich euch ebenfalls euch auf meinem Discord begrüßen zu dürfen und Vorschläge und Kritik zu hören. 24 | -------------------------------------------------------------------------------- /documentation/files/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar: auto 3 | footer: MIT Licensed | Copyright © 2020 Stevertus 4 | prev: /cli/ 5 | next: /syntax/ 6 | --- 7 | 8 | # 3) File system 9 | ## 3.1 File setup 10 | 11 | The generated files have always the same name as their root. 12 | 13 | A custom name can be set with `#file: *name*.` 14 | Please without .mcfunction!! 15 | 16 | Instead of the name, you can enter a whole path where the new file should be: 17 | 18 | * `#file: C:/test/new` 19 | * `#file: ./new` (in same directory) 20 | * `#file: ./subfolder/new` 21 | * `#file: ../new` (a directory above) 22 | * `#file: ../subfolder/new` 23 | 24 | You can also specify several files: 25 | 26 | #file: new 27 | //commands here 28 | #file: two 29 | //Commands for two 30 | 31 | Also very well combinable with [for-loops](#loops): 32 | 33 | #file: new 34 | //commands here 35 | for(1,5){ 36 | #file: test$(i) 37 | //Commands for every file here 38 | } 39 | 40 | ## 3.2 Extend Files 41 | A already existing file, that is generated before with `#file:`, can be expanded in other files and new code is easily attached: 42 | ``` 43 | #extend: ./test 44 | /commands here 45 | ``` 46 | 47 | ## 3.3 Global Files 48 | Variables (#vars), [constants] (#consts), and [Modals] (#modals) are stored separately for each file. 49 | Now you can create a global file with the extension '. gl. mcscript '. The compiler automatically detects globals and uses the declared objects in other files as well. 50 | For example, you can write the modals to a separate file. -------------------------------------------------------------------------------- /documentation/guide/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar: auto 3 | footer: MIT Licensed | Copyright © 2020 Stevertus 4 | prev: false 5 | next: /cli/ 6 | --- 7 | 8 | # Minecraft Script Documentation 9 | 10 | > Update 0.2.3: [All Changes](https://github.com/Stevertus/mcscript/releases) 11 | 12 | Minecraft Script is a programming language for developers of mcfunctions, Minecraft maps and packages. The .mcscript files are therefore compiled and generated to the function format. This enables the developer extended possibilities, such as Modals, Loops, Varibles, Constants and Command-Wrapping. 13 | 14 | ## 1) Installation 15 | 16 | The Compiler gets offered as [Node.js/](https://nodejs.org/en/download/) Package that is installed locally on your machine. It enables much more features than the online version 17 | For example: compile all files in a directory, direct output in new files, watch your files on changes, etc. 18 | 19 | ### 1.1 Installation of Node.js 20 | 21 | The installation requires the Node.js environment and the Node Package Manager. 22 | 23 | This is achieved the best way by using the installer: [nodejs.org/en/download/](https://nodejs.org/en/download/) 24 | Just run it and install. 25 | 26 | ### 1.2 Installation of Minecraft Script 27 | 28 | Now open your PCs console. (search CMD). 29 | 30 | There you have to type in this command: 31 | 32 | > `npm install -g mcscript` 33 | 34 | If a successful answer apears you have done everything right and can start. 35 | -------------------------------------------------------------------------------- /documentation/ides/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar: none 3 | footer: MIT Licensed | Copyright © 2020 Stevertus 4 | prev: /syntax/ 5 | next: false 6 | --- 7 | 8 | # 4) IDEs and Syntax Highlighting 9 | 10 | * Visual Studio Code: 11 | [Stevertus.mcscript](https://marketplace.visualstudio.com/items?itemName=Stevertus.mcscript) 12 | 13 | * GitHubs Atom Editor: 14 | [mcscript](https://atom.io/packages/mcscript) (credit: [Trojaner](https://github.com/TrojanerHD)) 15 | 16 | * Notepad++: 17 | [code](https://github.com/Stevertus/mcscript/blob/master/Nodepad%2B%2B%20Highlighter.xml) | [download](http://download1496.mediafire.com/x2k7loq5imbg/4534q4tual7zccm/Nodepad+++Highlighter.xml) 18 | 19 | 20 | Now there´s nothing left than: **Happy Developing** 21 | 22 | 23 | --------------------------------------------------- 24 | 25 | Thanks to all who use Minecraft Script and read this documentation. Contact me if you have a proposal, problem or error. -------------------------------------------------------------------------------- /documentation/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.0.1", 3 | "scripts": { 4 | "docs:dev": "set NODE_OPTIONS=--openssl-legacy-provider && vuepress dev", 5 | "docs:build": "set NODE_OPTIONS=--openssl-legacy-provider && vuepress build" 6 | }, 7 | "devDependencies": { 8 | "@vuepress/core": "^1.9.10", 9 | "@vuepress/plugin-pwa": "^1.9.10", 10 | "vuepress": "^1.9.10" 11 | } 12 | } -------------------------------------------------------------------------------- /examples/functions/advanced_modal.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/advanced Modal.mcscript 3 | # to .//functions/advanced_modal.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | 8 | say Hello You! A message from Stevertus 9 | say Hello Player! A message from me 10 | 11 | # overriden modal 12 | say Hello Stevertus -------------------------------------------------------------------------------- /examples/functions/arrays.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/arrays.mcscript 3 | # to .//functions/arrays.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | 8 | say value 9 | say no value2 10 | 11 | # calling it with Inline Array 12 | say value 13 | # with defaults 14 | 15 | say value 16 | say value2 -------------------------------------------------------------------------------- /examples/functions/basic_loop.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/basic Loop.mcscript 3 | # to .//functions/basic_loop.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | say 1 8 | say 2 9 | say 3 10 | say 4 11 | say 5 -------------------------------------------------------------------------------- /examples/functions/basic_modal.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/basic Modal.mcscript 3 | # to .//functions/basic_modal.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | 8 | say test -------------------------------------------------------------------------------- /examples/functions/boolean.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/boolean.mcscript 3 | # to .//functions/boolean.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | tag @e[tag=mcscriptTags] add isCool 8 | tag @e[tag=mcscriptTags] remove isCool 9 | execute if entity @e[tag=mcscriptTags,tag=isCool] run say he is cool 10 | 11 | tag @s add isBad 12 | tag @s remove isBad 13 | execute if entity @s[tag=isBad] run say he is bad 14 | -------------------------------------------------------------------------------- /examples/functions/comments.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/comments.mcscript 3 | # to .//functions/comments.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | #file ./comments 8 | # this file is contentless, it is just a demonstration for comments 9 | # single line transfare comment. This comment will be transfared to the compiled result function 10 | say hey -------------------------------------------------------------------------------- /examples/functions/consts.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/consts.mcscript 3 | # to .//functions/consts.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | 8 | say some string here 9 | say some value here 10 | 11 | execute if score @s matches 5 run tellraw @a [{"text":"console => ","color":"aqua"},{"text":"is five","color":"white"}] 12 | -------------------------------------------------------------------------------- /examples/functions/dowhile.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/do-while-Loops.mcscript 3 | # to .//functions/dowhile.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | function :mcscript/dowhile1 -------------------------------------------------------------------------------- /examples/functions/fileloop/1.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/file Loop.mcscript 3 | # to .//functions/fileloop/1.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | test 1 8 | -------------------------------------------------------------------------------- /examples/functions/fileloop/2.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/file Loop.mcscript 3 | # to .//functions/fileloop/2.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | test 2 8 | -------------------------------------------------------------------------------- /examples/functions/fileloop/3.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/file Loop.mcscript 3 | # to .//functions/fileloop/3.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | test 3 8 | -------------------------------------------------------------------------------- /examples/functions/fileloop/4.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/file Loop.mcscript 3 | # to .//functions/fileloop/4.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | test 4 -------------------------------------------------------------------------------- /examples/functions/foreach.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/forEach.mcscript 3 | # to .//functions/foreach.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | # basic loop 8 | scoreboard players set i i -5 9 | execute if score i i matches ..4 run function :mcscript/foreach2 10 | # faculty 11 | scoreboard players set result result 1 12 | scoreboard players set j j 2 13 | execute if score j j matches ..10 run function :mcscript/foreach3 -------------------------------------------------------------------------------- /examples/functions/function.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/function.mcscript 3 | # to .//functions/function.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.13 6 | ###### 7 | function examples:test 8 | say not function 9 | -------------------------------------------------------------------------------- /examples/functions/global.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/global.mcscript 3 | # to .//functions/global.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | scoreboard players set global1 global1 5 8 | 9 | -------------------------------------------------------------------------------- /examples/functions/groups.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/groups.mcscript 3 | # to .//functions/groups.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | #do something as everybody 8 | execute as @a run say i''m also existing 9 | #do something at everybody 10 | execute at @a run summon lightning_bolt ~ ~ ~ 11 | #do something as and at every player 12 | execute as @a at @s run summon lightning_bolt ~ ~ ~ 13 | execute as @a at @s run say A lightning_bolt hit me 14 | execute positioned ~ ~1 ~ run setblock ~ ~ ~ stone 15 | execute in overworld run say Im in the overworld -------------------------------------------------------------------------------- /examples/functions/hello_world.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/Hello World.mcscript 3 | # to .//functions/hello_world.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | tellraw @a [{"text":"console => ","color":"aqua"},{"text":"Hello World!","color":"white"}] -------------------------------------------------------------------------------- /examples/functions/if.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/If Statement.mcscript 3 | # to .//functions/if.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | execute if entity @s run say entity found 8 | 9 | # multiline 10 | execute if score @s matches 0.. run say score is positive 11 | execute if score @s matches 0.. run say multi line 12 | 13 | 14 | # not statement 15 | execute unless entity @s run say there is no entity 16 | 17 | 18 | # else statement 19 | execute if entity @s run say entity found 20 | execute unless entity @s run say else command 21 | 22 | # else if statement 23 | execute if entity @s run say entity found 24 | execute unless entity @s if score @s matches 0.. run say there is no entity but score is over 0 -------------------------------------------------------------------------------- /examples/functions/maps.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/maps.mcscript 3 | # to .//functions/maps.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | 8 | say value 9 | say no value2 10 | 11 | say undefined 12 | 13 | say value 14 | say undefined -------------------------------------------------------------------------------- /examples/functions/mcscript/dowhile1.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/do-while-Loops.mcscript 3 | # to functions/mcscript/dowhile1.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | tellraw @a [{"text":"console => ","color":"aqua"},{"text":"commands","color":"white"}] 8 | execute if entity @s[tag=!mcscriptStop] if entity @s[tag=loop] run function :mcscript/dowhile1 9 | tag @s[tag=mcscriptStop] remove mcscriptStop 10 | -------------------------------------------------------------------------------- /examples/functions/mcscript/dowhile3.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from /examples/functions/do-while-Loops.mcscript 3 | # to examples/functions/mcscript/dowhile3.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.13 6 | ###### 7 | tellraw @a [{"text":"console => ","color":"aqua"},{"text":"commands","color":"white"}] 8 | execute if entity @s[tag=!mcscriptStop] if entity @s[tag=loop] run function examples:mcscript/dowhile3 9 | tag @s[tag=mcscriptStop] remove mcscriptStop 10 | -------------------------------------------------------------------------------- /examples/functions/mcscript/dowhile6.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from /examples/functions/do-while-Loops.mcscript 3 | # to examples/functions/mcscript/dowhile6.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.13 6 | ###### 7 | tellraw @a [{"text":"console => ","color":"aqua"},{"text":"commands","color":"white"}] 8 | execute if entity @s[tag=!mcscriptStop] if entity @s[tag=loop] run function examples:mcscript/dowhile6 9 | tag @s[tag=mcscriptStop] remove mcscriptStop 10 | -------------------------------------------------------------------------------- /examples/functions/mcscript/forEach2.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/forEach.mcscript 3 | # to functions/mcscript/foreach2.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | say hey 8 | scoreboard players add i i 1 9 | execute if entity @s[tag=!mcscriptStop] if score i i matches ..4 run function :mcscript/foreach2 10 | tag @s[tag=mcscriptStop] remove mcscriptStop 11 | -------------------------------------------------------------------------------- /examples/functions/mcscript/forEach3.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/forEach.mcscript 3 | # to functions/mcscript/foreach3.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | scoreboard players operation result result *= i i 8 | scoreboard players add j j 1 9 | execute if entity @s[tag=!mcscriptStop] if score j j matches ..10 run function :mcscript/foreach3 10 | tag @s[tag=mcscriptStop] remove mcscriptStop 11 | -------------------------------------------------------------------------------- /examples/functions/mcscript/foreach1.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from /examples/functions/forEach.mcscript 3 | # to examples/functions/mcscript/foreach1.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.13 6 | ###### 7 | say hey 8 | scoreboard players add i i 1 9 | execute if entity @s[tag=!mcscriptStop] if score i i matches ..9 run function examples:mcscript/foreach1 10 | tag @s[tag=mcscriptStop] remove mcscriptStop 11 | -------------------------------------------------------------------------------- /examples/functions/mcscript/foreach5.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from /examples/functions/forEach.mcscript 3 | # to examples/functions/mcscript/foreach5.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.13 6 | ###### 7 | scoreboard players operation result result *= i i 8 | scoreboard players add j j 1 9 | execute if entity @s[tag=!mcscriptStop] if score j j matches ..10 run function examples:mcscript/foreach5 10 | tag @s[tag=mcscriptStop] remove mcscriptStop 11 | -------------------------------------------------------------------------------- /examples/functions/mcscript/foreach6.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from /examples/functions/forEach.mcscript 3 | # to examples/functions/mcscript/foreach6.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.13 6 | ###### 7 | scoreboard players operation result result *= i i 8 | scoreboard players add j j 1 9 | execute if entity @s[tag=!mcscriptStop] if score j j matches ..10 run function examples:mcscript/foreach6 10 | tag @s[tag=mcscriptStop] remove mcscriptStop 11 | -------------------------------------------------------------------------------- /examples/functions/mcscript/foreach7.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from /examples/functions/forEach.mcscript 3 | # to examples/functions/mcscript/foreach7.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.13 6 | ###### 7 | say hey 8 | scoreboard players add i i 1 9 | execute if entity @s[tag=!mcscriptStop] if score i i matches ..9 run function examples:mcscript/foreach7 10 | tag @s[tag=mcscriptStop] remove mcscriptStop 11 | -------------------------------------------------------------------------------- /examples/functions/mcscript/foreach8.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from /examples/functions/forEach.mcscript 3 | # to examples/functions/mcscript/foreach8.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.13 6 | ###### 7 | scoreboard players operation result result *= i i 8 | scoreboard players add j j 1 9 | execute if entity @s[tag=!mcscriptStop] if score j j matches ..10 run function examples:mcscript/foreach8 10 | tag @s[tag=mcscriptStop] remove mcscriptStop 11 | -------------------------------------------------------------------------------- /examples/functions/mcscript/load.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/file Setup.mcscript 3 | # to .//functions/mcscript/load.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | coreboard objectives add global1 dummy 8 | 9 | # Extended from .//functions/boolean.mcscript 10 | # to functions/mcscript/load.mcfunction 11 | # please do not touch this file! 12 | # it is used by the compiler! 13 | execute unless entity @e[tag=mcscriptTags] at @p run summon armor_stand ~ ~ ~ {Tags:[mcscriptTags],Invisible:1,Invulnerable:1,NoGravity:1} 14 | 15 | # Extended from .//functions/forEach.mcscript 16 | # to functions/mcscript/load.mcfunction 17 | # please do not touch this file! 18 | # it is used by the compiler! 19 | scoreboard objectives add i dummy 20 | scoreboard objectives add result dummy 21 | scoreboard objectives add j dummy 22 | 23 | # Extended from .//functions/raycasting.mcscript 24 | # to functions/mcscript/load.mcfunction 25 | # please do not touch this file! 26 | # it is used by the compiler! 27 | scoreboard objectives add mcscript_raycast dummy 28 | 29 | # Extended from .//functions/switches.mcscript 30 | # to functions/mcscript/load.mcfunction 31 | # please do not touch this file! 32 | # it is used by the compiler! 33 | scoreboard objectives add test dummy 34 | -------------------------------------------------------------------------------- /examples/functions/mcscript/raycast1.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from /examples/functions/raycasting.mcscript 3 | # to examples/functions/mcscript/raycast1.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.13 6 | ###### 7 | particle flame ~ ~ ~ 8 | scoreboard players add raycast1 mcscript_raycast 1 9 | execute positioned ^ ^ ^1 unless block ~ ~ ~ air run tag @s add mcscriptStop 10 | execute positioned ^ ^ ^1 if entity @s[tag=!mcscriptStop] if block ~ ~ ~ air if score raycast1 mcscript_raycast matches ..10 run function examples:mcscript/raycast1 11 | execute if score raycast1 mcscript_raycast matches ..10 if entity @s[tag=mcscriptStop] positioned ^ ^ ^1 run setblock ~ ~ ~ stone 12 | tag @s[tag=mcscriptStop] remove mcscriptStop 13 | -------------------------------------------------------------------------------- /examples/functions/mcscript/raycast2.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from /examples/functions/raycasting.mcscript 3 | # to examples/functions/mcscript/raycast2.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.13 6 | ###### 7 | particle flame ~ ~ ~ 8 | scoreboard players add raycast2 mcscript_raycast 1 9 | execute positioned ^ ^ ^1 unless block ~ ~ ~ air run tag @s add mcscriptStop 10 | execute positioned ^ ^ ^1 if entity @s[tag=!mcscriptStop] if block ~ ~ ~ air if score raycast2 mcscript_raycast matches ..10 run function examples:mcscript/raycast2 11 | execute if score raycast2 mcscript_raycast matches ..10 if entity @s[tag=mcscriptStop] positioned ^ ^ ^1 run setblock ~ ~ ~ stone 12 | tag @s[tag=mcscriptStop] remove mcscriptStop 13 | -------------------------------------------------------------------------------- /examples/functions/mcscript/raycast4.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/raycasting.mcscript 3 | # to functions/mcscript/raycast4.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | particle flame ~ ~ ~ 8 | scoreboard players add raycast4 mcscript_raycast 1 9 | execute positioned ^ ^ ^1 unless block ~ ~ ~ air run tag @s add mcscriptStop 10 | execute positioned ^ ^ ^1 if entity @s[tag=!mcscriptStop] if block ~ ~ ~ air if score raycast4 mcscript_raycast matches ..10 run function :mcscript/raycast4 11 | execute if score raycast4 mcscript_raycast matches ..10 if entity @s[tag=mcscriptStop] positioned ^ ^ ^1 run setblock ~ ~ ~ stone 12 | tag @s[tag=mcscriptStop] remove mcscriptStop 13 | -------------------------------------------------------------------------------- /examples/functions/mcscript/raycast5.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from /examples/functions/raycasting.mcscript 3 | # to examples/functions/mcscript/raycast5.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.13 6 | ###### 7 | particle flame ~ ~ ~ 8 | scoreboard players add raycast5 mcscript_raycast 1 9 | execute positioned ^ ^ ^1 unless block ~ ~ ~ air run tag @s add mcscriptStop 10 | execute positioned ^ ^ ^1 if entity @s[tag=!mcscriptStop] if block ~ ~ ~ air if score raycast5 mcscript_raycast matches ..10 run function examples:mcscript/raycast5 11 | execute if score raycast5 mcscript_raycast matches ..10 if entity @s[tag=mcscriptStop] positioned ^ ^ ^1 run setblock ~ ~ ~ stone 12 | tag @s[tag=mcscriptStop] remove mcscriptStop 13 | -------------------------------------------------------------------------------- /examples/functions/mcscript/raycast9.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from /examples/functions/raycasting.mcscript 3 | # to examples/functions/mcscript/raycast9.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.13 6 | ###### 7 | particle flame ~ ~ ~ 8 | scoreboard players add raycast9 mcscript_raycast 1 9 | execute positioned ^ ^ ^1 unless block ~ ~ ~ air run tag @s add mcscriptStop 10 | execute positioned ^ ^ ^1 if entity @s[tag=!mcscriptStop] if block ~ ~ ~ air if score raycast9 mcscript_raycast matches ..10 run function examples:mcscript/raycast9 11 | execute if score raycast9 mcscript_raycast matches ..10 if entity @s[tag=mcscriptStop] positioned ^ ^ ^1 run setblock ~ ~ ~ stone 12 | tag @s[tag=mcscriptStop] remove mcscriptStop 13 | -------------------------------------------------------------------------------- /examples/functions/mcscript/while10.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from /examples/functions/while-Loops.mcscript 3 | # to examples/functions/mcscript/while10.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.13 6 | ###### 7 | tellraw @a [{"text":"console => ","color":"aqua"},{"text":"commands","color":"white"}] 8 | execute if entity @s[tag=!mcscriptStop] if entity @s[tag=loop] run function examples:mcscript/while10 9 | tag @s[tag=mcscriptStop] remove mcscriptStop 10 | -------------------------------------------------------------------------------- /examples/functions/mcscript/while2.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from /examples/functions/while-Loops.mcscript 3 | # to examples/functions/mcscript/while2.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.13 6 | ###### 7 | tellraw @a [{"text":"console => ","color":"aqua"},{"text":"commands","color":"white"}] 8 | execute if entity @s[tag=!mcscriptStop] if entity @s[tag=loop] run function examples:mcscript/while2 9 | tag @s[tag=mcscriptStop] remove mcscriptStop 10 | -------------------------------------------------------------------------------- /examples/functions/mcscript/while3.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from /examples/functions/while-Loops.mcscript 3 | # to examples/functions/mcscript/while3.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.13 6 | ###### 7 | tellraw @a [{"text":"console => ","color":"aqua"},{"text":"commands","color":"white"}] 8 | execute if entity @s[tag=!mcscriptStop] if entity @s[tag=loop] run function examples:mcscript/while3 9 | tag @s[tag=mcscriptStop] remove mcscriptStop 10 | -------------------------------------------------------------------------------- /examples/functions/mcscript/while4.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from /examples/functions/while-Loops.mcscript 3 | # to examples/functions/mcscript/while4.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.13 6 | ###### 7 | tellraw @a [{"text":"console => ","color":"aqua"},{"text":"commands","color":"white"}] 8 | execute if entity @s[tag=!mcscriptStop] if entity @s[tag=loop] run function examples:mcscript/while4 9 | tag @s[tag=mcscriptStop] remove mcscriptStop 10 | -------------------------------------------------------------------------------- /examples/functions/mcscript/while5.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/while-Loops.mcscript 3 | # to functions/mcscript/while5.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | tellraw @a [{"text":"console => ","color":"aqua"},{"text":"commands","color":"white"}] 8 | execute if entity @s[tag=!mcscriptStop] if entity @s[tag=loop] run function :mcscript/while5 9 | tag @s[tag=mcscriptStop] remove mcscriptStop 10 | -------------------------------------------------------------------------------- /examples/functions/mcscript/while6.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from /examples/functions/while-Loops.mcscript 3 | # to examples/functions/mcscript/while6.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.13 6 | ###### 7 | tellraw @a [{"text":"console => ","color":"aqua"},{"text":"commands","color":"white"}] 8 | execute if entity @s[tag=!mcscriptStop] if entity @s[tag=loop] run function examples:mcscript/while6 9 | tag @s[tag=mcscriptStop] remove mcscriptStop 10 | -------------------------------------------------------------------------------- /examples/functions/operators.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/Operators.mcscript 3 | # to .//functions/operators.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | # and operator 8 | execute if cond1 if cond2 run say condition 1 and condition 2 is true 9 | 10 | # or operator 11 | execute if cond1 run say condition 1 or condition 2 is true 12 | execute if cond2 run say condition 1 or condition 2 is true 13 | 14 | # or operator as list 15 | execute if cond1 run say condition 1 or condition 2 is true 16 | execute if cond2 run say condition 1 or condition 2 is true 17 | 18 | # and or combined 19 | execute if cond1 if cond2 run say condition 1 and condition 2 or cond3 is true 20 | execute if cond3 run say condition 1 and condition 2 or cond3 is true 21 | 22 | # not and 23 | execute if cond1 run say condition 1 and not condition 2 is true 24 | -------------------------------------------------------------------------------- /examples/functions/raycast.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/raycasting.mcscript 3 | # to .//functions/raycast.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | scoreboard players set raycast4 mcscript_raycast 0 8 | execute positioned ~ ~1 ~ run function :mcscript/raycast4 9 | -------------------------------------------------------------------------------- /examples/functions/raycasting.mcfunction: -------------------------------------------------------------------------------- 1 | 2 | # Extended from .//functions/raycasting.mcscript 3 | # to .//functions/raycasting.mcfunction 4 | functions/mcscript/load 5 | # please do not touch this file! 6 | # it is used by the compiler! 7 | scoreboard objectives add mcscript_raycast dummy 8 | -------------------------------------------------------------------------------- /examples/functions/switches.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/switches.mcscript 3 | # to .//functions/switches.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | scoreboard players set test test 10 8 | execute if score test test matches 11 if entity @s[tag=!mcscriptSwitch] run say var is 11 9 | execute if score test test matches 11 if entity @s[tag=!mcscriptSwitch] run tag @s add mcscriptSwitch 10 | execute if score test test matches 11.. if entity @s[tag=!mcscriptSwitch] run say var is over 10 11 | execute if score test test matches 11.. if entity @s[tag=!mcscriptSwitch] run tag @s add mcscriptSwitch 12 | execute if score test test matches ..9 if entity @s[tag=!mcscriptSwitch] run say var is below 10 13 | execute if score test test matches ..9 if entity @s[tag=!mcscriptSwitch] run tag @s add mcscriptSwitch 14 | execute if entity @s[tag=!mcscriptSwitch] run say no match 15 | tag @s remove mcscriptSwitch -------------------------------------------------------------------------------- /examples/functions/test.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/function.mcscript 3 | # to .//functions/test.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | # this file is generated based on a function specified in.//functions/function.mcscript 8 | say function -------------------------------------------------------------------------------- /examples/functions/variables.mcfunction: -------------------------------------------------------------------------------- 1 | 2 | # Extended from .//functions/variables.mcscript 3 | # to .//functions/variables.mcfunction 4 | functions/mcscript/load 5 | # please do not touch this file! 6 | # it is used by the compiler! 7 | scoreboard objectives add var1 dummy 8 | scoreboard objectives add var2 dummy 9 | scoreboard objectives add varResult dummy 10 | -------------------------------------------------------------------------------- /examples/functions/vars.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/variables.mcscript 3 | # to .//functions/vars.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.13 6 | ###### 7 | 8 | scoreboard players set var2 var2 5 9 | scoreboard players set var1 var1 10 10 | scoreboard players add var1 var1 1 11 | scoreboard players remove var1 var1 1 12 | scoreboard players add var2 var2 5 13 | scoreboard players operation var1 var1 += var2 var2 14 | execute if score var1 var1 matches 20 run tellraw @a [{"text":"console => ","color":"aqua"},{"text":"is 20","color":"white"}] 15 | 16 | # saving a command result in variable 17 | execute store result score varResult varResult run data get entity @s Pos[0] -------------------------------------------------------------------------------- /examples/functions/while.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from .//functions/while-Loops.mcscript 3 | # to .//functions/while.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.16 6 | ###### 7 | execute if entity @s[tag=loop] run function :mcscript/while5 -------------------------------------------------------------------------------- /examples/scripts/Hello World.mcscript: -------------------------------------------------------------------------------- 1 | #file: ./hello_world 2 | log("Hello World!") 3 | -------------------------------------------------------------------------------- /examples/scripts/If Statement.mcscript: -------------------------------------------------------------------------------- 1 | #file: ./if 2 | if(@s){ 3 | /say entity found 4 | } 5 | 6 | # multiline 7 | if("score @s matches 0.."){ 8 | /say score is positive 9 | /say multi line 10 | } 11 | # 12 | # not statement 13 | if(!"entity @s"){ 14 | /say there is no entity 15 | } 16 | # 17 | # else statement 18 | if(@s){ 19 | /say entity found 20 | } else { 21 | /say else command 22 | } 23 | # 24 | # else if statement 25 | if(@s){ 26 | /say entity found 27 | } else if("score @s matches 0..") { 28 | /say there is no entity but score is over 0 29 | } 30 | -------------------------------------------------------------------------------- /examples/scripts/Operators.mcscript: -------------------------------------------------------------------------------- 1 | #file: ./operators 2 | # and operator 3 | if('cond1'&&'cond2'){ 4 | /say condition 1 and condition 2 is true 5 | } 6 | 7 | # or operator 8 | if('cond1'||'cond2'){ 9 | /say condition 1 or condition 2 is true 10 | } 11 | 12 | # or operator as list 13 | if('cond1','cond2'){ 14 | /say condition 1 or condition 2 is true 15 | } 16 | 17 | # and or combined 18 | if('cond1'&&'cond2'||'cond3'){ 19 | /say condition 1 and condition 2 or cond3 is true 20 | } 21 | 22 | # not and 23 | if('cond1'&&!'cond2'){ 24 | /say condition 1 and not condition 2 is true 25 | } 26 | -------------------------------------------------------------------------------- /examples/scripts/advanced Modal.mcscript: -------------------------------------------------------------------------------- 1 | #file: ./advanced_modal 2 | modal hello(arg1, arg2 = "Stevertus"){ 3 | /say Hello $(arg1).repl('I','You')! A message from $(arg2) 4 | } 5 | hello('I') 6 | hello('Player','me') 7 | 8 | // override a modal 9 | override modal hello(arg1){ 10 | /say Hello $(arg1) 11 | } 12 | # overriden modal 13 | hello('Stevertus') 14 | -------------------------------------------------------------------------------- /examples/scripts/arrays.mcscript: -------------------------------------------------------------------------------- 1 | const arr = Array{ 2 | "value", 3 | "value2" 4 | } 5 | /say $(arr).0 6 | 7 | /say $(arr).1.replace("value","no value") 8 | 9 | // with modal 10 | modal testMap(args){ 11 | /say $(args).0 12 | } 13 | # calling it with Inline Array 14 | testMap(Array{"value"}) 15 | 16 | # with defaults 17 | modal defaultMap(args = Array{"value"}){ 18 | /say $(args).0 19 | } 20 | defaultMap() 21 | defaultMap(Array{ 22 | "value2" 23 | }) -------------------------------------------------------------------------------- /examples/scripts/basic Loop.mcscript: -------------------------------------------------------------------------------- 1 | #file: ./basic_loop 2 | for(1,5){ 3 | /say $(i) 4 | } 5 | -------------------------------------------------------------------------------- /examples/scripts/basic Modal.mcscript: -------------------------------------------------------------------------------- 1 | #file: ./basic_modal 2 | modal new(variable){ 3 | /say $(variable) 4 | } 5 | new("test") 6 | -------------------------------------------------------------------------------- /examples/scripts/boolean.mcscript: -------------------------------------------------------------------------------- 1 | #file: ./boolean 2 | bool isCool = true 3 | isCool = false 4 | 5 | if(isCool){ 6 | /say he is cool 7 | } 8 | 9 | bool isBad @s = true 10 | isBad @s = false 11 | 12 | if(isBad @s){ 13 | /say he is bad 14 | } 15 | -------------------------------------------------------------------------------- /examples/scripts/comments.mcscript: -------------------------------------------------------------------------------- 1 | #file ./comments 2 | 3 | # this file is contentless, it is just a demonstration for comments 4 | 5 | 6 | # single line transfare comment. This comment will be transfared to the compiled result function 7 | 8 | 9 | /* 10 | Multi-line-comments 11 | This comment can go over multiple lines 12 | */ 13 | 14 | // single line comment: This comment can go over a single line 15 | /say hey 16 | -------------------------------------------------------------------------------- /examples/scripts/consts.mcscript: -------------------------------------------------------------------------------- 1 | #file: ./consts 2 | const newConst = "some string here" 3 | /say $(newConst) 4 | /say $(newConst).repl('string','value') 5 | const score = 5 6 | 7 | if('score @s matches $(score)'){ 8 | log("is five") 9 | } 10 | -------------------------------------------------------------------------------- /examples/scripts/debugging.mcscript: -------------------------------------------------------------------------------- 1 | debug message: Hello 2 | debug error: Hello 3 | -------------------------------------------------------------------------------- /examples/scripts/do-while-Loops.mcscript: -------------------------------------------------------------------------------- 1 | #file: ./dowhile 2 | do { 3 | log("commands") 4 | } while('entity @s[tag=loop]') 5 | -------------------------------------------------------------------------------- /examples/scripts/file Loop.mcscript: -------------------------------------------------------------------------------- 1 | for(1,4){ 2 | #file: ./fileloop/$(i) 3 | /test $(i) 4 | } 5 | -------------------------------------------------------------------------------- /examples/scripts/file Setup.mcscript: -------------------------------------------------------------------------------- 1 | #file: ./mcscript/load 2 | -------------------------------------------------------------------------------- /examples/scripts/forEach.mcscript: -------------------------------------------------------------------------------- 1 | #file: ./foreach 2 | # basic loop 3 | forEach(var i = -5; i < 5; i++){ 4 | /say hey 5 | } 6 | 7 | # faculty 8 | var result = 1 9 | forEach(var j = 2; j <= 10; j++){ 10 | result *= i 11 | } 12 | -------------------------------------------------------------------------------- /examples/scripts/function.mcscript: -------------------------------------------------------------------------------- 1 | run function test { 2 | /say function 3 | } 4 | /say not function 5 | -------------------------------------------------------------------------------- /examples/scripts/global.gl.mcscript: -------------------------------------------------------------------------------- 1 | // here I can add global variables, consts and modals 2 | var global1 = 5 3 | 4 | modal global2(){ 5 | /say hey 6 | } 7 | 8 | const global3 = "Hello" 9 | -------------------------------------------------------------------------------- /examples/scripts/groups.mcscript: -------------------------------------------------------------------------------- 1 | #file: ./groups 2 | 3 | #do something as everybody 4 | as(@a) { 5 | /say i''m also existing 6 | } 7 | 8 | #do something at everybody 9 | at(@a) { 10 | /summon lightning_bolt ~ ~ ~ 11 | } 12 | 13 | #do something as and at every player 14 | asat(@a) { 15 | /summon lightning_bolt ~ ~ ~ 16 | /say A lightning_bolt hit me 17 | } 18 | 19 | 20 | positioned("~ ~1 ~"){ 21 | /setblock ~ ~ ~ stone 22 | } 23 | 24 | dimension("overworld"){ 25 | /say Im in the overworld 26 | } 27 | -------------------------------------------------------------------------------- /examples/scripts/jsmodal.mcfunction: -------------------------------------------------------------------------------- 1 | ####### 2 | # Compiled from modaljs.mcscript 3 | # to jsmodal.mcfunction 4 | # 5 | # Generated by Minecraft Script for 1.13 6 | ###### 7 | 8 | 9 | 10 | say Hello World! 11 | summon minecraft:zombie -------------------------------------------------------------------------------- /examples/scripts/maps.mcscript: -------------------------------------------------------------------------------- 1 | const map = Map{ 2 | "key":"value", 3 | "key2":"value2" 4 | } 5 | /say $(map).key 6 | 7 | /say $(map).key2.replace("value","no value") 8 | 9 | // with modal 10 | modal testMap(args){ 11 | /say $(args).key 12 | } 13 | // calling it with Inline Map 14 | testMap(Map{"key":"value"}) 15 | 16 | // with defaults 17 | modal defaultMap(args = Map{"key":"value"}){ 18 | /say $(args).key 19 | } 20 | defaultMap() 21 | defaultMap(Map{ 22 | "key":"value2" 23 | }) -------------------------------------------------------------------------------- /examples/scripts/modaljs.mcscript: -------------------------------------------------------------------------------- 1 | #file: ./jsmodal 2 | // here goes your main content 3 | // executes 20 times a second 4 | 5 | modaljs newModal(argument,monster){ 6 | var ret =""; 7 | ret+= "say "+argument+"\n"; 8 | ret+= "summon "+monster+"\n"; 9 | 10 | return ret; 11 | }; 12 | 13 | modal Modal1337(argument,monster){ 14 | /say $(argument) 15 | /summon $(monster) 16 | } 17 | 18 | newModal("Hello World!","minecraft:zombie") 19 | Modal1337("Hello World!","minecraft:zombie") 20 | -------------------------------------------------------------------------------- /examples/scripts/raycasting.mcscript: -------------------------------------------------------------------------------- 1 | #file: ./raycast 2 | raycast(10) { 3 | /setblock ~ ~ ~ stone 4 | }, { 5 | /particle flame ~ ~ ~ 6 | } 7 | -------------------------------------------------------------------------------- /examples/scripts/switches.mcscript: -------------------------------------------------------------------------------- 1 | #file: ./switches 2 | var test = 10 3 | switch(test){ 4 | case 11 { 5 | /say var is 11 6 | }, 7 | case > 10 { 8 | /say var is over 10 9 | }, 10 | case < 10 { 11 | /say var is below 10 12 | }, 13 | default { 14 | /say no match 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /examples/scripts/while-Loops.mcscript: -------------------------------------------------------------------------------- 1 | #file: ./while 2 | while('entity @s[tag=loop]'){ 3 | log("commands") 4 | } 5 | -------------------------------------------------------------------------------- /lib/consoletheme.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | Reset: "\x1b[0m", 3 | Bright: "\x1b[1m", 4 | Dim: "\x1b[2m", 5 | Underscore: "\x1b[4m", 6 | Blink: "\x1b[5m", 7 | Reverse: "\x1b[7m", 8 | Hidden: "\x1b[8m", 9 | 10 | FgBlack: "\x1b[30m", 11 | FgRed: "\x1b[31m", 12 | FgGreen: "\x1b[32m", 13 | FgYellow: "\x1b[33m", 14 | FgBlue: "\x1b[34m", 15 | FgMagenta: "\x1b[35m", 16 | FgCyan: "\x1b[36m", 17 | FgWhite: "\x1b[37m", 18 | 19 | BgBlack: "\x1b[40m", 20 | BgRed: "\x1b[41m", 21 | BgGreen: "\x1b[42m", 22 | BgYellow: "\x1b[43m", 23 | BgBlue: "\x1b[44m", 24 | BgMagenta: "\x1b[45m", 25 | BgCyan: "\x1b[46m", 26 | BgWhite: "\x1b[47m", 27 | }; 28 | -------------------------------------------------------------------------------- /lib/gen_new.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | const path = require("path"); 3 | 4 | let packid = ""; 5 | genNew = function (name) { 6 | packid = name.toLowerCase().replace(" ", "_"); 7 | // mcmeta file 8 | genFile( 9 | "pack.mcmeta", 10 | ` 11 | { 12 | "pack": { 13 | "pack_format": 6, 14 | "description": "` + 15 | packid + 16 | ` vanilla pack generated by mcscript" 17 | } 18 | }` 19 | ); 20 | // load event 21 | genFile( 22 | "data/minecraft/tags/functions/load.json", 23 | ` 24 | { 25 | "values":[ 26 | "` + 27 | packid + 28 | `:load" 29 | ] 30 | }` 31 | ); 32 | // clock event 33 | genFile( 34 | "data/minecraft/tags/functions/tick.json", 35 | ` 36 | { 37 | "values":[ 38 | "` + 39 | packid + 40 | `:main" 41 | ] 42 | }` 43 | ); 44 | // load.mcscript 45 | genFile( 46 | "data/" + packid + "/scripts/load.mcscript", 47 | `#file: ./load 48 | 49 | // here goes your load content` 50 | ); 51 | // load mcscript 52 | genFile( 53 | "data/" + packid + "/functions/mcscript/load.mcfunction", 54 | ` 55 | # please do not touch this file! 56 | # it is used by the compiler!` 57 | ); 58 | // main.mcscript 59 | genFile( 60 | "data/" + packid + "/scripts/main.mcscript", 61 | ` 62 | #file: ./main 63 | // here goes your main content 64 | // executes 20 times a second` 65 | ); 66 | ensureDirectoryExistence( 67 | packid + "/data/" + packid + "/advancements/test.js" 68 | ); 69 | ensureDirectoryExistence(packid + "/data/" + packid + "/tags/test.js"); 70 | }; 71 | 72 | function ensureDirectoryExistence(filePath) { 73 | const dirname = path.dirname(filePath); 74 | if (fs.existsSync(dirname)) { 75 | return true; 76 | } 77 | ensureDirectoryExistence(dirname); 78 | fs.mkdirSync(dirname); 79 | } 80 | 81 | function genFile(file, data) { 82 | file = packid + "/" + file; 83 | ensureDirectoryExistence(file); 84 | fs.writeFile(file, data, (err) => { 85 | if (err) throw err; 86 | console.log("\x1b[36m", "Generated ", "\x1b[33m", file, "\x1b[0m"); 87 | }); 88 | } 89 | 90 | exports.new = genNew; 91 | -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | 3 | const lexer = require('./lexer.js'); 4 | const parser = require('./parser.js'); 5 | const gen = require('./generator.js'); 6 | const consoletheme = require("./consoletheme.js"); 7 | 8 | let preOptions; 9 | const compile = function (path, fullErr) { 10 | return new Promise(function (resolve, reject) { 11 | let num = 1; 12 | gen.clearVars(); 13 | if (fs.lstatSync(path).isFile()) { 14 | 15 | readFile(path).then(resolve); 16 | console.log(consoletheme.FgGreen, "Read " + num + " Files and compiled successfully", consoletheme.Reset); 17 | 18 | } else { 19 | 20 | if (fs.existsSync(path + "/mcscript")) gen.getFiles(path + "/mcscript", "mcfunction").forEach((item) => { 21 | fs.unlink(item, () => false); 22 | }); 23 | 24 | preOptions = { 25 | vars: [], 26 | modals: [], 27 | tags: [], 28 | consts: [] 29 | }; 30 | let files = gen.getFiles(path); 31 | let globals = files.filter(x => { 32 | if (x.split(".").slice(-2).join(".") === 'gl.mcscript') { 33 | files.splice(files.indexOf(x), 1); 34 | return true 35 | } 36 | return false 37 | }); 38 | 39 | let promises = []; 40 | 41 | for (let file of globals) { 42 | promises.push(readFile(file, {noParse: 'vars', fullErr: fullErr})); 43 | } 44 | for (let file of files) { 45 | num++; 46 | promises.push(readFile(file, {fullErr: fullErr})); 47 | } 48 | 49 | Promise.all(promises).then(()=>{ 50 | console.log(consoletheme.FgGreen, "Read " + num + " Files and compiled successfully", consoletheme.Reset); 51 | resolve() 52 | }) 53 | } 54 | }) 55 | }; 56 | 57 | function changeOptions(opt) { 58 | preOptions.vars = preOptions.vars.concat(opt.vars.filter(x => preOptions.vars.indexOf(x) === -1)); 59 | 60 | preOptions.modals = preOptions.modals.concat(opt.modals.filter(x => preOptions.modals.indexOf(x) === -1)); 61 | 62 | preOptions.tags = preOptions.tags.concat(opt.tags.filter(x => preOptions.tags.indexOf(x) === -1)); 63 | 64 | preOptions.consts = preOptions.consts.concat(opt.consts.filter(x => preOptions.consts.indexOf(x) === -1)); 65 | } 66 | 67 | const genModals = function (path) { 68 | 69 | if (fs.lstatSync(path).isFile()) { 70 | 71 | readFile(path, {noParse: "modal"}); 72 | console.log(consoletheme.FgGreen, "Read " + path + " and compiled to JSON", consoletheme.Reset); 73 | 74 | } else { 75 | throw "Just one File accepted!"; 76 | } 77 | }; 78 | 79 | const watch = function (path, fullErr) { 80 | 81 | console.log(consoletheme.FgGreen, "Now I watch your files on " + path + " to change! *-*", consoletheme.Reset); 82 | 83 | let counter = false; 84 | 85 | fs.watch(path, {recursive: true}, (eventType, filename) => { 86 | if(filename === null) 87 | return; 88 | filename = filename.replace("/\\/g", "/"); 89 | 90 | if (filename && filename.split('.').pop() === 'mcscript' && counter) 91 | compile(path, {fullErr: fullErr}); 92 | counter = !counter; 93 | }); 94 | }; 95 | 96 | function readFile(file, options = {}) { 97 | return new Promise(function (resolve, reject) { 98 | fs.readFile(file, {encoding: "utf8"}, function (err, data) { 99 | 100 | data = data.split("\n"); 101 | for (let item of data) { 102 | 103 | if (item.trim() === "{") 104 | data[data.indexOf(item) - 1] = data[data.indexOf(item) - 1].substr(0, data[data.indexOf(item) - 1].length - 2); 105 | 106 | if (",;({[".indexOf(item.trim().slice(-1)) === -1) 107 | data[data.indexOf(item)] += ";" 108 | } 109 | data = data.join("\n"); 110 | if (options.noParse === "modal") gen.getModals(parser.parse(lexer.lexer(data)), file); 111 | else if (options.noParse === "json") gen.getAst(parser.parse(lexer.lexer(data)), file); 112 | else if (options.noParse === "vars") changeOptions(gen.getVars(parser.parse(lexer.lexer(data)), file, preOptions)); 113 | else 114 | try { 115 | gen.parseCode(parser.parse(lexer.lexer(data, file)), file, preOptions).then(resolve) 116 | } catch (err) { 117 | if (err.message && err.message.substr(0, 7) === "[Debug]") { 118 | console.log(err.message); 119 | let oldMess = err.message.split(" ")[0].substr(7); 120 | err.message = err.message.split(" ").slice(1).join(" "); 121 | console.log(consoletheme.FgRed, "[Debugger]", consoletheme.FgCyan, oldMess, consoletheme.FgWhite, err, consoletheme.Reset,); 122 | } else if (!options.fullErr) console.log(consoletheme.FgRed, "[Error]", err.message || err, "\n\n " + file + " was not compiled!", consoletheme.Reset); 123 | else console.log(err); 124 | } 125 | }); 126 | }) 127 | } 128 | 129 | exports.compile = compile; 130 | exports.watch = watch; 131 | exports.genModals = genModals; 132 | -------------------------------------------------------------------------------- /lib/modals/basic.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "type": "call", 4 | "func": "log", 5 | "args": [ 6 | { 7 | "type": "var", 8 | "value": "text" 9 | }, 10 | { 11 | "type": "assign", 12 | "operator": "=", 13 | "left": { 14 | "type": "var", 15 | "value": "sel" 16 | }, 17 | "right": { 18 | "type": "str", 19 | "value": "@a" 20 | } 21 | } 22 | ], 23 | "after": "tellraw $(sel) [{\"text\":\"console => \",\"color\":\"aqua\"},{\"text\":\"$(text)\",\"color\":\"white\"}]" 24 | }, 25 | { 26 | "type": "call", 27 | "func": "newStand", 28 | "args": [ 29 | { 30 | "type": "assign", 31 | "operator": "=", 32 | "left": { 33 | "type": "var", 34 | "value": "name" 35 | }, 36 | "right": { 37 | "type": "str", 38 | "value": "" 39 | } 40 | }, 41 | { 42 | "type": "assign", 43 | "operator": "=", 44 | "left": { 45 | "type": "var", 46 | "value": "position" 47 | }, 48 | "right": { 49 | "type": "str", 50 | "value": "~ ~ ~" 51 | } 52 | }, 53 | { 54 | "type": "assign", 55 | "operator": "=", 56 | "left": { 57 | "type": "var", 58 | "value": "tags" 59 | }, 60 | "right": { 61 | "type": "str", 62 | "value": "[]" 63 | } 64 | }, 65 | { 66 | "type": "assign", 67 | "operator": "=", 68 | "left": { 69 | "type": "var", 70 | "value": "marker" 71 | }, 72 | "right": { 73 | "type": "num", 74 | "value": 1 75 | } 76 | }, 77 | { 78 | "type": "assign", 79 | "operator": "=", 80 | "left": { 81 | "type": "var", 82 | "value": "invisible" 83 | }, 84 | "right": { 85 | "type": "num", 86 | "value": 1 87 | } 88 | }, 89 | { 90 | "type": "assign", 91 | "operator": "=", 92 | "left": { 93 | "type": "var", 94 | "value": "noGravity" 95 | }, 96 | "right": { 97 | "type": "num", 98 | "value": 1 99 | } 100 | } 101 | ], 102 | "after": "summon armor_stand $(position) {CustomName:\"{\\\"text\\\":\\\"$(name)\\\"}\", Tags: $(tags),Invisible:$(invisible),Marker:$(marker),NoGravity:$(noGravity)}" 103 | }, 104 | { 105 | "type": "call", 106 | "func": "play", 107 | "args": [ 108 | { 109 | "type": "var", 110 | "value": "sound" 111 | }, 112 | { 113 | "type": "assign", 114 | "operator": "=", 115 | "left": { 116 | "type": "var", 117 | "value": "selector" 118 | }, 119 | "right": { 120 | "type": "str", 121 | "value": "@s" 122 | } 123 | }, 124 | { 125 | "type": "assign", 126 | "operator": "=", 127 | "left": { 128 | "type": "var", 129 | "value": "type" 130 | }, 131 | "right": { 132 | "type": "str", 133 | "value": "master" 134 | } 135 | } 136 | ], 137 | "after": "playsound $(sound) $(type) $(selector)\r" 138 | }, 139 | 140 | { 141 | "type": "calljs", 142 | "func": "log.var", 143 | "args": [ 144 | { 145 | "type": "var", 146 | "value": "scoreboard" 147 | }, 148 | { 149 | "type": "assign", 150 | "operator": "=", 151 | "left": { 152 | "type": "var", 153 | "value": "name" 154 | }, 155 | "right": { 156 | "type": "str", 157 | "value": "" 158 | } 159 | }, 160 | { 161 | "type": "assign", 162 | "operator": "=", 163 | "left": { 164 | "type": "var", 165 | "value": "sel" 166 | }, 167 | "right": { 168 | "type": "str", 169 | "value": "@a" 170 | } 171 | } 172 | ], 173 | "after": [ 174 | { 175 | "type": "call", 176 | "value": "\r\n //console.log(name)\r;\n if(name){\r\n return 'tellraw '+sel+' [{\"text\":\"console => \",\"color\":\"aqua\"},{\"score\":{\"name\":\"'+name+'\",\"objective\": \"'+scoreboard+'\"},\"color\":\"white\"}]'\r;\n } else {\r\n return 'tellraw '+sel+' [{\"text\":\"console => \",\"color\":\"aqua\"},{\"score\":{\"name\":\"'+scoreboard+'\",\"objective\": \"'+scoreboard+'\"},\"color\":\"white\"}]'\r;\n }\r;\n" 177 | } 178 | ] 179 | } 180 | ] 181 | -------------------------------------------------------------------------------- /lib/modals/basic.mcscript: -------------------------------------------------------------------------------- 1 | modal log (msg, sel = "@a"){ 2 | /tellraw $(sel) [{"text":"console => ","color":"aqua"},{"text":"$(text)","color":"white"}] 3 | } 4 | 5 | modaljs log.var(scoreboard,name = "",sel = "@a"){ 6 | //console.log(name) 7 | if(name){ 8 | return 'tellraw '+sel+' [{"text":"console => ","color":"aqua"},{"score":{"name":"'+name+'","objective": "'+scoreboard+'"},"color":"white"}]' 9 | } else { 10 | return 'tellraw '+sel+' [{"text":"console => ","color":"aqua"},{"score":{"name":"'+scoreboard+'","objective": "'+scoreboard+'"},"color":"white"}]' 11 | } 12 | } 13 | 14 | log.var("hello","he") 15 | -------------------------------------------------------------------------------- /lib/modals/cam.json: -------------------------------------------------------------------------------- 1 | [{"type":"call","func":"cam.start","args":[{"type":"assign","operator":"=","left":{"type":"var","value":"entity"},"right":{"type":"str","value":"@s"}}],"after":"execute as $(entity) run function cam:start\r"},{"type":"call","func":"cam.stop","args":[{"type":"assign","operator":"=","left":{"type":"var","value":"entity"},"right":{"type":"str","value":"@s"}}],"after":"execute as $(entity) run function cam:stop\r"},{"type":"call","func":"cam.pos1","args":[{"type":"assign","operator":"=","left":{"type":"var","value":"location"},"right":{"type":"str","value":"~ ~ ~"}},{"type":"assign","operator":"=","left":{"type":"var","value":"rotation"},"right":{"type":"str","value":"~ ~"}}],"after":"execute positioned $(location) rotated $(rotation) run function cam:pos1\r"},{"type":"call","func":"cam.pos2","args":[{"type":"assign","operator":"=","left":{"type":"var","value":"location"},"right":{"type":"str","value":"~ ~ ~"}},{"type":"assign","operator":"=","left":{"type":"var","value":"rotation"},"right":{"type":"str","value":"~ ~"}}],"after":"execute positioned $(location) rotated $(rotation) run function cam:pos2\r"},{"type":"call","func":"cam.time","args":[{"type":"assign","operator":"=","left":{"type":"var","value":"length"},"right":{"type":"num","value":10}},{"type":"assign","operator":"=","left":{"type":"var","value":"entity"},"right":{"type":"str","value":"@s"}}],"after":"scoreboard players set $(entity) camTime $(length)\r"},{"type":"call","func":"cam.noParticles","args":[{"type":"assign","operator":"=","left":{"type":"var","value":"entity"},"right":{"type":"str","value":"@s"}}],"after":"tag $(entity) add camNoParticles\r"},{"type":"call","func":"cam.noText","args":[{"type":"assign","operator":"=","left":{"type":"var","value":"entity"},"right":{"type":"str","value":"@s"}}],"after":"tag $(entity) add camNoText\r"}] 2 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mcscript", 3 | "version": "0.2.3", 4 | "description": "Minecraft Script to mcfunction compiler cli", 5 | "homepage": "http://stevertus.com/mcscript", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "Stevertus", 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/Stevertus/mcscript.git" 13 | }, 14 | "bugs": { 15 | "url": "https://github.com/Stevertus/mcscript/issues" 16 | }, 17 | "license": "ISC", 18 | "bin": { 19 | "mcscript": "bin/test-module.js", 20 | "mcscript-watch": "bin/watch.js", 21 | "mcscript-modals": "bin/modal.js" 22 | }, 23 | "main": "./lib/index.js", 24 | "preferGlobal": true 25 | } 26 | --------------------------------------------------------------------------------