{displayName}
- {info ? --
{data.children.name}
-404 Not Found
-Not The Page You Were Looking For...
-- {data.children} -
- -} \ No newline at end of file diff --git a/src/components/aside/aside.tsx b/src/components/aside/aside.tsx deleted file mode 100644 index 97a7781..0000000 --- a/src/components/aside/aside.tsx +++ /dev/null @@ -1,97 +0,0 @@ -"use client"; -import { AnimatePresence, Variants, motion } from "framer-motion"; -import Link from "next/link"; -import { useEffect, useState } from "react"; - - -export interface SideBarOptions { - tags: { [k: string]: { display: string, color?: string } } - menus: { [k: string]: { title: string, link: string }[] } -} -export default function SideBar(params: { options: SideBarOptions }) { - //TODO : Fix Re-Rendering Of Component on Resize With Memo - //const mobile = isMobile() - - const [expanded, setExpanded] = useState(true); - - useEffect(() => { - window.__sidebar = () => setExpanded(!expanded); - }) - - const container = { - hidden: { opacity: 1, scale: 0 }, - visible: { - opacity: 1, - scale: 1, - transition: { - delayChildren: 0.2, - staggerChildren: 0.1 - } - } - } satisfies Variants; - - const item = { - hidden: { y: 20, opacity: 0 }, - visible: { - y: 0, - opacity: 1 - } - } satisfies Variants; - - - - const arrayComponents = []; - let i = 0; - for (const tag of Object.keys(params.options.tags)) { - if (!(tag in params.options.menus)) continue; - console.log(params.options.menus); - const { display: title, color } = params.options.tags[tag]; - const subComponens = []; - subComponens.push( -- {children} -
-} -function A({ children, href, title }: { children?: any, href?: string, title?: string }) { - return - {children} - -} -function Li({ children, kind }: { children?: any, kind?: string }) { //•▪●○►○●□■ - return{params.children}
-}
-export function PreCode(params: any) {
- multilineCodeBlocks.add(params.children.props);
- return (
- - { - params.className in languageToTextMap? - <> -- ) -} -export function Image(params: any) { - const src = params.src??""; - if(!src.startsWith("http")) { - const path = src.split("/"); - let count = 0; - let k = 0; - for(const p of path) { - if(p === "." && k < 0) throw new ReferenceError("Invalid Path: " + src); - else if(p === ".." && k > 0) throw new ReferenceError("Invalid Path: " + src); - else if(p === "."){ - k = 1; - count++; - break; - } - else if(p === ".."){ - k = -1; - count++; - continue; - } - break; - } - const a = statSync(resolve("./public/", path.slice(count).join("/"))); - if(!a.isFile()) throw new ReferenceError("UNKNOWN IMAGE PATH: " + src); - return - } - return -} - - -export function TableTh(params: any) { - return{languageToTextMap[params.className]}
- - > - :(params.className?console.warn("Unknown code block: " + params.className) as undefined:undefined) - } -- {params.children} --
{{ theme }}+ +### Page Data +
{{ page }}+ +### Page Frontmatter +
{{ frontmatter }}+``` + + + +## Results + +### Theme Data +
{{ theme }}+ +### Page Data +
{{ page }}+ +### Page Frontmatter +
{{ frontmatter }}+ +## More + +Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata). diff --git a/wiki/data-sheets/api-environment.md b/wiki/data-sheets/api-environment.md deleted file mode 100644 index 4469640..0000000 --- a/wiki/data-sheets/api-environment.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -displayName: API Environment -kind: data -author: conmaster2112 -tags: - - info ---- -Minecraft: Bedrock Edition uses their own version of JavaScript environment based on QuickJS engine. Most things relay on ECMAScript (ES) specifications, but there are exceptions that are not subject to these specifications. - -## Common problems - -- **SetTimeout support** - - What people often run into when starting out with Minecraft Scripting is the problem with timing, the standards for timing code as you may have noticed are the `setTimeout` and `setInterval` functions and their clear functions. - - These standardized methods are used by the frame system where you can set the delay to millisecond precision, but minecraft uses a tick to process changes in the world, right? That's why even these methods are not and will not be available, instead we got the [`system.runTimeout`](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/system#runtimeout) and [`system.runInterval`](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/system#runinterval) system methods since 1.19.70 development cycle, which delay to the precision of one tick, you can read more about on [Microsoft Docs](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/system). - -- **Eval permission** - - Not everyone can encounter this problem because the use of eval and Function method for running code in string format is not right. - Some browsers also prohibit the use of these methods, mainly the eval method, when using eval there is a risk of malicious code that can harm the problem in your add-on, which is why it is disabled by default. - - To enable these methods that evaluate code, you must mention it in the manifest capabilities. - -- **Native handles** - - Some objects passed to us by the API have their own native handle, in some cases these objects are released before the javascript object is released, which then results in an error being reported when calling native methods, Native object bound to prototype doesn't exist. - - That means the only function you called with a non-natively released object, the function tries to find a native handle on an object that is no longer there. - -## Support - -- ***What is supported*** - - `Object` - Standard function constructor for objects - - `Function` - Standard function constructor for functions - - `Error` - (`EvalError`, `RangeError`, `ReferenceError`, `SyntaxError`, `TypeError`, `URIError`, `InternalError`, `AggregateError`) - Classes for error construction - - `Array` - (`Int8Array`, `UInt8Array`, `Int16Array`, `UInt16Array`, `Int32Array`, `UInt32Array`, `Float32Array`, `Float64Array`, `SharedArrayBuffer`, `ArrayBuffer`, `UInt8ClampedArray`) Standard function constructor for Array objects - - `parseInt`, `parseFloat` - Standard methods for parsing string to number - - `isNaN`, `isFinite` - Standard Methods for checking number types - - `decodeURI`, `encodeURI` - Standard methods for decoding and encoding URI paths - - `decodeURIComponent`, `encodeURIComponent` - Standard methods for decoding and encoding URI components - - `escape`, `unescape` - Non-Standard methods please use decodeURI/encodeURI if its possible - - `NaN`, `Infinity`, `undefined` - Standard variables for incode usage, - - `__date_clock` - Build-in QuickJS method for getting current time - - `Number`, `Boolean`, `String`, `Symbol` - Standard function constructor for JS primitives - - `Math` - Standard Object having primary math functions - - `Reflect` - Standard Object having build-in methods - - `eval` - Standard Method for evaluating string as code - - `globalThis` - Standard Object with access to global scoped variables - - `Date` - Standard function constructor for date instance - - `RegExp` - Standard function constructor for regex instance - - `JSON` - Standard Object having stringify and parse methods for JSON interaction - - `Proxy` - Standard function constructor for build-in proxy handler - - `Map`, `Set`, `WeakMap`, `WeakSet` - Standard function constructors for data organisation objects - - `DataView` - Standard function constructor for binary arrays interactions - - `Promise` - Standard function constructor for async interaction - - `console` - Standard object having base output methods (`log`, `warn`, `error`, `info`) - -- ***What is not supported*** - - `WeakRef` - Object handler constructor with weak reference - - `BigInt` - Standard function constructor for big ints - - `setTimeout` - Standard function for timing code runs - - `setInterval` - Standard function for timing code runs in intervals - - `clearTimeout` - Standard function for canceling setTimeout runs - - `clearInterval` - Standard function for canceling setInterval runs \ No newline at end of file diff --git a/wiki/guides/hello-world.md b/wiki/guides/hello-world.md deleted file mode 100644 index f1f7323..0000000 --- a/wiki/guides/hello-world.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -displayName: Hello World -kind: guide -author: conmaster2112 -tags: - - info - - js ---- - -In this article, you will learn how to create a `Hello World' addon plugin, although this is one of the simpler guides, so we assume that you already have your development environment ready and you know the basics of creating an addon for MCBE. - -## Behavior Pack -Behavior pack is one of the possible types of packs that your addon can contain, and it is currently the only type of pack that can contain executable JS code. First, we need to create a `manifest.json` file, which will contain all the information and the pack carrier, including information about our executable code. -```json -{ - "format_version": 2, - "header": { - "name": "Hello-World", - "description": "My first hello to world :)", - "uuid": "84c5cdfd-5fbb-4ba5-a9f5-c55d5e606ac6", //Random GUID, this should be unique for each of your projects. - "version": "1.0.0", - "min_engine_version": [1,20,60] - }, - "modules": [ - { - "type": "script", //our pack has scripts - "uuid": "3ed7d070-c9ca-4fe2-bf1b-efe52e74c9fc", //Second Random GUID, this should be unique for each of your projects. - "entry": "scripts/index.js", //the entry of our script - "version": [ 0, 1, 0 ] - } - ], - "dependencies": [ - { - "module_name": "@minecraft/server", //Dependency to minecraft server APIs - "version": "1.9.0" - } - ] -} -``` - -Open minecraft and you will find that your empty pack is visible in the behavior packs section and create a new world with that pack. - -![[]](../images/empty-behavior.png) -If this error message appears during creation, then we have achieved success. -``` -[Scripting][Error]-Plugin [Hello-World - 0.1.0] - does not contain main file [index.js]. -``` - -## Entry source file -After we have managed to prepare the pack, all we have to do is add our script. Create a file that will be in the `scripts` folder located in the root of the pack, then add the `index.js` file with your code: -```js -import {system} from "@minecraft/server"; - -system.runInterval(()=>{ - console.warn("Hello World!"); //Log hello world to console -}, 40); // 40ticks = 2s -``` -> **Final Pack Structure** -> -> `manifest.json` -> -> `scripts/index.js` - -## Congratulation -You did it! -![[]](../images/hello-world.png) \ No newline at end of file diff --git a/wiki/images/empty-behavior.png b/wiki/images/empty-behavior.png deleted file mode 100644 index 8c77682..0000000 Binary files a/wiki/images/empty-behavior.png and /dev/null differ diff --git a/wiki/images/hello-world.png b/wiki/images/hello-world.png deleted file mode 100644 index 53d765b..0000000 Binary files a/wiki/images/hello-world.png and /dev/null differ diff --git a/wiki/index.md b/wiki/index.md new file mode 100644 index 0000000..f28019a --- /dev/null +++ b/wiki/index.md @@ -0,0 +1,38 @@ +--- +# https://vitepress.dev/reference/default-theme-home-page +layout: home + +hero: + name: "Script API Wiki" + text: "Bedrock Script API Wiki and Resources" + tagline: It's never too late to start scripting Minecraft! + actions: + - theme: brand + text: How to start + link: /markdown-examples + - theme: alt + text: Templates + link: /api-examples + +features: + - title: Start Scripting + details: Lorem ipsum dolor sit amet, consectetur adipiscing elit + link: https://vitepress.dev/reference/default-theme-home-page + - title: Feature B + details: Lorem ipsum dolor sit amet, consectetur adipiscing elit + - title: Feature C + details: Lorem ipsum dolor sit amet, consectetur adipiscing elit + - title: Feature D + details: Lorem ipsum dolor sit amet, consectetur adipiscing elit + - title: Feature E + details: Lorem ipsum dolor sit amet, consectetur adipiscing elit + - title: Feature E + details: Lorem ipsum dolor sit amet, consectetur adipiscing elit + - title: Feature E + details: Lorem ipsum dolor sit amet, consectetur adipiscing elit + - title: Feature E + details: Lorem ipsum dolor sit amet, consectetur adipiscing elit + - title: Feature E + details: Lorem ipsum dolor sit amet, consectetur adipiscing elit +--- + diff --git a/wiki/markdown-examples.md b/wiki/markdown-examples.md new file mode 100644 index 0000000..f9258a5 --- /dev/null +++ b/wiki/markdown-examples.md @@ -0,0 +1,85 @@ +# Markdown Extension Examples + +This page demonstrates some of the built-in markdown extensions provided by VitePress. + +## Syntax Highlighting + +VitePress provides Syntax Highlighting powered by [Shiki](https://github.com/shikijs/shiki), with additional features like line-highlighting: + +**Input** + +````md +```js{4} +export default { + data () { + return { + msg: 'Highlighted!' + } + } +} +``` +```` + +**Output** + +```js{4} +export default { + data () { + return { + msg: 'Highlighted!' + } + } +} +``` + +## Custom Containers + +**Input** + +```md +::: info +This is an info box. +::: + +::: tip +This is a tip. +::: + +::: warning +This is a warning. +::: + +::: danger +This is a dangerous warning. +::: + +::: details +This is a details block. +::: +``` + +**Output** + +::: info +This is an info box. +::: + +::: tip +This is a tip. +::: + +::: warning +This is a warning. +::: + +::: danger +This is a dangerous warning. +::: + +::: details +This is a details block. +::: + +## More + +Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown). diff --git a/wiki/metadata.json b/wiki/metadata.json deleted file mode 100644 index 00db427..0000000 --- a/wiki/metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "tags":{ - "info":{ - "display":"Information", - "color":"#0059b3" - }, - "outdated":{ - "display":"Outdated", - "color":"#990000" - }, - "depracated":{ - "display":"Deprecated", - "color":"#994411" - }, - "js":{ - "display":"JavaScript", - "color":"#cca300", - "text-color":"black" - }, - "ts":{ - "display":"TypeScript", - "color":"#0059b3" - }, - "experimental":{ - "display":"Experimental", - "color":"#396727" - }, - "pseudo":{ - "display":"Pseudo Code", - "color":"#111" - } - }, - "blog_kind":{ - "docs": { - "display":"Documentation", - "color":"#0059b3" - }, - "blog":{ - "display": "Blogs", - "color":"#660066" - }, - "dev": { - "display":"Examples", - "color":"#987420" - }, - "guide":{ - "display":"Guides", - "color":"#96482C" - }, - "data":{ - "display":"Data Sheets", - "color":"#396727" - } - }, - "code-languages":{ - "language-js": "JavaScript", - "language-javascript": "JavaScript", - "language-ts": "TypeScript", - "language-typescript": "TypeScript", - "language-json": "JSON", - "language-md": "Markdown", - "language-markdown": "Markdown", - "language-cpp": "C++", - "language-c": "C", - "language-h": "C", - "language-hpp": "C" - } -} \ No newline at end of file diff --git a/wiki/~home.md b/wiki/~home.md deleted file mode 100644 index 3c5acba..0000000 --- a/wiki/~home.md +++ /dev/null @@ -1 +0,0 @@ -# Bedrock Scripting Wiki \ No newline at end of file diff --git a/wiki/~privacy-policy.md b/wiki/~privacy-policy.md deleted file mode 100644 index 1a05203..0000000 --- a/wiki/~privacy-policy.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -displayName: Privacy Policy ---- -## Introduction -Welcome to here! This page provides information on how we handle data privacy on our website. - -### Data Collection and Usage -Our website does not collect any personal data. We don’t have forms, logins, or visitor tracking. -Third-Party Technologies: We use GitHub to host our site. While we don’t directly collect data, GitHub may collect anonymous technical information (such as IP addresses and browser details) unrelated to specific individuals. - -### Cookies -Our website does not use cookies or other tracking technologies. - -### Third-Party Links -Our website may contain links to external sites. These sites have their own privacy policies! - -### Contact -If you have any questions regarding our privacy policy, feel free to contact us at [discord](https://discord.gg/38M6A2RvKk). \ No newline at end of file diff --git a/wiki/~tags.md b/wiki/~tags.md deleted file mode 100644 index 9b7f241..0000000 --- a/wiki/~tags.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -displayName: Tags ---- - --