Contributing to Wiki
You can check out Test to see all the things that are possible with this wiki.
Make sure to also check the README of the wiki repo on GitHub for info on the file structure.
#Formatting Rules
To make the wiki easier to follow, all code should be formatted like this:
- In code blocks, use tab characters, not spaces.
- Use
constfor variables whenever possible. - Use
eventas the name of the event handler callback parameter. - Use arrow functions (
() => {}) for all functions. - Omit parentheses for one-parameter arrow functions (
ServerEvents.recipes(event => {})). - Use descriptive but concise names for variable names (like
ctx,context), do not use single letter names (c) unless it's a commonly used name (iandjfor loop indices,x,yandzfor coordinates). - Whenever a Minecraft item is used, use it with the
minecraft:namespace. Did you know you could skip it? - Don't leave trailing commas.
- For string literals, use single quotes (
'minecraft:stone'), unless usage of double quotes will result in less quotes being escaped ("I'm not escaped!"). - Leave a space after starting a comment (
// This is a comment with a space!). - Start comments with a capital letter, unless it contains code (
// console.log('Here we don't start with a capital letter')) - Use Beans.
- Whenever a floating point number is used with the floating point equal to 0 (
5.0), skip the floating point. - Do not use semicolons, unless it's after a
returncall or it's absolutely necessary due to the code being parsed unexpectedly. However, such cases should be avoided if possible.
console.log('Hello, world!')
// Here, a semicolon is needed in order for code to be not parsed as:
// console.log('Hello, world!')['minecraft:stone', 'minecraft:cobblestone'].forEach(item => {})
;['minecraft:stone', 'minecraft:cobblestone'].forEach(item => {})- After operators like
if,for, etc., use a space. Always wrap code in a branch with a block, unless that branch results in an early return.
if (player.hand == "OFF_HAND") return; // Here, `return` doesn't need to be wrapped in a block.
if (player.hand == "MAIN_HAND") {
console.log("Right-clicked with main hand")
}You can check
https://kubejs.com/wiki/preview/x for a preview of a currently open PR.Make sure to NOT force push. Currently doing so will cause the preview to not update.