diff --git a/README.md b/README.md index b961ecdea..64969bb73 100644 --- a/README.md +++ b/README.md @@ -85,9 +85,17 @@ Java version 7 or later installed. Check the version by typing `java # Installation -Before installing ScriptCraft you must first install SpigotMC which is -a special version of Minecraft Server that makes it easy to customize -the game. +Before installing ScriptCraft you must first install + +1. Java and JavaScript engine +2. SpigotMC which is a special version of Minecraft Server that makes it easy to customize the game. + +## Installing Java and JavaScript + +Unfortunately, the most used Java distribution (Oracle JDK or OpenJDK) does NOT include any more the JavaScript engine (called Nashorn), starting from [release 15](https://openjdk.java.net/jeps/372) (and deprecated since [release 11](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.scripting.nashorn/module-summary.html)). +The most suited replacement is [GraalVM](https://www.graalvm.org/), still from Oracle. You can dowload the package from the [GraalVM web site](https://www.graalvm.org/) and [install it](https://www.graalvm.org/docs/getting-started/) according to your Operating System. Note that this may require some manual setup (e.g. under Windows, adding the binaries path to the PATH environmental variable). +Note that if you already have a working Java installation (e.g. OpenJDK) the two may clash, so you may end up with Java from OpenJDK and JavaScript from GraalVM. This is untested. + ## Installing and Running SpigotMC @@ -102,13 +110,27 @@ Follow these steps to download and install SpigotMC. ## Installing ScriptCraft +### Install pre-compiled ScriptCraft + Follow these steps to download and install ScriptCraft. 1. Download the [scriptcraft.jar][dl] plugin and save it to the `plugins` directory and restart the server by typing `java -jar spigot-1.10.2.jar`. +**REMARK: the compiled scriptcraft.jar may fail with the newer Java/JavaScript version, in particular with GraalVM, due to subtle incompatibitities, see e.g. the [migration guide from Nashorn to GraalJS](https://docs.oracle.com/en/graalvm/enterprise/20/docs/reference-manual/js/NashornMigrationGuide/)**. In this case (errors when loading the plugin during the server start-up) you may need to use a newer scriptcraft.jar (you can try the '[scriptcraft.jar](https://github.com/ediloren/ScriptCraft/blob/development/target/scriptcraft.jar)' file you can find in the 'target' directory in this repository), or compile it yourself, see next paragraph. 2. At the server prompt type `js 1 + 1` and hit enter. The result `2` should be displayed. Congratulations - you've just installed your Custom Minecraft Server and are ready to begin writing your first mod! +### Install ScriptCraft from sources + +Download the latest sources from the current repository (the one hosting this readme). You can dowload them as Zip file or, if you know how to use **git**, you can clone the repository. + +These sources contain some patches that have been tested with GraalVM with Java release 21.2.0 under Windows10 and SpigotMC server. They are not guaranteed to work in other environments but may help fixing compatibility issues also in those cases. + +The sources are built using [Ant](https://ant.apache.org/). You must first install Ant. Be sure to follow the [installation instructions](https://ant.apache.org/manual/index.html) as it needs some manual configuration. + +Now you should be able to build ScriptCraft out of the box issuing the 'ant' command from a shell in the base directory where you cloned / unzipped your sources. +Ant will create a folder called 'target' in which you will find the file scriptcraft.jar at the end of the build process. + # Post Install Once installed, a new scriptcraft/plugins directory is automatically diff --git a/build.xml b/build.xml index 29c664c92..ed594c429 100644 --- a/build.xml +++ b/build.xml @@ -29,11 +29,11 @@ - - + @@ -57,15 +57,16 @@ - + - - + + @@ -75,7 +76,7 @@ - + @@ -91,24 +92,24 @@ - - + - - - @@ -125,7 +126,7 @@ - @@ -138,7 +139,7 @@ - @@ -152,7 +153,7 @@ -
<!-- +
<!-- IMPORTANT NOTE FOR CONTRIBUTORS ------------------------------- Contributors: This file is generated from comments in javascript source files src/main/js/* @@ -169,11 +170,11 @@ Walter Higgins
- + - + - @@ -182,8 +183,8 @@ Walter Higgins - @@ -193,7 +194,7 @@ Walter Higgins -
<!-- +
<!-- IMPORTANT NOTE FOR CONTRIBUTORS ------------------------------- Contributors: This file is generated from source file src/docs/templates/ypgpm.md @@ -203,7 +204,7 @@ Walter Higgins
- + @@ -217,8 +218,8 @@ Walter Higgins - @@ -241,20 +242,20 @@ Walter Higgins - - - + @@ -268,10 +269,10 @@ Walter Higgins [[version]] - + - + diff --git a/docs/API-Reference.md b/docs/API-Reference.md index 921429bca..552e4d600 100644 --- a/docs/API-Reference.md +++ b/docs/API-Reference.md @@ -1,4 +1,4 @@ - - - For convenience you can use a _corner stone_ to begin building. The corner stone should be located just above ground level. If the cross-hair is point at or into ground level when you create a new Drone() with either a player or location given as a parameter, then building begins at the location the player was looking at or at the location. You can get around this by pointing at a 'corner stone' just above ground level or alternatively use the following statement... - - d = new Drone(self).up(); - - ... which will move the drone up one block as soon as it's created. - - ![corner stone](img/cornerstone1.png) - - 3. Or by using the following form... - - d = new Drone(x,y,z,direction,world); - - This will create a new Drone at the location you specified using x, y, z In minecraft, the X axis runs west to east and the Z axis runs north to south. The direction parameter says what direction you want the drone to face: 0 = east, 1 = south, 2 = west, 3 = north. If the direction parameter is omitted, the player's direction is used instead. Both the `direction` and `world` parameters are optional. - - 4. Create a new Drone based on a Location object... - - d = new Drone(location); - - This is useful when you want to create a drone at a given `org.bukkit.Location` . The `Location` class is used throughout the bukkit API. For example, if you want to create a drone when a block is broken at the block's location you would do so like this... - - events.blockBreak( function( event ) { - var location = event.block.location; - var drone = new Drone(location); - // do more stuff with the drone here... - }); - -#### Parameters - - * Player : If a player reference is given as the sole parameter then the block the player was looking at will be used as the starting point for the drone. If the player was not looking at a block then the player's location will be used as the starting point. If a `Player` object is provided as a paramter then it should be the only parameter. - * location : *NB* If a `Location` object is provided as a parameter, then it should be the only parameter. - * x : The x coordinate of the Drone (x,y,z,direction and world are not needed if either a player or location parameter is provided) - * y : The y coordinate of the Drone - * z : The z coordinate of the Drone - * direction : The direction in which the Drone is facing. Possible values are 0 (east), 1 (south), 2 (west) or 3 (north) - * world : The world in which the drone is created. - -### Drone.box() method - -the box() method is a convenience method for building things. (For the more performance-oriented method - see cuboid) - -#### parameters - - * b - the block id - e.g. 6 for an oak sapling or '6:2' for a birch sapling. Alternatively you can use any one of the `blocks` values e.g. `blocks.sapling.birch` - * w (optional - default 1) - the width of the structure - * h (optional - default 1) - the height of the structure - * d (optional - default 1) - the depth of the structure - NB this is not how deep underground the structure lies - this is how far away (depth of field) from the drone the structure will extend. - -#### Example - -To create a black structure 4 blocks wide, 9 blocks tall and 1 block long... - - box(blocks.wool.black, 4, 9, 1); - -... or the following code does the same but creates a variable that can be used for further methods... - - var drone = new Drone(self); - drone.box(blocks.wool.black, 4, 9, 1); - -![box example 1](img/boxex1.png) - -### Drone.box0() method - -Another convenience method - this one creates 4 walls with no floor or ceiling. - -#### Parameters - - * block - the block id - e.g. 6 for an oak sapling or '6:2' for a birch sapling. Alternatively you can use any one of the `blocks` values e.g. `blocks.sapling.birch` - * width (optional - default 1) - the width of the structure - * height (optional - default 1) - the height of the structure - * length (optional - default 1) - the length of the structure - how far - away (depth of field) from the drone the structure will extend. - -#### Example - -To create a stone building with the insided hollowed out 7 wide by 3 tall by 6 long... - - box0( blocks.stone, 7, 3, 6); - -![example box0](img/box0ex1.png) - -### Drone.boxa() method - -Construct a cuboid using an array of blocks. As the drone moves first along the width axis, then the height (y axis) then the length, each block is picked from the array and placed. - -#### Parameters - - * blocks - An array of blocks - each block in the array will be placed in turn. - * width - * height - * length - -#### Example - -Construct a rainbow-colored road 100 blocks long... - - var rainbowColors = [blocks.wool.red, blocks.wool.orange, blocks.wool.yellow, blocks.wool.lime, - blocks.wool.lightblue, blocks.wool.blue, blocks.wool.purple]; - - boxa(rainbowColors,7,1,30); - -![boxa example](img/boxaex1.png) - -### Chaining - -All of the Drone methods return a Drone object, which means methods can be 'chained' together so instead of writing this... - - drone = new Drone( self ); - drone.fwd( 3 ); - drone.left( 2 ); - drone.box( blocks.grass ); // create a grass block - drone.up(); - drone.box( blocks.grass ); // create another grass block - drone.down(); - -...you could simply write ... - - var drone = new Drone(self).fwd(3).left(2).box(blocks.grass).up().box(blocks.grass).down(); - -... since each Drone method is also a global function that constructs a drone if none is supplied, you can shorten even further to just... - - fwd(3).left(2).box(blocks.grass).up().box(blocks.grass).down() - -The Drone object uses a [Fluent Interface][fl] to make ScriptCraft scripts more concise and easier to write and read. Minecraft's in-game command prompt is limited to about 80 characters so chaining drone commands together means more can be done before hitting the command prompt limit. For complex building you should save your commands in a new script file and load it using /js load() - -[fl]: http://en.wikipedia.org/wiki/Fluent_interface - -### Drone Properties - - * x - The Drone's position along the west-east axis (x increases as you move east) - * y - The Drone's position along the vertical axis (y increses as you move up) - * z - The Drone's position along the north-south axis (z increases as you move south) - * dir - The Drone's direction 0 is east, 1 is south , 2 is west and 3 is north. - -### Extending Drone - -The Drone object can be easily extended - new buidling recipes/blueprints can be added and can become part of a Drone's chain using the *static* method `Drone.extend`. - -### Drone.extend() static method - -Use this method to add new methods (which also become chainable global functions) to the Drone object. - -#### Parameters - - * name - The name of the new method e.g. 'pyramid'. - * function - The method body. - -Alternatively if you provide just a function as a parameter, then the function name will be used as the new method name. For example the following two approaches are both valid. - -#### Example 1 Using name and function as parameters - - // submitted by [edonaldson][edonaldson] - var Drone = require('drone'); - Drone.extend('pyramid', function( block, height ) { - this.chkpt('pyramid'); - for ( var i = height; i > 0; i -= 2) { - this.box(block, i, 1, i).up().right().fwd(); - } - return this.move('pyramid'); - }); - -#### Example 2 Using just a named function as a parameter - - var Drone = require('drone'); - function pyramid( block, height ) { - this.chkpt('pyramid'); - for ( var i = height; i > 0; i -= 2) { - this.box(block, i, 1, i).up().right().fwd(); - } - return this.move('pyramid'); - } - Drone.extend( pyramid ); - -Once the method is defined (it can be defined in a new pyramid.js file) it can be used like so... - - var d = new Drone(self); - d.pyramid(blocks.brick.stone, 12); - -... or simply ... - - pyramid(blocks.brick.stone, 12); - -[edonaldson]: https://github.com/edonaldson - -### Drone Constants - -#### Drone.PLAYER_STAIRS_FACING - -An array which can be used when constructing stairs facing in the Drone's direction... - - var d = new Drone(self); - d.box(blocks.stairs.oak + ':' + Drone.PLAYER_STAIRS_FACING[d.dir]); - -... will construct a single oak stair block facing the drone. - -#### Drone.PLAYER_SIGN_FACING - -An array which can be used when placing signs so they face in a given direction. This is used internally by the Drone.sign() method. It should also be used for placing any of the following blocks... - - * chest - * ladder - * furnace - * dispenser - -By default, chests, dispensers, signs, ladders and furnaces are placed facing towards the drone so to place a chest facing the Drone just use: - - drone.box( blocks.chest ); - -To place a chest facing _away_ from the Drone: - - drone.box( blocks.chest + ':' + Drone.PLAYER_SIGN_FACING[(drone.dir + 2) % 4]); - -#### Drone.PLAYER_TORCH_FACING - -Used when placing torches. By default torches will be placed facing up. If you want to place a torch so that it faces towards the drone: - - drone.box( blocks.torch + ':' + Drone.PLAYER_TORCH_FACING[drone.dir]); - -If you want to place a torch so it faces _away_ from the drone: - - drone.box( blocks.torch + ':' + Drone.PLAYER_TORCH_FACING[(drone.dir + 2) % 4]); - -#### Drone.MAX_SIDE - -Specifies the maximum length (in any dimension) when calling the Drone.cuboidX (box) method. -The default value is 1,000 blocks. - -If you see an error message in the console `Build too big!` It's because the width, height or length paramete was greater than the Drone.MAX_SIDE value. - -#### Drone.MAX_VOLUME - -Specifies the maximum value for any call to Drone.cuboidX (box) method. -The default value is 1,000,000 (1 million) blocks. - -If the volume (width X height X length) of any single call to the Drone.cuboidX() method exceeds this value, you will see an error message in the console `Build too big!` . - -The values of both the `Drone.MAX_SiDE` and `Drone.MAX_VOLUME` variables _can_ be overridden but it's not recommended. - -### Drone.times() Method - -The `times()` method makes building multiple copies of buildings -easy. It's possible to create rows or grids of buildings without -resorting to `for` or `while` loops. - -#### Parameters - - * numTimes : The number of times you want to repeat the preceding statements. - -#### Limitation - -For now, don't use `times()` inside a Drone method implementation – only use it at the in-game prompt as a short-hand workaround for loops. - -#### Example - -Say you want to do the same thing over and over. You have a couple of options: - - * You can use a `for` loop … - - d = new Drone(); for ( var i = 0; i < 4; i++ ) { d.cottage().right(8); } - -While this will fit on the in-game prompt, it's awkward. You need to -declare a new Drone object first, then write a `for` loop to create the -4 cottages. It's also error prone – even the `for` loop is too much -syntax for what should really be simple. - - * You can use a `while` loop … - - d = new Drone(); var i=4; while (i--) { d.cottage().right(8); } - -… which is slightly shorter but still too much syntax. Each of the -above statements is fine for creating a 1-dimensional array of -structures. But what if you want to create a 2-dimensional or -3-dimensional array of structures? Enter the `times()` method. - -The `times()` method lets you repeat commands in a chain any number of -times. So to create 4 cottages in a row you would use the following -statement: - - cottage().right(8).times(4); - -… which will build a cottage, then move right 8 blocks, then do it -again 4 times over so that at the end you will have 4 cottages in a -row. What's more, the `times()` method can be called more than once in -a chain. So if you wanted to create a *grid* of 20 houses ( 4 x 5 ), -you would do so using the following statement: - - cottage().right(8).times(4).fwd(8).left(32).times(5); - -… breaking it down … - - 1. The first 3 calls in the chain ( `cottage()`, `right(8)`, `times(4)` ) build a single row of 4 cottages. - - 2. The last 3 calls in the chain ( `fwd(8)`, `left(32)`, `times(5)` ) move the drone forward 8 then left 32 blocks (4 x 8) to return to the original X coordinate, then everything in the chain is repeated again 5 times so that in the end, we have a grid of 20 cottages, 4 x 5. Normally this would require a nested loop but the `times()` method does away with the need for loops when repeating builds. - -Another example: This statement creates a row of trees 2 by 3: - - oak().right(10).times(2).left(20).fwd(10).times(3) - -… You can see the results below. - -![times example 1](img/times-trees.png) - -### Drone.arc() method - -The arc() method can be used to create 1 or more 90 degree arcs in the -horizontal or vertical planes. This method is called by cylinder() and -cylinder0() and the sphere() and sphere0() methods. - -#### Parameters - -arc() takes a single parameter - an object with the following named properties... - - * radius - The radius of the arc. - * blockType - The type of block to use - this is the block Id only (no meta). See [Data Values][dv]. - * meta - The metadata value. See [Data Values][dv]. - * orientation (default: 'horizontal' ) - the orientation of the arc - can be 'vertical' or 'horizontal'. - * stack (default: 1 ) - the height or length of the arc (depending on the orientation - if orientation is horizontal then this parameter refers to the height, if vertical then it refers to the length ). - * strokeWidth (default: 1 ) - the width of the stroke (how many blocks) - if drawing nested arcs it's usually a good idea to set strokeWidth to at least 2 so that there are no gaps between each arc. The arc method uses a [bresenham algorithm][bres] to plot points along the circumference. - * fill - If true (or present) then the arc will be filled in. - * quadrants (default: `{topleft:true,topright:true,bottomleft:true,bottomright:true}` - An object with 4 properties indicating which of the 4 quadrants of a circle to draw. If the quadrants property is absent then all 4 quadrants are drawn. - -#### Examples - -To draw a 1/4 circle (top right quadrant only) with a radius of 10 and -stroke width of 2 blocks ... - - arc({blockType: blocks.iron, - meta: 0, - radius: 10, - strokeWidth: 2, - quadrants: { topright: true }, - orientation: 'vertical', - stack: 1, - fill: false - } ); - -![arc example 1](img/arcex1.png) - -[bres]: http://en.wikipedia.org/wiki/Midpoint_circle_algorithm -[dv]: http://www.minecraftwiki.net/wiki/Data_values - -### Drone.bed() method - -Creates a bed. The foot of the bed will be at the drone's location and -the head of the bed will extend away from the drone. - -#### Example -To create a bed at the in-game prompt, look at a block then type: - -```javascript -/js bed() -``` - -Like most Drone methods, this returns the drone so it can be chained like so: - -```javascript -this - .fwd(3) - .bed() - .back(3) -``` -### Drone.blocktype() method - -Creates the text out of blocks. Useful for large-scale in-game signs. - -#### Parameters - - * message - The message to create - (use `\n` for newlines) - * foregroundBlock (default: black wool) - The block to use for the foreground - * backgroundBlock (default: none) - The block to use for the background - -#### Example - -To create a 2-line high message using glowstone... - - blocktype('Hello\nWorld', blocks.glowstone); - -![blocktype example][imgbt1] - -[imgbt1]: img/blocktype1.png - -### Copy & Paste using Drone - -A drone can be used to copy and paste areas of the game world. - -#### Deprecated -As of January 10 2015 the copy-paste functions in Drone are no longer -supported. Copy/Paste is: - -1. Difficult to do correctly in a way which works for both Minecraft 1.7 and 1.8 - due to how blocks changed in 1.8 -2. Not aligned with the purpose of ScriptCraft's Drone module which is to provide - a simple set of functions for scripting and in-game building. - -### Drone.copy() method - -Copies an area so it can be pasted elsewhere. The name can be used for -pasting the copied area elsewhere... - -#### Parameters - -* name - the name to be given to the copied area (used by `paste`) -* width - the width of the area to copy -* height - the height of the area to copy -* length - the length of the area (extending away from the drone) to copy - -#### Example - - drone.copy('somethingCool',10,5,10 ).right(12 ).paste('somethingCool' ); - -### Drone.paste() method - -Pastes a copied area to the current location. - -#### Example - -To copy a 10x5x10 area (using the drone's coordinates as the starting -point) into memory. the copied area can be referenced using the name -'somethingCool'. The drone moves 12 blocks right then pastes the copy. - - drone.copy('somethingCool',10,5,10 ) - .right(12 ) - .paste('somethingCool' ); - -### Drone.cylinder() method - -A convenience method for building cylinders. Building begins radius blocks to the right and forward. - -#### Parameters - - * block - the block id - e.g. 6 for an oak sapling or '6:2' for a birch sapling. Alternatively you can use any one of the `blocks` values e.g. `blocks.sapling.birch` - * radius - * height - -#### Example - -To create a cylinder of Iron 7 blocks in radius and 1 block high... - - cylinder(blocks.iron, 7 , 1); - -![cylinder example](img/cylinderex1.png) - -### Drone.cylinder0() method - -A version of cylinder that hollows out the middle. - -#### Example - -To create a hollow cylinder of Iron 7 blocks in radius and 1 block high... - - cylinder0(blocks.iron, 7, 1); - -![cylinder0 example](img/cylinder0ex1.png) - -### Drone.door() method - -create a door - if a parameter is supplied an Iron door is created otherwise a wooden door is created. - -#### Parameters - - * doorType (optional - default wood) - If a parameter is provided then the door is Iron. - -#### Example - -To create a wooden door at the crosshairs/drone's location... - - var drone = new Drone(self); - drone.door(); - -To create an iron door... - - drone.door( blocks.door_iron ); - -![iron door](img/doorex1.png) - -### Drone.door_iron() method - -create an Iron door. - -### Drone.door2() method - -Create double doors (left and right side) - -#### Parameters - - * doorType (optional - default wood) - If a parameter is provided then the door is Iron. - -#### Example - -To create double-doors at the cross-hairs/drone's location... - - drone.door2(); - -![double doors](img/door2ex1.png) - -### Drone.door2_iron() method - -Create double iron doors - -### Drone.firework() method - -Launches a firework at the drone's location. - -#### Example - -To launch a firework: - - var drone = new Drone(self); - drone.firework(); - -### Drone.garden() method - -places random flowers and long grass (similar to the effect of placing bonemeal on grass) - -#### Parameters - - * width - the width of the garden - * length - how far from the drone the garden extends - -#### Example - -To create a garden 10 blocks wide by 5 blocks long... - - garden(10,5); - -![garden example](img/gardenex1.png) - -### Drone.ladder() method - -Creates a ladder extending skyward. - -#### Parameters - - * height (optional - default 1) - -#### Example - -To create a ladder extending 10 blocks high: - - var drone = new Drone(self); - drone.ladder(10) - -At the in-game prompt, look at a block and then type: - - /js ladder(10) - -A ladder 10 blocks high will be created at the point you were looking at. - -#### Since -##### 3.0.3 -### Drone Movement - -Drones can move freely in minecraft's 3-D world. You control the -Drone's movement using any of the following methods.. - - * up() - * down() - * left() - * right() - * fwd() - * back() - * turn() - -... Each of these methods takes a single optional parameter -`numBlocks` - the number of blocks to move in the given direction. If -no parameter is given, the default is 1. - -To change direction use the `turn()` method which also takes a single -optional parameter (numTurns) - the number of 90 degree turns to -make. Turns are always clock-wise. If the drone is facing north, then -drone.turn() will make the turn face east. If the drone is facing east -then drone.turn(2) will make the drone turn twice so that it is facing -west. - -### Drone Positional Info - - * getLocation() - Returns a native Java Location object for the drone - -### Drone Markers - -Markers are useful when your Drone has to do a lot of work. You can -set a check-point and return to the check-point using the move() -method. If your drone is about to undertake a lot of work - -e.g. building a road, skyscraper or forest you should set a -check-point before doing so if you want your drone to return to its -current location. - -A 'start' checkpoint is automatically created when the Drone is first created. - -Markers are created and returned to using the followng two methods... - - * chkpt - Saves the drone's current location so it can be returned to later. - * move - moves the drone to a saved location. Alternatively you can provide a Java Location object or x,y,z and direction parameters. - -#### Parameters - - * name - the name of the checkpoint to save or return to. - -#### Example - - drone.chkpt('town-square'); - // - // the drone can now go off on a long excursion - // - for ( i = 0; i< 100; i++) { - drone.fwd(12).box(6); - } - // - // return to the point before the excursion - // - drone.move('town-square'); - -### Drone.prism() method - -Creates a prism. This is useful for roofs on houses. - -#### Parameters - - * block - the block id - e.g. 6 for an oak sapling or '6:2' for a birch sapling. - Alternatively you can use any one of the `blocks` values e.g. `blocks.sapling.birch` - * width - the width of the prism - * length - the length of the prism (will be 2 time its height) - -#### Example - - prism(blocks.oak,3,12); - -![prism example](img/prismex1.png) - -### Drone.prism0() method - -A variation on `prism` which hollows out the inside of the prism. It -uses the same parameters as `prism`. - -### Drone.rand() method - -rand takes either an array (if each blockid has the same chance of occurring) or an object where each property is a blockid and the value is it's weight (an integer) - -#### Example - -place random blocks stone, mossy stone and cracked stone (each block has the same chance of being picked) - - rand( [blocks.brick.stone, blocks.brick.mossy, blocks.brick.cracked ],w,d,h) - -to place random blocks stone has a 50% chance of being picked, - - var distribution = {}; - distribution[ blocks.brick.stone ] = 5; - distribution[ blocks.brick.mossy ] = 3; - distribution[ blocks.brick.cracked ] = 2; - - rand( distribution, width, height, depth) - -regular stone has a 50% chance, mossy stone has a 30% chance and cracked stone has just a 20% chance of being picked. - -### Drone.wallsign() method - -Creates a wall sign (A sign attached to a wall) - -#### Parameters - - * message - can be a string or an array of strings - -#### Example - - drone.wallsign(['Welcome','to','Scriptopia']); - -![wall sign](img/signex2.png) - -### Drone.signpost() method - -Creates a free-standing signpost - -#### Parameters - - * message - can be a string or an array of strings - -#### Example - - drone.signpost(['Hello','World']); - -![ground sign](img/signex1.png) - -### Drone.sign() method - -Deprecated: Use signpost() or wallsign() methods instead. - -Signs must use block 63 (stand-alone signs) or 68 (signs on walls) - -#### Parameters - - * message - can be a string or an array of strings. - * block - can be 63 or 68 - -#### Example - -To create a free-standing sign... - - drone.sign(["Hello","World"], blocks.sign_post); - -![ground sign](img/signex1.png) - -... to create a wall mounted sign... - - drone.sign(["Welcome","to","Scriptopia"], blocks.sign ); - -![wall sign](img/signex2.png) - -### Drone.sphere() method - -Creates a sphere. - -#### Parameters - - * block - The block the sphere will be made of. - * radius - The radius of the sphere. - -#### Example - -To create a sphere of Iron with a radius of 10 blocks... - - sphere( blocks.iron, 10); - -![sphere example](img/sphereex1.png) - -Spheres are time-consuming to make. You *can* make large spheres (250 radius) but expect the -server to be very busy for a couple of minutes while doing so. - -### Drone.sphere0() method - -Creates an empty sphere. - -#### Parameters - - * block - The block the sphere will be made of. - * radius - The radius of the sphere. - -#### Example - -To create a sphere of Iron with a radius of 10 blocks... - - sphere0( blocks.iron, 10); - -Spheres are time-consuming to make. You *can* make large spheres (250 radius) but expect the -server to be very busy for a couple of minutes while doing so. - -### Drone.hemisphere() method - -Creates a hemisphere. Hemispheres can be either north or south. - -#### Parameters - - * block - the block the hemisphere will be made of. - * radius - the radius of the hemisphere - * northSouth - whether the hemisphere is 'north' or 'south' - -#### Example - -To create a wood 'north' hemisphere with a radius of 7 blocks... - - hemisphere(blocks.oak, 7, 'north'); - -![hemisphere example](img/hemisphereex1.png) - -### Drone.hemisphere0() method - -Creates a hollow hemisphere. Hemispheres can be either north or south. - -#### Parameters - - * block - the block the hemisphere will be made of. - * radius - the radius of the hemisphere - * northSouth - whether the hemisphere is 'north' or 'south' - -#### Example - -To create a glass 'north' hemisphere with a radius of 20 blocks... - - hemisphere0(blocks.glass, 20, 'north'); - -![hemisphere example](img/hemisphereex2.png) - -### Drone.stairs() function - -The stairs() function will build a flight of stairs - -#### Parameters - - * blockType - should be one of the following: - - * blocks.stairs.oak - * blocks.stairs.cobblestone - * blocks.stairs.brick - * blocks.stairs.stone - * blocks.stairs.nether - * blocks.stairs.sandstone - * blocks.stairs.spruce - * blocks.stairs.birch - * blocks.stairs.jungle - * blocks.stairs.quartz - - * width - The width of the staircase - default is 1 - * height - The height of the staircase - default is 1 - -#### Example - -To build an oak staircase 3 blocks wide and 5 blocks tall: - - /js stairs(blocks.stairs.oak, 3, 5) - -Staircases do not have any blocks beneath them. - -### Drone Trees methods - - * oak() - * spruce() - * birch() - * jungle() - -#### Example - -To create 4 trees in a row, point the cross-hairs at the ground then type `/js ` and ... - - up( ).oak( ).right(8 ).spruce( ).right(8 ).birch( ).right(8 ).jungle( ); - -Trees won't always generate unless the conditions are right. You -should use the tree methods when the drone is directly above the -ground. Trees will usually grow if the drone's current location is -occupied by Air and is directly above an area of grass (That is why -the `up()` method is called first). - -![tree example](img/treeex1.png) - -None of the tree methods require parameters. Tree methods will only be -successful if the tree is placed on grass in a setting where trees can -grow. - -### Drone.castle() method - -Creates a Castle. A castle is just a big wide fort with 4 taller forts at each corner. -See also Drone.fort() method. - -#### Parameters - - * side - How many blocks wide and long the castle will be (default: 24. Must be greater than 19) - * height - How tall the castle will be (default: 10. Must be geater than 7) - -#### Example - -At the in-game prompt you can create a castle by looking at a block and typing: - -```javascript -/js castle() -``` - -Alternatively you can create a new Drone object from a Player or Location object and call the castle() method. - -```javascript -var d = new Drone(player); -d.castle(); -``` -![castle example](img/castleex1.png) - -### Drone.chessboard() method - -Creates a tile pattern of given block types and size - -#### Parameters - - * whiteBlock - (optional: default blocks.wool.white) - * blackBlock - (optional: default blocks.wool.black) - * width - width of the chessboard - * length - length of the chessboard - -#### Example - -At the in-game prompt you can create a chessboard by looking at a block and typing: - -```javascript -/js chessboard() -``` - -Alternatively you can create a new Drone object from a Player or Location object and call the chessboard() method. - -```javascript -var d = new Drone(player); -d.chessboard(); -``` -![chessboard example](img/chessboardex1.png) - -### Drone.cottage() method - -Creates a simple but cosy dwelling. - -#### Example - -At the in-game prompt you can create a cottage by looking at a block and typing: - -```javascript -/js cottage() -``` - -Alternatively you can create a new Drone object from a Player or Location object and call the cottage() method. - -```javascript -var d = new Drone(player); -d.cottage(); -``` -![cottage example](img/cottageex1.png) - -### Drone.cottage_road() method - -Creates a tree-lined avenue with cottages on both sides. - -#### Parameters - - * numberOfCottages: The number of cottages to build in total (optional: default 6) - -#### Example - -At the in-game prompt you can create a cottage road by looking at a block and typing: - -```javascript -/js cottage_road() -``` - -Alternatively you can create a new Drone object from a Player or Location object and call the cottage_road() method. - -```javascript -var d = new Drone(player); -d.cottage_road(); -``` -![cottage_road example](img/cottageroadex1.png) - -### Drone.dancefloor() method -Create an animated dance floor of colored tiles some of which emit light. -The tiles change color every second creating a strobe-lit dance-floor effect. -See it in action here [http://www.youtube.com/watch?v=UEooBt6NTFo][ytdance] - -#### Parameters - - * width - how wide the dancefloor should be (optional: default 5) - * length - how long the dancefloor should be (optional: default 5) - * duration - the time duration for which the lights should change (optional: default 30 seconds) - -#### Example - -At the in-game prompt you can create a dancefloor by looking at a block and typing: - -```javascript -/js dancefloor() -``` - -Alternatively you can create a new Drone object from a Player or Location object and call the dancefloor() method. - -```javascript -var d = new Drone(player); -d.dancefloor(); -``` - -[ytdance]: http://www.youtube.com/watch?v=UEooBt6NTFo -![dancefloor example](img/dancefloorex1.png) -### Drone.fort() method - -Constructs a medieval fort. - -#### Parameters - - * side - How many blocks whide and long the fort will be (default: 18 . Must be greater than 9) - * height - How tall the fort will be (default: 6 . Must be greater than 3) - -#### Example - -At the in-game prompt you can create a fort by looking at a block and typing: - -```javascript -/js fort() -``` - -Alternatively you can create a new Drone object from a Player or Location object and call the fort() method. - -```javascript -var d = new Drone(player); -d.fort(); -``` -![fort example](img/fortex1.png) - -### Drone.hangtorch() method - -Adds a hanging torch to a wall. This method will try to hang a torch -against a wall. It will traverse backwards until it finds a block -adjacent to air and hang the torch. If it can't find a block next to -air it will log a message in the server. - -#### Example - -At the in-game prompt you can create a hanging torch by looking at a -block and typing: - -```javascript -/js hangtorch() -``` - -Alternatively you can create a new Drone object from a Player or -Location object and call the hangtorch() method. - -```javascript -var d = new Drone(player); -d.hangtorch(); -``` - -### Drone.lcdclock() method. - -Constructs a large LCD Clock. The clock will display the current time of day. -The clock can be stopped by calling the stopLCD() method of the Drone which created the clock. - -#### Parameters - - * foregroundBlock (Optional - default is blocks.glowstone) - * backgroundBlock (Optional - default is blocks.wool.black) - * borderBlock (Optional - a border around the LCD display - default none) - -#### Example - -At the in-game prompt you can create a LCD clock by looking at a block and typing: - -```javascript -/js var clock = lcdclock() -/js clock.stopLCD() -``` - -Alternatively you can create a new Drone object from a Player or Location object and call the lcdclock() method. - -```javascript -var d = new Drone(player); -d.lcdclock(); -d.stopLCD(); -``` -![lcdclock example](img/lcdclockex1.png) -### Drone.logojs() method - -Constructs a large Javascript Logo (black JS on Yellow background) -See: https://raw.github.com/voodootikigod/logo.js/master/js.png - -#### Parameters - - * foregroundBlock (Optional - default is blocks.wool.gray) - * backgroundBlock (Optional - default is blocks.gold) - -### Drone.maze() method - -Maze generation based on http://rosettacode.org/wiki/Maze_generation#JavaScript - -#### Parameters - - * width (optional - default 10) - * length (optional - default 10) - -#### Example - -At the in-game prompt you can create a maze by looking at a block and typing: - -```javascript -/js maze() -``` - -Alternatively you can create a new Drone object from a Player or Location object and call the maze() method. - -```javascript -var d = new Drone(player); -d.maze(); -``` -![maze example](img/mazeex1.png) - -### Drone.rainbow() method - -Creates a Rainbow. - -#### Parameters - - * radius (optional - default:18) - The radius of the rainbow - -#### Example - -At the in-game prompt you can create a rainbow by looking at a block and typing: -```javascript -/js rainbow() -``` - -Alternatively you can create a new Drone object from a Player or Location object and call the rainbow() method. - -```javascript -var d = new Drone(player); -d.rainbow(30); -``` - -![rainbow example](img/rainbowex1.png) - -### Drone.spiral_stairs() method - -Constructs a spiral staircase with slabs at each corner. - -#### Parameters - - * stairBlock - The block to use for stairs, should be one of the following... - - 'oak' - - 'spruce' - - 'birch' - - 'jungle' - - 'cobblestone' - - 'brick' - - 'stone' - - 'nether' - - 'sandstone' - - 'quartz' - * flights - The number of flights of stairs to build. - -![Spiral Staircase](img/spiralstair1.png) - -#### Example - -To construct a spiral staircase 5 floors high made of oak... - - spiral_stairs('oak', 5); - -### Drone.temple() method - -Constructs a mayan temple. - -#### Parameters - - * side - How many blocks wide and long the temple will be (default: 20) - -#### Example - -At the in-game prompt you can create a temple by looking at a block and typing: - -```javascript -/js temple() -``` - -Alternatively you can create a new Drone object from a Player or Location object and call the temple() method. - -```javascript -var d = new Drone(player); -d.temple(); -``` -![temple example](img/templeex1.png) - -## The at Module - -The at module provides a single function `at()` which can be used to schedule -repeating (or non-repeating) tasks to be done at a particular time. - -### at() function - -The utils.at() function will perform a given task at a given time in the -(minecraft) day. - -#### Parameters - -* time24hr : The time in 24hr form - e.g. 9:30 in the morning is '09:30' while 9:30 pm is '21:30', midnight is '00:00' and midday is '12:00' -* callback : A javascript function which will be invoked at the given time. -* worlds : (optional) An array of worlds. Each world has its own clock. If no array of worlds is specified, all the server's worlds are used. -* repeat : (optional) true or false, default is true (repeat the task every day) - -#### Example - -To warn players when night is approaching: - -```javascript -var utils = require('utils'), - at = require('at'); -function warning(){ - utils.players(function( player ) { - echo( player, 'The night is dark and full of terrors!' ); - }); -} -at('19:00', warning); -``` -To run a task only once at the next given time: -```javascript -var utils = require('utils'), - at = require('at'); -function wakeup(){ - utils.players(function( player ) { - echo( player, "Wake Up Folks!" ); - }); -} -at('06:00', wakeup, null, false); -``` - -## Blocks Module -You hate having to lookup [Data Values][dv] when you use ScriptCraft's -Drone() functions. So do I. So I created this blocks object which is -a helper object for use in construction. -### Examples - box( blocks.oak ); // creates a single oak wood block - box( blocks.sand, 3, 2, 1 ); // creates a block of sand 3 wide x 2 high x 1 long - box( blocks.wool.green, 2 ); // creates a block of green wool 2 blocks wide -Color aliased properties that were a direct descendant of the blocks -object are no longer used to avoid confusion with carpet and stained -clay blocks. In addition, there's a convenience array `blocks.rainbow` -which is an array of the 7 colors of the rainbow (or closest -approximations). -The blocks module is globally exported by the Drone module. -## Fireworks Module - -The fireworks module makes it easy to create fireworks using -ScriptCraft. The module has a single function `firework` which takes -a `org.bukkit.Location` as its 1 and only parameter. - -### Examples - -The module also extends the `Drone` object adding a `firework` method -so that fireworks can be created as a part of a Drone chain. For -Example.... - - /js firework() - -... creates a single firework, while .... - - /js firework().fwd(3).times(5) - -... creates 5 fireworks in a row. Fireworks have also been added as a -possible option for the `arrow` module. To have a firework launch -where an arrow strikes... - - /js arrows.firework() - -To call the fireworks.firework() function directly, you must provide a -location. For example... - - /js var fireworks = require('fireworks'); - /js fireworks.firework( self.location ); - -![firework example](img/firework.png) - -## Classroom Plugin - -The `classroom` object contains a couple of utility functions for use -in a classroom setting. The goal of these functions is to make it -easier for tutors to facilitate ScriptCraft for use by students in a -classroom environment. Although granting ScriptCraft access to -students on a shared server is potentially risky (Students can -potentially abuse it), it is slighlty less risky than granting -operator privileges to each student. (Enterprising students will -quickly realise how to grant themselves and others operator privileges -once they have access to ScriptCraft). - -The goal of this module is not so much to enforce restrictions -(security or otherwise) but to make it easier for tutors to setup a -shared server so students can learn Javascript. When scripting is -turned on, every player who joins the server will have a dedicated -directory into which they can save scripts. All scripts in such -directories are automatically watched and loaded into a global -variable named after the player. - -So for example, if player 'walterh' joins the server, a `walterh` -global variable is created. If a file `greet.js` with the following -content is dropped into the `scriptcraft/players/walterh` -directory... - -```javascript -exports.hi = function( player ){ - echo( player, 'Hi ' + player.name); -}; -``` - -... then it can be invoked like this: `/js walterh.hi( self )` . This -lets every player/student create their own functions without having -naming collisions. - -It's strongly recommended that the -`scriptcraft/players/` directory is shared so that -others can connect to it and drop .js files into their student -directories. On Ubuntu, select the folder in Nautilus (the default -file browser) then right-click and choose *Sharing Options*, check the -*Share this folder* checkbox and the *Allow others to create and -delete files* and *Guest access* checkboxes. Click *Create Share* -button to close the sharing options dialog. Students can then access -the shared folder as follows... - -* Windows: Open Explorer, Go to \\{serverAddress}\players\ -* Macintosh: Open Finder, Go to smb://{serverAddress}/players/ -* Linux: Open Nautilus, Go to smb://{serverAddress}/players/ - -... where {serverAddress} is the ip address of the server (this is -displayed to whoever invokes the classroom.allowScripting() function.) - -### jsp classroom command -The `jsp classroom` command makes it easy for tutors to turn on or off -classroom mode. This command can only be used by server operators. To -turn on classroom mode (enable scripting for all players): - - jsp classroom on - -To turn off classroom mode (disable scripting for all players): - - jsp classroom off - -The `jsp classroom` command is provided as an easier way to turn on or -off classroom mode. This should be used in preference to the -classroom.allowScripting() function which is provided only for -programmatically enabling or disabling classroom mode. - -### classroom.allowScripting() function - -Allow or disallow anyone who connects to the server (or is already -connected) to use ScriptCraft. This function is preferable to granting 'ops' privileges -to every student in a Minecraft classroom environment. - -Whenever any file is added/edited or removed from any of the players/ -directories the contents are automatically reloaded. This is to -facilitate quick turnaround time for students getting to grips with -Javascript. - -#### Parameters - -* canScript : true or false - -#### Example - -To allow all players (and any players who connect to the server) to -use the `js` and `jsp` commands... - - /js classroom.allowScripting( true, self ) - -To disallow scripting (and prevent players who join the server from using the commands)... - - /js classroom.allowScripting( false, self ) - -Only ops users can run the classroom.allowScripting() function - this is so that students -don't try to bar themselves and each other from scripting. - -## Inventory Module -This module provides functions to add items to, remove items from and check the -contents of a player or NPC's inventory. - -### Usage -The inventory module is best used in conjunction with the items module. See below for examples of usage. - -```javascript -var inventory = require('inventory'); -var items = require('items'); -var utils = require('utils'); - -// gives every player 2 cookies and a baked potatoe -var bakedPotato = items.bakedPotato(1); -var cookies2 = items.cookie(2); - -utils.players(function( player ){ - inventory( player ) - .add( cookies2 ) - .add( bakedPotato ) -}); - -// give a player 6 cookies then take away 4 of them - -inventory( player ) - .add( items.cookie(6) ) - .remove ( items.cookie(4) ) - -// check if a player has any cookies - -var hasCookies = inventory(player).contains( items.cookie(1) ); - -// Enchant an item and give it to the player (CraftBukkit/Spigot only) - -var luck = org.bukkit.enchantments.Enchantment.getByName("LUCK"); -var luckyRod = items.fishingRod( 1 ); -luckyRod.addEnchantment( luck, 3); -inventory( player ).add( luckyRod ); - -``` -The inventory module exposes a single function which when passed a player or NPC will return an object with 3 methods: - -* add : Adds items to the inventory (Expects parameters of type `net.canarymod.api.inventory.Item` - I strongly recommend using the `items` module for constructing items) -* remove : removes items from the inventory (Expects parameters of type `net.canarymod.api.inventory.Item` - I strongly recommend using the `items` module for constructing items) -* contains : checks to see if there is the specified type and amount of item in the inventory (Expects parameters of type `net.canarymod.api.inventory.Item` - I strongly recommend using the `items` module for constructing items) - -## Asynchronous Input Module - -The `input` module provides a simple way to prompt players for input at the -in-game prompt. In Javascript browser environments the `prompt()` function provides -a way to block execution and ask the user for input. Execution is blocked until the user -provides input using the modal dialog and clicks OK. Unfortunately Minecraft provides no -equivalent modal dialog which can be used to gather player text input. The only way to gather text -input from the player in Minecraft is to do so asynchronously. That is - a prompt message can be -sent to the player but the player is not obliged to provide input immediately, nor does the program -execution block until the player does so. - -So ScriptCraft has no `prompt()` implementation because `prompt()` is a synchronous function and -Minecraft's API provides no equivalent functions or classes which can be used to implement this synchronously. -The Minecraft API does however have a 'Conversation' API which allows for prompting of the player and asynchronously gathering text input from the player. - -This new `input()` function is best illustrated by example. The following code is for a number-guessing game: - -```javascript -var input = require('input'); -exports.numberguess = function(player){ - var randomNumber = Math.ceil(Math.random() * 10); - input( player, 'Think of a number between 1 and 10 (q to quit)', function( guess, guesser, repeat ) { - if ( guess == 'q'){ - return; - } - if ( +guess !== randomNumber ) { - if (+guess < randomNumber ) { - echo( guesser, 'Too low - guess again'); - } - if (+guess > randomNumber ) { - echo( guesser, 'Too high - guess again'); - } - repeat(); - } else { - echo( guesser, 'You guessed correctly'); - } - }); -}; -``` - -The `input()` function takes 3 parameters, the player, a prompt message and a callback which will be invoked when the player has entered some text at the in-game command prompt. -The callback is bound to an object which has the following properties: - - * sender : The player who input the text - * value : The value of the text which has been input. - * message: The message prompt. - * repeat: A function which when invoked will repeat the original prompt. (this is for flow control) - -The callback function as well as being bound to an object with the above properties (so you can use this.value inside your callback to get the value which has just been input), can also take the following parameters (in exact order): - - * value - * sender - * repeat - -The `value` parameter will be the same as `this.value`, the `repeat` parameter will be the same as `this.repeat` and so on. - -## Lightning module - -Causes a bolt of lightning to strike. - -### Usage -```javascript -// strike lightning wherever a player's arrow lands -var lightning = require('lightning'); -events.projectileHit( function( event ){ - if ( entities.arrow( event.projectile ) // it's an arrow - && entities.player( event.projectile.owner ) // it was shot by a player - ) { - lightning( event.projectile ); // strike lightning at the arrow location - } -}); -``` - -## The recipes module - -The Recipes module provides convenience functions for adding and removing recipes -from the game. - -### Example -To add an EnderBow to the game (assumes there's an enchanted Item variable called enderBow)... - - var recipes = require('recipes'); - var items = require('items'); - ... - var enderBowRecipe = recipes.create( { - result: enderBow, - ingredients: { - E: items.enderPearl(1), - S: items.stick(1), - W: items.string(1) - }, - shape: [ 'ESW', - 'SEW', - 'ESW' ] - } ); - // add to server - var addedRecipe = server.addRecipe( enderBowRecipe ); - // to remove... - server.removeRemove( addedRecipe ); - -## Http Module - -For handling http requests. Not to be confused with the more robust -and functional 'http' module bundled with Node.js. - -### http.request() function - -The http.request() function will fetch a web address asynchronously (on a -separate thread)and pass the URL's response to a callback function -which will be executed synchronously (on the main thread). In this -way, http.request() can be used to fetch web content without blocking the -main thread of execution. - -#### Parameters - - * request: The request details either a plain URL e.g. "https://scriptcraft.js/sample.json" or an object with the following properties... - - - url: The URL of the request. - - method: Should be one of the standard HTTP methods, GET, POST, PUT, DELETE (defaults to GET). - - params: A Javascript object with name-value pairs. This is for supplying parameters to the server. - - * callback: The function to be called when the Web request has completed. This function takes the following parameters... - - responseCode: The numeric response code from the server. If the server did not respond with 200 OK then the response parameter will be undefined. - - response: A string (if the response is of type text) or object containing the HTTP response body. - -#### Example - -The following example illustrates how to use http.request to make a request to a JSON web service and evaluate its response... - -```javascript -var jsResponse; -var http = require('http'); -http.request('https://scriptcraftjs.org/sample.json',function(responseCode, responseBody){ - jsResponse = JSON.parse( responseBody ); -}); -``` -The following example illustrates a more complex use-case POSTing parameters to a CGI process on a server... - -```javascript -var http = require('http'); -http.request( { - url: 'http://pixenate.com/pixenate/pxn8.pl', - method: 'POST', - params: {script: '[]'} - }, - function( responseCode, responseBody ) { - var jsObj = JSON.parse( responseBody ); - }); -``` - -## sc-mqtt module - -This module provides a simple way to communicate with devices (such as Arduino) -using the popular lightweight [MQTT protocol][mqtt]. - -### Usage - -This module can only be used if the separate `sc-mqtt.jar` file is -present in the CraftBukkit classpath. To use this module, you should -... - - 1. Download sc-mqtt.jar from - 2. Save the file to the same directory where craftbukkit.jar resides. - 3. Create a new batch file (windows-only) called - craftbukkit-sc-mqtt.bat and edit it to include the following - command... - - ```sh - java -classpath sc-mqtt.jar;craftbukkit.jar org.bukkit.craftbukkit.Main - ``` - - If you're using Mac OS, create a new craftbukkit-sc-mqtt.command - file and edit it (using TextWrangler or another text editor) ... - - ```sh - java -classpath sc-mqtt.jar:craftbukkit.jar org.bukkit.craftbukkit.Main - ``` - - 4. Execute the craftbukkit-sc-mqtt batch file / command file to start - Craftbukkit. You can now begin using this module to send and receive - messages to/from a Net-enabled Arduino or any other device which uses - the [MQTT protocol][mqtt] - - ```javascript - var mqtt = require('sc-mqtt'); - // create a new client - var client = mqtt.client( 'tcp://localhost:1883', 'uniqueClientId' ); - // connect to the broker - client.connect( { keepAliveInterval: 15 } ); - // publish a message to the broker - client.publish( 'minecraft', 'loaded' ); - // subscribe to messages on 'arduino' topic - client.subscribe( 'arduino' ); - // do something when an incoming message arrives... - client.onMessageArrived( function( topic, message ) { - console.log( 'Message arrived: topic=' + topic + ', message=' + message ); - }); - - ``` - -The `sc-mqtt` module provides a very simple minimal wrapper around the -[Eclipse Paho MQTT Version 3 Client][pahodocs] java-based MQTT -library. - -[pahodocs]: http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/index.jsp?topic=/com.ibm.mq.javadoc.doc/WMQMQxrClasses/org/eclipse/paho/client/mqttv3/package-summary.html -[mqtt]: http://mqtt.org/ - -## Signs Module - -The Signs Module can be used by plugin authors to create interactive -signs - that is - signs which display a list of choices which can be -changed by interacting (right-clicking) with the sign. - -### signs.menu() function - -This function is used to construct a new interactive menu on top of an -existing sign in the game world. - -#### Parameters - - * Label : A string which will be displayed in the topmost line of the - sign. This label is not interactive. - * options : An array of strings which can be selected on the sign by - right-clicking/interacting. - * callback : A function which will be called whenever a player - interacts (changes selection) on a sign. This callback in turn - takes as its parameter, an object with the following properties... - - * player : The player who interacted with the sign. - * sign : The [org.bukkit.block.Sign][buksign] which the player interacted with. - * text : The text for the currently selected option on the sign. - * number : The index of the currently selected option on the sign. - - * selectedIndex : optional: A number (starting at 0) indicating which - of the options should be selected by default. 0 is the default. - -#### Returns -This function does not itself do much. It does however return a -function which when invoked with a given -[org.bukkit.block.Sign][buksign] object, will convert that sign into -an interactive sign. - -#### Example: Create a sign which changes the time of day. - -##### plugins/signs/time-of-day.js - -```javascript -var utils = require('utils'), - signs = require('signs'); - -var onTimeChoice = function(event){ - var selectedIndex = event.number; - // convert to Minecraft time 0 = Dawn, 6000 = midday, 12000 = dusk, 18000 = midnight - var time = selectedIndex * 6000; - event.player.location.world.setTime(time); -}; - -// signs.menu returns a function which can be called for one or more signs in the game. -var convertToTimeMenu = signs.menu('Time of Day', - ['Dawn', 'Midday', 'Dusk', 'Midnight'], - onTimeChoice); - -exports.time_sign = function( player ){ - var sign = signs.getTargetedBy(player); - if ( !sign ) { - throw new Error('You must look at a sign'); - } - convertToTimeMenu(sign); -}; -``` - -To use the above function at the in-game prompt, look at an existing -sign and type... - - /js time_sign(self); - -... and the sign you're looking at will become an interactive sign -which changes the time each time you interact (right-click) with it. - -### signs.getTargetedBy() function - -This function takes a [org.bukkit.entity.LivingEntity][bukle] as a -parameter and returns a [org.bukkit.block.Sign][buksign] object which -the entity has targeted. It is a utility function for use by plugin authors. - -#### Example - -```javascript -var signs = require('signs'), - utils = require('utils'); -var player = utils.player('tom1234'); -var sign = signs.getTargetedBy( player ); -if ( !sign ) { - echo( player, 'Not looking at a sign'); -} -``` - -[buksign]: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/block/Sign.html -[bukle]: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/LivingEntity.html - -## The slash Module - -This module provides a single function which makes it easy to execute -minecraft commands via javascript. - -### The slash() function - -This function makes it easy to execute one or more minecraft commands. - -#### Parameters - - * commands : A String or Array of strings - each string is a command to be executed. - * sender: (optional) The player on whose behalf the commands should be executed. If not specified the commands will be executed as the server console user. - -#### Examples - -Invoke the `/defaultgamemode creative` command (as server). - -```javascript -var slash = require('slash'); -slash('defaultgamemode creative'); -``` - -Set the time of day to Midday and toggle downfall (as player 'JohnDoe'): - -```javascript -var slash = require('slash'), - utils = require('utils'); -var johnDoe = utils.player('John_Doe'); - -slash([ - 'time set 6000', - 'toggledownfall' -], johnDoe); -``` - -## Spawn Module - -Provides a single function to 'spawn' an entity at a given location. - -### Parameters - - * entityType - The type of entity to spawn. This can be a string (see entities module for reference) or a framework-specific object type (see https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/EntityType.html). A list of [all possible entities][ents] functions (equivalent to the EntityType enum). - - * location - where the entity should be spawned. - -[ents]: #entities-module - -### Example - -Using the entities module as a helper, spawn a new polar bear at the world's default spawn location: - -```javascript -var entities = require('entities'), - spawn = require('spawn'); -... -var spawnLocation = world.spawnLocation; -spawn(entities.polar_bear(), spawnLocation); -``` - -This module is in turn used by the Drone's `spawn()` method and the `jsp spawn` command. -String class extensions ------------------------ -The following chat-formatting methods are added to the javascript String class.. - - * aqua() - * black() - * blue() - * bold() - * brightgreen() - * darkaqua() - * darkblue() - * darkgray() - * darkgreen() - * purple() - * darkpurple() - * darkred() - * gold() - * gray() - * green() - * italic() - * lightpurple() - * indigo() - * green() - * red() - * pink() - * yellow() - * white() - * strike() - * random() - * magic() - * underline() - * reset() - -Example -------- - - /js var boldGoldText = "Hello World".bold().gold(); - /js echo(self, boldGoldText ); - -

Hello World

- -## Teleport Module - -This module provides a function to teleport entities (Players or NPCs). - -### Parameters - - * entity - The player or NPC to be teleported. If of type String, then a player with that name will be teleported. - * destination - The location to which they should be teleported. If not of type Location but is a Player, Block or any - object which has a `location` property then that works too. If of type String, then it's assumed that the destination is the player with that name. - -### Example - -The following code will teleport each player back to their spawn position. - -```javascript -var teleport = require('teleport'), - utils = require('utils'), - players = utils.players(), - i = 0; -for ( ; i < players.length; i++ ) { - teleport( players[i], players[i].spawnPosition ); -} -``` - -The following code will teleport 'tom' to 'jane's location. - -```javascript -var teleport = require('teleport'); -teleport('tom' , 'jane'); -``` -## Utilities Module - -The `utils` module is a storehouse for various useful utility -functions which can be used by plugin and module authors. It contains -miscellaneous utility functions and classes to help with programming. - -### utils.player() function - -The utils.player() function will return a [Player][cmpl] object -with the given name. This function takes a single parameter -`playerName` which can be either a String or a [Player][cmpl] object - -if it's a Player object, then the same object is returned. If it's a -String, then it tries to find the player with that name. - -#### Parameters - - * playerName : A String or Player object. If no parameter is provided - then player() will try to return the `self` variable . It is - strongly recommended to provide a parameter. - -#### Example - -```javascript -var utils = require('utils'); -var name = 'walterh'; -var player = utils.player(name); -if ( player ) { - echo(player, 'Got ' + name); -} else { - console.log('No player named ' + name); -} -``` - -[bkpl]: http://jd.bukkit.org/dev/apidocs/org/bukkit/entity/Player.html -[cmpl]: https://ci.visualillusionsent.net/job/CanaryLib/javadoc/net/canarymod/api/entity/living/humanoid/Player.html -[cmloc]: https://ci.visualillusionsent.net/job/CanaryLib/javadoc/net/canarymod/api/world/position/Location.html -[bkloc]: http://jd.bukkit.org/dev/apidocs/org/bukkit/Location.html - -### utils.world( worldName ) function - -Returns a World object matching the given name - -### utils.blockAt( Location ) function - -Returns the Block at the given location. - -### utils.locationToJSON() function - -utils.locationToJSON() returns a [Location][cmloc] object in JSON form... - - { world: 'world5', - x: 56.9324, - y: 103.9954, - z: 43.1323, - yaw: 0.0, - pitch: 0.0 - } - -This can be useful if you write a plugin that needs to store location data since bukkit's Location object is a Java object which cannot be serialized to JSON by default. - -#### Parameters - - * location: An object of type [Location][cmloc] - -#### Returns - -A JSON object in the above form. - -### utils.locationToString() function - -The utils.locationToString() function returns a -[Location][cmloc] object in string form... - - '{"world":"world5",x:56.9324,y:103.9954,z:43.1323,yaw:0.0,pitch:0.0}' - -... which can be useful if you write a plugin which uses Locations as -keys in a lookup table. - -#### Example - -```javascript -var utils = require('utils'); -... -var key = utils.locationToString(player.location); -lookupTable[key] = player.name; -``` - -### utils.locationFromJSON() function - -This function reconstructs an [Location][cmloc] object from -a JSON representation. This is the counterpart to the -`locationToJSON()` function. It takes a JSON object of the form -returned by locationToJSON() and reconstructs and returns a bukkit -Location object. - -### utils.getPlayerPos() function - -This function returns the player's [Location][cmloc] (x, y, z, pitch -and yaw) for a named player. If the "player" is in fact a -[BlockCommand][bkbcs] then the attached Block's location is returned. - -#### Parameters - - * player : A [org.bukkit.command.CommandSender][bkbcs] (Player or BlockCommandSender) or player name (String). - -#### Returns - -A [Location][cmloc] object. - -[bkbcs]: http://jd.bukkit.org/dev/apidocs/org/bukkit/command/BlockCommandSender.html -[bksndr]: http://jd.bukkit.org/dev/apidocs/index.html?org/bukkit/command/CommandSender.html -### utils.getMousePos() function - -This function returns a [Location][cmloc] object (the -x,y,z) of the current block being targeted by the named player. This -is the location of the block the player is looking at (targeting). - -#### Parameters - - * player : The player whose targeted location you wish to get. - -#### Example - -The following code will strike lightning at the location the player is looking at... - -```javascript -var utils = require('utils'); -var playerName = 'walterh'; -var targetPos = utils.getMousePos(playerName); -if (targetPos){ - if (__plugin.canary){ - targetPos.world.makeLightningBolt(targetPos); - } - if (__plugin.bukkit){ - targetPos.world.strikeLightning(targetPos); - } -} -``` - -### utils.foreach() function - -The utils.foreach() function is a utility function for iterating over -an array of objects (or a java.util.Collection of objects) and -processing each object in turn. Where utils.foreach() differs from -other similar functions found in javascript libraries, is that -utils.foreach can process the array immediately or can process it -*nicely* by processing one item at a time then delaying processing of -the next item for a given number of server ticks (there are 20 ticks -per second on the minecraft main thread). This method relies on -Bukkit's [org.bukkit.scheduler][sched] package for scheduling -processing of arrays. - -[sched]: http://jd.bukkit.org/beta/apidocs/org/bukkit/scheduler/package-summary.html - -#### Parameters - - * array : The array to be processed - It can be a javascript array, a java array or java.util.Collection - * callback : The function to be called to process each item in the - array. The callback function should have the following signature - `callback(item, index, object, array)`. That is the callback will - be called with the following parameters.... - - - item : The item in the array - - index : The index at which the item can be found in the array. - - object : Additional (optional) information passed into the foreach method. - - array : The entire array. - - * context (optional) : An object which may be used by the callback. - * delayInMilliseconds (optional, numeric) : If a delay is specified then the processing will be scheduled so that - each item will be processed in turn with a delay between the completion of each - item and the start of the next. This is recommended for any CPU-intensive process. - * onDone (optional, function) : A function to be executed when all processing - is complete. This parameter is only used when the processing is delayed. (It's optional even if a - delay parameter is supplied). - -If called with a delay parameter then foreach() will return -immediately after processing just the first item in the array (all -subsequent items are processed later). If your code relies on the -completion of the array processing, then provide an `onDone` parameter -and put the code there. - -#### Example - -The following example illustrates how to use foreach for immediate processing of an array... - -```javascript -var utils = require('utils'); -var players = utils.players(); -utils.foreach (players, function( player ) { - echo( player , 'Hi ' + player); -}); -``` - -... The `utils.foreach()` function can work with Arrays or any -Java-style collection. This is important because many objects in the -CanaryMod and Bukkit APIs use Java-style collections. -### utils.nicely() function - -The utils.nicely() function is for performing background processing. utils.nicely() lets you -process with a specified delay between the completion of each `next()` -function and the start of the next `next()` function. -`utils.nicely()` is a recursive function - that is - it calls itself -(schedules itself actually) repeatedly until `hasNext` returns false. - -#### Parameters - - * next : A function which will be called if processing is to be done. - * hasNext : A function which is called to determine if the `next` - callback should be invoked. This should return a boolean value - - true if the `next` function should be called (processing is not - complete), false otherwise. - * onDone : A function which is to be called when all processing is complete (hasNext returned false). - * delayInMilliseconds : The delay between each call. - -#### Example - -See the source code to utils.foreach for an example of how utils.nicely is used. - -### utils.time( world ) function - -Returns the timeofday (in minecraft ticks) for the given world. This function is necessary because -canarymod and bukkit differ in how the timeofday is calculated. - -See http://minecraft.gamepedia.com/Day-night_cycle#Conversions - -### utils.time24( world ) function - -Returns the timeofday for the given world using 24 hour notation. (number of minutes) - -See http://minecraft.gamepedia.com/Day-night_cycle#Conversions - -#### Parameters - - * world : the name of the world or world object for which you want to get time - -### utils.find() function - -The utils.find() function will return a list of all files starting at -a given directory and recursiving trawling all sub-directories. - -#### Parameters - - * dir : The starting path. Must be a string. - * filter : (optional) A [FilenameFilter][fnfltr] object to return only files matching a given pattern. - -[fnfltr]: http://docs.oracle.com/javase/6/docs/api/java/io/FilenameFilter.html - -#### Example - -```javascript -var utils = require('utils'); -var jsFiles = utils.find('./', function(dir,name){ - return name.match(/\.js$/); -}); -``` -### utils.serverAddress() function - -The utils.serverAddress() function returns the IP(v4) address of the server. - -```javascript -var utils = require('utils'); -var serverAddress = utils.serverAddress(); -console.log(serverAddress); -``` -### utils.array() function - -Converts Java collection objects to type Javascript array so they can avail of -all of Javascript's Array goodness. - -#### Example - - var utils = require('utils'); - var worlds = utils.array(server.worldManager.getAllWorlds()); - -### utils.players() function - -This function returns a javascript array of all online players on the -server. You can optionally provide a function which will be invoked -with each player as a parameter. For example, to give each player the -ability to shoot arrows which launch fireworks: - -```javascript -require('utils').players( arrows.firework ) -``` - -Any players with a bow will be able to launch fireworks by shooting. - -### utils.playerNames() function - -This function returns a javascript array of player names (as javascript strings) - -### utils.stat() function - -This function returns a numeric value for a given player statistic. - -#### Parameters - - * Player - The player object (optional - if only the statistic name parameter is provided then the statistic object is returned) - * Statistic - A string whose value should be one of the following (CanaryMod) - * ANIMALSBRED - * BOATONECM - * CLIMBONECM - * CROUCHONECM - * DAMAGEDEALT - * DAMAGETAKEN - * DEATHS - * DRIVEONECM - * DROP - * FALLONECM - * FISHCAUGHT - * FLYONECM - * HORSEONECM - * JUMP - * JUNKFISHED - * LEAVEGAME - * MINECARTONECM - * MOBKILLS - * PIGONECM - * PLAYERKILLS - * PLAYONEMINUTE - * SPRINTONECM - * SWIMONECM - * TALKEDTOVILLAGER - * TIMESINCEDEATH - * TRADEDWITHVILLAGER - * TREASUREFISHED - * WALKONECM - -See [CanaryMod's Statistic][cmstat] class for an up-to-date list of possible stat values - -[cmstat]: https://ci.visualillusionsent.net/job/CanaryLib/javadoc/net/canarymod/api/statistics/Statistics.html - -#### Example 1 Getting stats for a player - - var utils = require('utils'); - var jumpCount = utils.stat( player, 'jump'); - -#### Example 2 Getting the JUMP statistic object (which can be used elsewhere) - - var utils = require('utils'); - var JUMPSTAT = utils.stat('jump'); - var jumpCount = player.getStat( JUMPSTAT ); // canary-specific code - -This function also contains values for each possible stat so you can get at stats like this... - - var utils = require('utils'); - var JUMPSTAT = utils.stat.JUMP; // Accessing the value - var jumpCount = player.getStat ( JUMPSTAT ); // canary-specific code -## The watcher Module - -This module exposes functions for watching for changes to files or directories. - -### watcher.watchFile() function - -Watches for changes to the given file or directory and calls the function provided -when the file changes. - -#### Parameters - - * File - the file to watch (can be a file or directory) - * Callback - The callback to invoke when the file has changed. The callback takes the - changed file as a parameter. - -#### Example - -```javascript -var watcher = require('watcher'); -watcher.watchFile( 'test.txt', function( file ) { - console.log( file + ' has changed'); -}); -``` -### watcher.watchDir() function - -Watches for changes to the given directory and calls the function provided -when the directory changes. It works by calling watchFile/watchDir for each -file/subdirectory. - -#### Parameters - - * Dir - the file to watch (can be a file or directory) - * Callback - The callback to invoke when the directory has changed. - The callback takes the changed file as a parameter. - For each change inside the directory the callback will also - be called. - -#### Example - -```javascript -var watcher = require('watcher'); -watcher.watchDir( 'players/_ial', function( dir ) { - console.log( dir + ' has changed'); -}); -``` -### watcher.unwatchFile() function - -Removes a file from the watch list. - -#### Example -```javascript -var watcher = require('watcher'); -watcher.unwatchFile('test.txt'); -``` - -### watcher.unwatchDir() function - -Removes a directory from the watch list and all files inside the directory -are also "unwatched" - -#### Example -```javascript -var watcher = require('watcher'); -watcher.unwatchDir ('players/_ial'); -``` -Would cause also -```javascript -watcher.unwatchFile (file); -``` -for each file inside directory (and unwatchDir for each directory inside it) - -## Example Plugin #1 - A simple extension to Minecraft. - -A simple minecraft plugin. The most basic module. - -### Usage: - -At the in-game prompt type ... - - /js hello(self) - -... and a message `Hello {player-name}` will appear (where - {player-name} is replaced by your own name). - -This example demonstrates the basics of adding new functionality which -is only usable by server operators or users with the -scriptcraft.evaluate permission. By default, only ops are granted this -permission. - -The `hello` function below is only usable by players with the scriptcraft.evaluate -permission since it relies on the `/js` command to execute. - - exports.hello = function(player){ - echo( player, 'Hello ' + player.name); - }; - -## Example Plugin #2 - Making extensions available for all players. - -A simple minecraft plugin. Commands for other players. - -### Usage: - -At the in-game prompt type ... - - /jsp hello - -... and a message `Hello {player-name}` will appear (where {player-name} is -replaced by your own name). - -This example demonstrates the basics of adding new functionality -which is usable all players or those with the scriptcraft.proxy -permission. By default, all players are granted this permission. - -This differs from example 1 in that a new 'jsp ' command extension -is defined. Since all players can use the `jsp` command, all players -can use the new extension. Unlike the previous example, the `jsp hello` -command does not evaluate javascript code so this command is much more secure. - - command('hello', function (parameters, player) { - echo( player, 'Hello ' + player.name); - }); - -## Example Plugin #3 - Limiting use of commands to operators only. - -A simple minecraft plugin. Commands for operators only. - -### Usage: - -At the in-game prompt type ... - - /jsp op-hello - -... and a message `Hello {player-name}` will appear (where {player-name} is -replaced by your own name). - -This example demonstrates the basics of adding new functionality -which is usable all players or those with the scriptcraft.proxy -permission. By default, all players are granted this permission. In -this command though, the function checks to see if the player is an -operator and if they aren't will return immediately. - -This differs from example 2 in that the function will only print a -message for operators. - - command('op-hello', function (parameters, player) { - if ( !isOp(player) ){ - echo( player, 'Only operators can do this.'); - return; - } - echo( player, 'Hello ' + player.name); - }); -## Example Plugin #4 - Using parameters in commands. - -A simple minecraft plugin. Handling parameters. - -### Usage: - -At the in-game prompt type ... - - /jsp hello-params Hi - /jsp hello-params Saludos - /jsp hello-params Greetings - -... and a message `Hi {player-name}` or `Saludos {player-name}` etc -will appear (where {player-name} is replaced by your own name). - -This example demonstrates adding and using parameters in commands. - -This differs from example 3 in that the greeting can be changed from -a fixed 'Hello ' to anything you like by passing a parameter. - - command( 'hello-params', function ( parameters, player ) { - var salutation = parameters[0] ; - echo( player, salutation + ' ' + player.name ); - }); - -## Example Plugin #5 - Re-use - Using your own and others modules. - -A simple minecraft plugin. Using Modules. - -### Usage: - -At the in-game prompt type ... - - /jsp hello-module - -... and a message `Hello {player-name}` will appear (where {player-name} is -replaced by your own name). - -This example demonstrates the use of modules. In -example-1-hello-module.js we created a new javascript module. In -this example, we use that module... - - * We load the module using the `require()` function. Because this - module and the module we require are n the same directory, we - specify `'./example-1-hello-module'` as the path (when loading a - module from the same directory, `./` at the start of the path - indicates that the file should be searched for in the same - directory. - - * We assign the loaded module to a variable (`greetings`) and then - use the module's `hello` method to display the message. - -Source Code... - - var greetings = require('./example-1-hello-module'); - command( 'hello-module', function( parameters, player ) { - greetings.hello( player ); - }); - -## Example Plugin #6 - Re-use - Using 'utils' to get Player objects. - -A simple minecraft plugin. Finding players by name. - -### Usage: - -At the in-game prompt type ... - - /jsp hello-byname {player-name} - -... substituting {player-name} with the name of a player currently -online and a message `Hello ...` will be sent to the named -player. - -This example builds on example-5 and also introduces a new concept - -use of shared modules. That is : modules which are not specific to -any one plugin or set of plugins but which can be used by all -plugins. Shared modules should be placed in the -`scriptcraft/modules` directory. - - * The utils module is used. Because the 'utils' module is - located in the modules folder we don't need to specify an exact - path, just 'utils' will do. - - * The `utils.player()` function is used to obtain a player object - matching the player name. Once a player object is obtained, a - message is sent to that player. - -Source Code ... - - var utils = require('utils'); - var greetings = require('./example-1-hello-module'); - - command( 'hello-byname', function( parameters, sender ) { - var playerName = parameters[0]; - var recipient = utils.player( playerName ); - if ( recipient ) { - greetings.hello( recipient ); - } else { - echo( sender, 'Player ' + playerName + ' not found.' ); - } - }); - -## Example Plugin #7 - Listening for events, Greet players when they join the game. - -A simple event-driven minecraft plugin. How to handle Events. - -This example demonstrates event-driven programming. The code below -will display the version of ScriptCraft every time an operator joins -the game. This module is notable from previous modules for the -following reasons... - - 1. It does not export any functions or variables. That's fine. Not - all modules need export stuff. Code in this module will be - executed when the module is first loaded. Because it is in the - `/scriptcraft/plugins` directory, it will be loaded automatically - when the server starts up. - - 2. It uses ScriptCraft's `events` module to add a new *Event - Handler*. An *Event Handler* is a function that gets - called whenever a particular *event* happens in the game. The - function defined below will only be executed whenever a player - joins the game. This style of program is sometimes refered to as - *Event-Driven Programming*. - -Adding new *Event Handlers* in ScriptCraft is relatively easy. Use one -of the `events` module's functions to add a new event handler. The -events module has many functions - one for each type of event. Each -function takes a single parameter: - - * The event handling function (also sometimes refered to as a - 'callback'). In ScriptCraft, this function takes a single - parameter, an event object. All of the information about the event - is in the event object. - -In the example below, if a player joins the server and is an operator, -then the ScriptCraft plugin information will be displayed to that -player. - -```javascript -function onJoin( event ){ - if ( isOp(event.player) ) { - echo( event.player, 'Welcome to ' + __plugin ); - } -} -events.connection( onJoin ); -``` -First the onJoin() function is defined, this is our event handler - -the function we wish to be called every time some new player joins the -game. Then we hook up - or register - that function using the -events.connection() function. The events.connection function is the -function responsible for adding new *connection* event handlers - that -is - functions which should be invoked when there's a new *connection* -event in the game. A new *connection* event is fired whenever a player -joins the game. There are many other types of events you can handle in -Minecraft. You can see [a full list of events here][cmEvtList]. - -[cmEvtList]: #events-helper-module-canary-version -## Arrows Plugin - -The arrows mod adds fancy arrows to the game. Arrows which ... - - * Launch fireworks. - * Explode on impact. - * Force Lightning to strike where they land. - * Teleport the player to the landing spot. - * Spawn Trees at the landing spot. - -### Usage: - - * `/js arrows.firework(self)` - A firework launches where the the arrow lands. - * `/js arrows.lightning(self)` - lightning strikes where the arrow lands. - * `/js arrows.teleport(self)` - makes player teleport to where arrow has landed. - * `/js arrows.flourish(self)` - makes a tree grow where the arrow lands. - * `/js arrows.explosive(self)` - makes arrows explode. - * `/js arrows.normal(self)` sets arrow type to normal. - * `/js arrows.sign(self)` turns a targeted sign into an Arrows menu - -All of the above functions can take an optional player object or name -as a parameter. For example: `/js arrows.explosive('player23')` makes -player23's arrows explosive. - -## Spawn Plugin - -Allows in-game operators to easily spawn creatures at current location. - -### Usage - - /jsp spawn cow - /jsp spawn sheep - /jsp spawn wolf - -This command supports TAB completion so to see a list of possible -entitities, type `/jsp spawn ' at the in-game command prompt, then -press TAB. Visit - (Bukkit/SpigotMC) -or (CanaryMod) - -for a list of possible entities (creatures) which can be spawned. - -## alias Plugin - -The alias module lets players and server admins create their own -per-player or global custom in-game command aliases. - -### Examples - -To set a command alias which is only visible to the current player -(per-player alias)... - - /jsp alias set cw = time set {1} ; weather {2} - -... Creates a new custom command only usable by the player who set -it called `cw` (short for set Clock and Weather) which when invoked... - - /cw 4000 sun - -... will perform the following commands... - - /time set 4000 - /weather sun - -Aliases can use parameters as above. On the right hand side of the `=`, the -`{1}` refers to the first parameter provided with the `cw` alias, `{2}` -refers to the second parameter and so on. So `cw 4000 sun` is converted to -`time set 4000` and `weather sun`. - -To set a global command alias usable by all (only operators can create -such an alias)... - - /jsp alias global stormy = time 18000; weather storm - -To remove an alias ... - - /jsp alias remove cw - -... removes the 'cw' alias from the appropriate alias map. - -To get a list of aliases currently defined... - - /jsp alias list - -To get help on the `jsp alias` command: - - /jsp alias help - -Aliases can be used at the in-game prompt by players or in the server -console. Aliases will not be able to avail of command autocompletion -(pressing the TAB key will have no effect). - -## Commando Plugin - -### Description - -commando is a plugin which can be used to add completely new commands -to Minecraft. Normally ScriptCraft only allows for provision of new -commands as extensions to the jsp command. For example, to create a -new simple command for use by all players... - - /js command('hi', function(args,player){ echo( player, 'Hi ' + player.name); }); - -... then players can use this command by typing... - - /jsp hi - -... A couple of ScriptCraft users have asked for the ability to take -this a step further and allow the global command namespace to be -populated so that when a developer creates a new command using the -'command' function, then the command is added to the global command -namespace so that players can use it simply like this... - - /hi - -... There are good reasons why ScriptCraft's core `command()` function -does not do this. Polluting the global namespace with commands would -make ScriptCraft a bad citizen in that Plugins should be able to work -together in the same server and - as much as possible - not step on -each others' toes. The CraftBukkit team have very good reasons for -forcing Plugins to declare their commands in the plugin.yml -configuration file. It makes approving plugins easier and ensures that -craftbukkit plugins behave well together. While it is possible to -override other plugins' commands, the CraftBukkit team do not -recommend this. However, as ScriptCraft users have suggested, it -should be at the discretion of server administrators as to when -overriding or adding new commands to the global namespace is good. - -So this is where `commando()` comes in. It uses the exact same -signature as the core `command()` function but will also make the -command accessible without the `jsp` prefix so instead of having to -type `/jsp hi` for the above command example, players simply type -`/hi` . This functionality is provided as a plugin rather than as part -of the ScriptCraft core. - -### Example hi-command.js - - var commando = require('../commando'); - commando('hi', function(args,player){ - echo( player, 'Hi ' + player.name); - }); - -...Displays a greeting to any player who issues the `/hi` command. - -### Example - timeofday-command.js - - var times = {Dawn: 0, Midday: 6000, Dusk: 12000, Midnight:18000}; - commando('timeofday', function(params,player){ - player.location.world.setTime(times[params[0]]); - }, - ['Dawn','Midday','Dusk','Midnight']); - -... changes the time of day using a new `/timeofday` command (options are Dawn, Midday, Dusk, Midnight) - -### Caveats - -Since commands registered using commando are really just appendages to -the `/jsp` command and are not actually registered globally (it just -looks like that to the player), you won't be able to avail of tab -completion for the command itself or its parameters (unless you go the -traditional route of adding the `jsp` prefix). This plugin uses the -[PlayerCommandPreprocessEvent][pcppevt] which allows plugins to -intercepts all commands and inject their own commands instead. If -anyone reading this knows of a better way to programmatically add new -global commands for a plugin, please let me know. - -[pcppevt]: http://jd.bukkit.org/dev/apidocs/org/bukkit/event/player/PlayerCommandPreprocessEvent.html - -## homes Plugin - -The homes plugin lets players set a location as home and return to the -location, invite other players to their home and also visit other -player's homes. - -This module is a good example of how to create a javascript-based -minecraft mod which provides... - - * A programmatic interface (API) and - * A command extension which uses that API to provide new functionality for players. - -The module uses the `plugin()` function to specify an object and -methods, and the `command()` function to expose functionality to -players through a new `jsp home` command. This module also -demonstrates how to enable autocompletion for custom commands (to see -this in action, at the in-game prompt or server console prompt type -`jsp home ` then press the TAB key - you should see a list of further -possible options). - -The `jsp home` command has the following options... - -### Basic options - - * `/jsp home set` Will set your current location as your - 'home' location to which you can return at any time using the ... - - * `/jsp home` ..command will return you to your home, if you have set one. - - * `/jsp home {player}` Will take you to the home of {player} (where - {player} is the name of the player whose home you wish to visit. - - * `/jsp home delete` Deletes your home location from the location - database. This does not actually remove the home from the world or - change the world in any way. This command is completely - non-destructive and cannot be used for griefing. No blocks will be - destroyed by this command. - -### Social options -The following options allow players to open their homes to all or some -players, invite players to their home and see a list of homes they can -visit. - - * `/jsp home list` Lists home which you can visit. - * `/jsp home ilist` Lists players who can visit your home. - * `/jsp home invite {player}` Invites the named player to your home. - * `/jsp home uninvite {player}` Uninvites (revokes invitation) the named player to your home. - * `/jsp home public` Opens your home to all players (all players can visit your home). - * `/jsp home private` Makes your home private (no longer visitable by all). - -### Administration options -The following administration options can only be used by server operators... - - * `/jsp home listall` List all of the homes - * `/jsp home clear {player}` Removes the player's home - location. Again, this command does not destroy any structures in - the world, it simply removes the location from the database. No - blocks are destroyed by this command. - -## NumberGuess mini-game: - -### Description -This is a very simple number guessing game. Minecraft will ask you to -guess a number between 1 and 10 and you will tell you if you're too -hight or too low when you guess wrong. The purpose of this mini-game -code is to demonstrate use of Bukkit's Conversation API. - -### Example - - /js Game_NumberGuess.start(self) - -Once the game begins, guess a number by typing the `/` character -followed by a number between 1 and 10. - -## Cow Clicker Mini-Game - -### How to Play - -At the in-game prompt type `jsp cowclicker` to start or stop -playing. Right-Click on Cows to score points. No points for killing -cows (hint: use the same keyboard keys you'd use for opening doors). - -Every time you click a cow your score increases by 1 point. Your score -is displayed in a side-bar along the right edge of of the screen. - -![cow clicker](img/cowclicker.png) - -### Rules - - * You can join and leave the Cow Clicker game at any time by typing - `/jsp cowclicker` at the in-game prompt. - - * Once you leave the game, your score is reset to zero. - - * When you disconnect from the server, your score will be reset to zero. - -### Gameplay Mechanics - -This is meant as a trivially simple use of the [Bukkit Scoreboard -API][bukscore]. There are many things you'll want to consider when constructing -your own mini-game... - - * Is the game itself a long-lived game - that is - should players and - scores be persisted (stored) between server restarts? - - * What should happen when a player quits the server - should this also be - understood as quitting the mini-game? - - * What should happen when a player who was previously playing the - mini-game, joins the server - should they automatically resume the - mini-game? - -[bukscore]: http://jd.bukkit.org/beta/apidocs/org/bukkit/scoreboard/package-summary.html - - -## Items module (SpigotMC version) -The Items module provides a suite of functions - one for each possible item. -See https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html for a list of possible items - -### Usage - - items.book(); // returns org.bukkit.Material.BOOK - items.book(2); // returns a new org.bukkit.inventory.ItemStack object of 2 books - items.book( itemType ); // compares itemType parameter to org.bukkit.Material.BOOK or an Item of type book - -The following functions are provided: - - * acaciaBoat() - * acaciaButton() - * acaciaDoor() - * acaciaFence() - * acaciaFenceGate() - * acaciaLeaves() - * acaciaLog() - * acaciaPlanks() - * acaciaPressurePlate() - * acaciaSapling() - * acaciaSlab() - * acaciaStairs() - * acaciaTrapdoor() - * acaciaWood() - * activatorRail() - * air() - * allium() - * andesite() - * anvil() - * apple() - * armorStand() - * arrow() - * attachedMelonStem() - * attachedPumpkinStem() - * azureBluet() - * bakedPotato() - * barrier() - * batSpawnEgg() - * beacon() - * bedrock() - * beef() - * beetroot() - * beetrootSeeds() - * beetrootSoup() - * beetroots() - * birchBoat() - * birchButton() - * birchDoor() - * birchFence() - * birchFenceGate() - * birchLeaves() - * birchLog() - * birchPlanks() - * birchPressurePlate() - * birchSapling() - * birchSlab() - * birchStairs() - * birchTrapdoor() - * birchWood() - * blackBanner() - * blackBed() - * blackCarpet() - * blackConcrete() - * blackConcretePowder() - * blackGlazedTerracotta() - * blackShulkerBox() - * blackStainedGlass() - * blackStainedGlassPane() - * blackTerracotta() - * blackWallBanner() - * blackWool() - * blazePowder() - * blazeRod() - * blazeSpawnEgg() - * blueBanner() - * blueBed() - * blueCarpet() - * blueConcrete() - * blueConcretePowder() - * blueGlazedTerracotta() - * blueIce() - * blueOrchid() - * blueShulkerBox() - * blueStainedGlass() - * blueStainedGlassPane() - * blueTerracotta() - * blueWallBanner() - * blueWool() - * bone() - * boneBlock() - * boneMeal() - * book() - * bookshelf() - * bow() - * bowl() - * brainCoral() - * brainCoralBlock() - * brainCoralFan() - * brainCoralWallFan() - * bread() - * brewingStand() - * brick() - * brickSlab() - * brickStairs() - * bricks() - * brownBanner() - * brownBed() - * brownCarpet() - * brownConcrete() - * brownConcretePowder() - * brownGlazedTerracotta() - * brownMushroom() - * brownMushroomBlock() - * brownShulkerBox() - * brownStainedGlass() - * brownStainedGlassPane() - * brownTerracotta() - * brownWallBanner() - * brownWool() - * bubbleColumn() - * bubbleCoral() - * bubbleCoralBlock() - * bubbleCoralFan() - * bubbleCoralWallFan() - * bucket() - * cactus() - * cactusGreen() - * cake() - * carrot() - * carrotOnAStick() - * carrots() - * carvedPumpkin() - * cauldron() - * caveAir() - * caveSpiderSpawnEgg() - * chainCommandBlock() - * chainmailBoots() - * chainmailChestplate() - * chainmailHelmet() - * chainmailLeggings() - * charcoal() - * chest() - * chestMinecart() - * chicken() - * chickenSpawnEgg() - * chippedAnvil() - * chiseledQuartzBlock() - * chiseledRedSandstone() - * chiseledSandstone() - * chiseledStoneBricks() - * chorusFlower() - * chorusFruit() - * chorusPlant() - * clay() - * clayBall() - * clock() - * coal() - * coalBlock() - * coalOre() - * coarseDirt() - * cobblestone() - * cobblestoneSlab() - * cobblestoneStairs() - * cobblestoneWall() - * cobweb() - * cocoa() - * cocoaBeans() - * cod() - * codBucket() - * codSpawnEgg() - * commandBlock() - * commandBlockMinecart() - * comparator() - * compass() - * conduit() - * cookedBeef() - * cookedChicken() - * cookedCod() - * cookedMutton() - * cookedPorkchop() - * cookedRabbit() - * cookedSalmon() - * cookie() - * cowSpawnEgg() - * crackedStoneBricks() - * craftingTable() - * creeperHead() - * creeperSpawnEgg() - * creeperWallHead() - * cutRedSandstone() - * cutSandstone() - * cyanBanner() - * cyanBed() - * cyanCarpet() - * cyanConcrete() - * cyanConcretePowder() - * cyanDye() - * cyanGlazedTerracotta() - * cyanShulkerBox() - * cyanStainedGlass() - * cyanStainedGlassPane() - * cyanTerracotta() - * cyanWallBanner() - * cyanWool() - * damagedAnvil() - * dandelion() - * dandelionYellow() - * darkOakBoat() - * darkOakButton() - * darkOakDoor() - * darkOakFence() - * darkOakFenceGate() - * darkOakLeaves() - * darkOakLog() - * darkOakPlanks() - * darkOakPressurePlate() - * darkOakSapling() - * darkOakSlab() - * darkOakStairs() - * darkOakTrapdoor() - * darkOakWood() - * darkPrismarine() - * darkPrismarineSlab() - * darkPrismarineStairs() - * daylightDetector() - * deadBrainCoral() - * deadBrainCoralBlock() - * deadBrainCoralFan() - * deadBrainCoralWallFan() - * deadBubbleCoral() - * deadBubbleCoralBlock() - * deadBubbleCoralFan() - * deadBubbleCoralWallFan() - * deadBush() - * deadFireCoral() - * deadFireCoralBlock() - * deadFireCoralFan() - * deadFireCoralWallFan() - * deadHornCoral() - * deadHornCoralBlock() - * deadHornCoralFan() - * deadHornCoralWallFan() - * deadTubeCoral() - * deadTubeCoralBlock() - * deadTubeCoralFan() - * deadTubeCoralWallFan() - * debugStick() - * detectorRail() - * diamond() - * diamondAxe() - * diamondBlock() - * diamondBoots() - * diamondChestplate() - * diamondHelmet() - * diamondHoe() - * diamondHorseArmor() - * diamondLeggings() - * diamondOre() - * diamondPickaxe() - * diamondShovel() - * diamondSword() - * diorite() - * dirt() - * dispenser() - * dolphinSpawnEgg() - * donkeySpawnEgg() - * dragonBreath() - * dragonEgg() - * dragonHead() - * dragonWallHead() - * driedKelp() - * driedKelpBlock() - * dropper() - * drownedSpawnEgg() - * egg() - * elderGuardianSpawnEgg() - * elytra() - * emerald() - * emeraldBlock() - * emeraldOre() - * enchantedBook() - * enchantedGoldenApple() - * enchantingTable() - * endCrystal() - * endGateway() - * endPortal() - * endPortalFrame() - * endRod() - * endStone() - * endStoneBricks() - * enderChest() - * enderEye() - * enderPearl() - * endermanSpawnEgg() - * endermiteSpawnEgg() - * evokerSpawnEgg() - * experienceBottle() - * farmland() - * feather() - * fermentedSpiderEye() - * fern() - * filledMap() - * fire() - * fireCharge() - * fireCoral() - * fireCoralBlock() - * fireCoralFan() - * fireCoralWallFan() - * fireworkRocket() - * fireworkStar() - * fishingRod() - * flint() - * flintAndSteel() - * flowerPot() - * frostedIce() - * furnace() - * furnaceMinecart() - * ghastSpawnEgg() - * ghastTear() - * glass() - * glassBottle() - * glassPane() - * glisteringMelonSlice() - * glowstone() - * glowstoneDust() - * goldBlock() - * goldIngot() - * goldNugget() - * goldOre() - * goldenApple() - * goldenAxe() - * goldenBoots() - * goldenCarrot() - * goldenChestplate() - * goldenHelmet() - * goldenHoe() - * goldenHorseArmor() - * goldenLeggings() - * goldenPickaxe() - * goldenShovel() - * goldenSword() - * granite() - * grass() - * grassBlock() - * grassPath() - * gravel() - * grayBanner() - * grayBed() - * grayCarpet() - * grayConcrete() - * grayConcretePowder() - * grayDye() - * grayGlazedTerracotta() - * grayShulkerBox() - * grayStainedGlass() - * grayStainedGlassPane() - * grayTerracotta() - * grayWallBanner() - * grayWool() - * greenBanner() - * greenBed() - * greenCarpet() - * greenConcrete() - * greenConcretePowder() - * greenGlazedTerracotta() - * greenShulkerBox() - * greenStainedGlass() - * greenStainedGlassPane() - * greenTerracotta() - * greenWallBanner() - * greenWool() - * guardianSpawnEgg() - * gunpowder() - * hayBlock() - * heartOfTheSea() - * heavyWeightedPressurePlate() - * hopper() - * hopperMinecart() - * hornCoral() - * hornCoralBlock() - * hornCoralFan() - * hornCoralWallFan() - * horseSpawnEgg() - * huskSpawnEgg() - * ice() - * infestedChiseledStoneBricks() - * infestedCobblestone() - * infestedCrackedStoneBricks() - * infestedMossyStoneBricks() - * infestedStone() - * infestedStoneBricks() - * inkSac() - * ironAxe() - * ironBars() - * ironBlock() - * ironBoots() - * ironChestplate() - * ironDoor() - * ironHelmet() - * ironHoe() - * ironHorseArmor() - * ironIngot() - * ironLeggings() - * ironNugget() - * ironOre() - * ironPickaxe() - * ironShovel() - * ironSword() - * ironTrapdoor() - * itemFrame() - * jackOLantern() - * jukebox() - * jungleBoat() - * jungleButton() - * jungleDoor() - * jungleFence() - * jungleFenceGate() - * jungleLeaves() - * jungleLog() - * junglePlanks() - * junglePressurePlate() - * jungleSapling() - * jungleSlab() - * jungleStairs() - * jungleTrapdoor() - * jungleWood() - * kelp() - * kelpPlant() - * knowledgeBook() - * ladder() - * lapisBlock() - * lapisLazuli() - * lapisOre() - * largeFern() - * lava() - * lavaBucket() - * lead() - * leather() - * leatherBoots() - * leatherChestplate() - * leatherHelmet() - * leatherLeggings() - * legacyAcaciaDoor() - * legacyAcaciaDoorItem() - * legacyAcaciaFence() - * legacyAcaciaFenceGate() - * legacyAcaciaStairs() - * legacyActivatorRail() - * legacyAir() - * legacyAnvil() - * legacyApple() - * legacyArmorStand() - * legacyArrow() - * legacyBakedPotato() - * legacyBanner() - * legacyBarrier() - * legacyBeacon() - * legacyBed() - * legacyBedBlock() - * legacyBedrock() - * legacyBeetroot() - * legacyBeetrootBlock() - * legacyBeetrootSeeds() - * legacyBeetrootSoup() - * legacyBirchDoor() - * legacyBirchDoorItem() - * legacyBirchFence() - * legacyBirchFenceGate() - * legacyBirchWoodStairs() - * legacyBlackGlazedTerracotta() - * legacyBlackShulkerBox() - * legacyBlazePowder() - * legacyBlazeRod() - * legacyBlueGlazedTerracotta() - * legacyBlueShulkerBox() - * legacyBoat() - * legacyBoatAcacia() - * legacyBoatBirch() - * legacyBoatDarkOak() - * legacyBoatJungle() - * legacyBoatSpruce() - * legacyBone() - * legacyBoneBlock() - * legacyBook() - * legacyBookAndQuill() - * legacyBookshelf() - * legacyBow() - * legacyBowl() - * legacyBread() - * legacyBrewingStand() - * legacyBrewingStandItem() - * legacyBrick() - * legacyBrickStairs() - * legacyBrownGlazedTerracotta() - * legacyBrownMushroom() - * legacyBrownShulkerBox() - * legacyBucket() - * legacyBurningFurnace() - * legacyCactus() - * legacyCake() - * legacyCakeBlock() - * legacyCarpet() - * legacyCarrot() - * legacyCarrotItem() - * legacyCarrotStick() - * legacyCauldron() - * legacyCauldronItem() - * legacyChainmailBoots() - * legacyChainmailChestplate() - * legacyChainmailHelmet() - * legacyChainmailLeggings() - * legacyChest() - * legacyChorusFlower() - * legacyChorusFruit() - * legacyChorusFruitPopped() - * legacyChorusPlant() - * legacyClay() - * legacyClayBall() - * legacyClayBrick() - * legacyCoal() - * legacyCoalBlock() - * legacyCoalOre() - * legacyCobbleWall() - * legacyCobblestone() - * legacyCobblestoneStairs() - * legacyCocoa() - * legacyCommand() - * legacyCommandChain() - * legacyCommandMinecart() - * legacyCommandRepeating() - * legacyCompass() - * legacyConcrete() - * legacyConcretePowder() - * legacyCookedBeef() - * legacyCookedChicken() - * legacyCookedFish() - * legacyCookedMutton() - * legacyCookedRabbit() - * legacyCookie() - * legacyCrops() - * legacyCyanGlazedTerracotta() - * legacyCyanShulkerBox() - * legacyDarkOakDoor() - * legacyDarkOakDoorItem() - * legacyDarkOakFence() - * legacyDarkOakFenceGate() - * legacyDarkOakStairs() - * legacyDaylightDetector() - * legacyDaylightDetectorInverted() - * legacyDeadBush() - * legacyDetectorRail() - * legacyDiamond() - * legacyDiamondAxe() - * legacyDiamondBarding() - * legacyDiamondBlock() - * legacyDiamondBoots() - * legacyDiamondChestplate() - * legacyDiamondHelmet() - * legacyDiamondHoe() - * legacyDiamondLeggings() - * legacyDiamondOre() - * legacyDiamondPickaxe() - * legacyDiamondSpade() - * legacyDiamondSword() - * legacyDiode() - * legacyDiodeBlockOff() - * legacyDiodeBlockOn() - * legacyDirt() - * legacyDispenser() - * legacyDoublePlant() - * legacyDoubleStep() - * legacyDoubleStoneSlab2() - * legacyDragonEgg() - * legacyDragonsBreath() - * legacyDropper() - * legacyEgg() - * legacyElytra() - * legacyEmerald() - * legacyEmeraldBlock() - * legacyEmeraldOre() - * legacyEmptyMap() - * legacyEnchantedBook() - * legacyEnchantmentTable() - * legacyEndBricks() - * legacyEndCrystal() - * legacyEndGateway() - * legacyEndRod() - * legacyEnderChest() - * legacyEnderPearl() - * legacyEnderPortal() - * legacyEnderPortalFrame() - * legacyEnderStone() - * legacyExpBottle() - * legacyExplosiveMinecart() - * legacyEyeOfEnder() - * legacyFeather() - * legacyFence() - * legacyFenceGate() - * legacyFermentedSpiderEye() - * legacyFire() - * legacyFireball() - * legacyFirework() - * legacyFireworkCharge() - * legacyFishingRod() - * legacyFlint() - * legacyFlintAndSteel() - * legacyFlowerPot() - * legacyFlowerPotItem() - * legacyFrostedIce() - * legacyFurnace() - * legacyGhastTear() - * legacyGlass() - * legacyGlassBottle() - * legacyGlowingRedstoneOre() - * legacyGlowstone() - * legacyGlowstoneDust() - * legacyGoldAxe() - * legacyGoldBarding() - * legacyGoldBlock() - * legacyGoldBoots() - * legacyGoldChestplate() - * legacyGoldHelmet() - * legacyGoldHoe() - * legacyGoldIngot() - * legacyGoldLeggings() - * legacyGoldNugget() - * legacyGoldOre() - * legacyGoldPickaxe() - * legacyGoldPlate() - * legacyGoldRecord() - * legacyGoldSpade() - * legacyGoldSword() - * legacyGoldenApple() - * legacyGoldenCarrot() - * legacyGrass() - * legacyGrassPath() - * legacyGravel() - * legacyGrayGlazedTerracotta() - * legacyGrayShulkerBox() - * legacyGreenGlazedTerracotta() - * legacyGreenRecord() - * legacyGreenShulkerBox() - * legacyGrilledPork() - * legacyHardClay() - * legacyHayBlock() - * legacyHopper() - * legacyHopperMinecart() - * legacyHugeMushroom1() - * legacyHugeMushroom2() - * legacyIce() - * legacyInkSack() - * legacyIronAxe() - * legacyIronBarding() - * legacyIronBlock() - * legacyIronBoots() - * legacyIronChestplate() - * legacyIronDoor() - * legacyIronDoorBlock() - * legacyIronFence() - * legacyIronHelmet() - * legacyIronHoe() - * legacyIronIngot() - * legacyIronLeggings() - * legacyIronNugget() - * legacyIronOre() - * legacyIronPickaxe() - * legacyIronPlate() - * legacyIronSpade() - * legacyIronSword() - * legacyIronTrapdoor() - * legacyItemFrame() - * legacyJackOLantern() - * legacyJukebox() - * legacyJungleDoor() - * legacyJungleDoorItem() - * legacyJungleFence() - * legacyJungleFenceGate() - * legacyJungleWoodStairs() - * legacyKnowledgeBook() - * legacyLadder() - * legacyLapisBlock() - * legacyLapisOre() - * legacyLava() - * legacyLavaBucket() - * legacyLeash() - * legacyLeather() - * legacyLeatherBoots() - * legacyLeatherChestplate() - * legacyLeatherHelmet() - * legacyLeatherLeggings() - * legacyLeaves() - * legacyLeaves2() - * legacyLever() - * legacyLightBlueGlazedTerracotta() - * legacyLightBlueShulkerBox() - * legacyLimeGlazedTerracotta() - * legacyLimeShulkerBox() - * legacyLingeringPotion() - * legacyLog() - * legacyLog2() - * legacyLongGrass() - * legacyMagentaGlazedTerracotta() - * legacyMagentaShulkerBox() - * legacyMagma() - * legacyMagmaCream() - * legacyMap() - * legacyMelon() - * legacyMelonBlock() - * legacyMelonSeeds() - * legacyMelonStem() - * legacyMilkBucket() - * legacyMinecart() - * legacyMobSpawner() - * legacyMonsterEgg() - * legacyMonsterEggs() - * legacyMossyCobblestone() - * legacyMushroomSoup() - * legacyMutton() - * legacyMycel() - * legacyNameTag() - * legacyNetherBrick() - * legacyNetherBrickItem() - * legacyNetherBrickStairs() - * legacyNetherFence() - * legacyNetherStalk() - * legacyNetherStar() - * legacyNetherWartBlock() - * legacyNetherWarts() - * legacyNetherrack() - * legacyNoteBlock() - * legacyObserver() - * legacyObsidian() - * legacyOrangeGlazedTerracotta() - * legacyOrangeShulkerBox() - * legacyPackedIce() - * legacyPainting() - * legacyPaper() - * legacyPinkGlazedTerracotta() - * legacyPinkShulkerBox() - * legacyPistonBase() - * legacyPistonExtension() - * legacyPistonMovingPiece() - * legacyPistonStickyBase() - * legacyPoisonousPotato() - * legacyPork() - * legacyPortal() - * legacyPotato() - * legacyPotatoItem() - * legacyPotion() - * legacyPoweredMinecart() - * legacyPoweredRail() - * legacyPrismarine() - * legacyPrismarineCrystals() - * legacyPrismarineShard() - * legacyPumpkin() - * legacyPumpkinPie() - * legacyPumpkinSeeds() - * legacyPumpkinStem() - * legacyPurpleGlazedTerracotta() - * legacyPurpleShulkerBox() - * legacyPurpurBlock() - * legacyPurpurDoubleSlab() - * legacyPurpurPillar() - * legacyPurpurSlab() - * legacyPurpurStairs() - * legacyQuartz() - * legacyQuartzBlock() - * legacyQuartzOre() - * legacyQuartzStairs() - * legacyRabbit() - * legacyRabbitFoot() - * legacyRabbitHide() - * legacyRabbitStew() - * legacyRails() - * legacyRawBeef() - * legacyRawChicken() - * legacyRawFish() - * legacyRecord10() - * legacyRecord11() - * legacyRecord12() - * legacyRecord3() - * legacyRecord4() - * legacyRecord5() - * legacyRecord6() - * legacyRecord7() - * legacyRecord8() - * legacyRecord9() - * legacyRedGlazedTerracotta() - * legacyRedMushroom() - * legacyRedNetherBrick() - * legacyRedRose() - * legacyRedSandstone() - * legacyRedSandstoneStairs() - * legacyRedShulkerBox() - * legacyRedstone() - * legacyRedstoneBlock() - * legacyRedstoneComparator() - * legacyRedstoneComparatorOff() - * legacyRedstoneComparatorOn() - * legacyRedstoneLampOff() - * legacyRedstoneLampOn() - * legacyRedstoneOre() - * legacyRedstoneTorchOff() - * legacyRedstoneTorchOn() - * legacyRedstoneWire() - * legacyRottenFlesh() - * legacySaddle() - * legacySand() - * legacySandstone() - * legacySandstoneStairs() - * legacySapling() - * legacySeaLantern() - * legacySeeds() - * legacyShears() - * legacyShield() - * legacyShulkerShell() - * legacySign() - * legacySignPost() - * legacySilverGlazedTerracotta() - * legacySilverShulkerBox() - * legacySkull() - * legacySkullItem() - * legacySlimeBall() - * legacySlimeBlock() - * legacySmoothBrick() - * legacySmoothStairs() - * legacySnow() - * legacySnowBall() - * legacySnowBlock() - * legacySoil() - * legacySoulSand() - * legacySpeckledMelon() - * legacySpectralArrow() - * legacySpiderEye() - * legacySplashPotion() - * legacySponge() - * legacySpruceDoor() - * legacySpruceDoorItem() - * legacySpruceFence() - * legacySpruceFenceGate() - * legacySpruceWoodStairs() - * legacyStainedClay() - * legacyStainedGlass() - * legacyStainedGlassPane() - * legacyStandingBanner() - * legacyStationaryLava() - * legacyStationaryWater() - * legacyStep() - * legacyStick() - * legacyStone() - * legacyStoneAxe() - * legacyStoneButton() - * legacyStoneHoe() - * legacyStonePickaxe() - * legacyStonePlate() - * legacyStoneSlab2() - * legacyStoneSpade() - * legacyStoneSword() - * legacyStorageMinecart() - * legacyString() - * legacyStructureBlock() - * legacyStructureVoid() - * legacySugar() - * legacySugarCane() - * legacySugarCaneBlock() - * legacySulphur() - * legacyThinGlass() - * legacyTippedArrow() - * legacyTnt() - * legacyTorch() - * legacyTotem() - * legacyTrapDoor() - * legacyTrappedChest() - * legacyTripwire() - * legacyTripwireHook() - * legacyVine() - * legacyWallBanner() - * legacyWallSign() - * legacyWatch() - * legacyWater() - * legacyWaterBucket() - * legacyWaterLily() - * legacyWeb() - * legacyWheat() - * legacyWhiteGlazedTerracotta() - * legacyWhiteShulkerBox() - * legacyWood() - * legacyWoodAxe() - * legacyWoodButton() - * legacyWoodDoor() - * legacyWoodDoubleStep() - * legacyWoodHoe() - * legacyWoodPickaxe() - * legacyWoodPlate() - * legacyWoodSpade() - * legacyWoodStairs() - * legacyWoodStep() - * legacyWoodSword() - * legacyWoodenDoor() - * legacyWool() - * legacyWorkbench() - * legacyWrittenBook() - * legacyYellowFlower() - * legacyYellowGlazedTerracotta() - * legacyYellowShulkerBox() - * lever() - * lightBlueBanner() - * lightBlueBed() - * lightBlueCarpet() - * lightBlueConcrete() - * lightBlueConcretePowder() - * lightBlueDye() - * lightBlueGlazedTerracotta() - * lightBlueShulkerBox() - * lightBlueStainedGlass() - * lightBlueStainedGlassPane() - * lightBlueTerracotta() - * lightBlueWallBanner() - * lightBlueWool() - * lightGrayBanner() - * lightGrayBed() - * lightGrayCarpet() - * lightGrayConcrete() - * lightGrayConcretePowder() - * lightGrayDye() - * lightGrayGlazedTerracotta() - * lightGrayShulkerBox() - * lightGrayStainedGlass() - * lightGrayStainedGlassPane() - * lightGrayTerracotta() - * lightGrayWallBanner() - * lightGrayWool() - * lightWeightedPressurePlate() - * lilac() - * lilyPad() - * limeBanner() - * limeBed() - * limeCarpet() - * limeConcrete() - * limeConcretePowder() - * limeDye() - * limeGlazedTerracotta() - * limeShulkerBox() - * limeStainedGlass() - * limeStainedGlassPane() - * limeTerracotta() - * limeWallBanner() - * limeWool() - * lingeringPotion() - * llamaSpawnEgg() - * magentaBanner() - * magentaBed() - * magentaCarpet() - * magentaConcrete() - * magentaConcretePowder() - * magentaDye() - * magentaGlazedTerracotta() - * magentaShulkerBox() - * magentaStainedGlass() - * magentaStainedGlassPane() - * magentaTerracotta() - * magentaWallBanner() - * magentaWool() - * magmaBlock() - * magmaCream() - * magmaCubeSpawnEgg() - * map() - * melon() - * melonSeeds() - * melonSlice() - * melonStem() - * milkBucket() - * minecart() - * mooshroomSpawnEgg() - * mossyCobblestone() - * mossyCobblestoneWall() - * mossyStoneBricks() - * movingPiston() - * muleSpawnEgg() - * mushroomStem() - * mushroomStew() - * musicDisc11() - * musicDisc13() - * musicDiscBlocks() - * musicDiscCat() - * musicDiscChirp() - * musicDiscFar() - * musicDiscMall() - * musicDiscMellohi() - * musicDiscStal() - * musicDiscStrad() - * musicDiscWait() - * musicDiscWard() - * mutton() - * mycelium() - * nameTag() - * nautilusShell() - * netherBrick() - * netherBrickFence() - * netherBrickSlab() - * netherBrickStairs() - * netherBricks() - * netherPortal() - * netherQuartzOre() - * netherStar() - * netherWart() - * netherWartBlock() - * netherrack() - * noteBlock() - * oakBoat() - * oakButton() - * oakDoor() - * oakFence() - * oakFenceGate() - * oakLeaves() - * oakLog() - * oakPlanks() - * oakPressurePlate() - * oakSapling() - * oakSlab() - * oakStairs() - * oakTrapdoor() - * oakWood() - * observer() - * obsidian() - * ocelotSpawnEgg() - * orangeBanner() - * orangeBed() - * orangeCarpet() - * orangeConcrete() - * orangeConcretePowder() - * orangeDye() - * orangeGlazedTerracotta() - * orangeShulkerBox() - * orangeStainedGlass() - * orangeStainedGlassPane() - * orangeTerracotta() - * orangeTulip() - * orangeWallBanner() - * orangeWool() - * oxeyeDaisy() - * packedIce() - * painting() - * paper() - * parrotSpawnEgg() - * peony() - * petrifiedOakSlab() - * phantomMembrane() - * phantomSpawnEgg() - * pigSpawnEgg() - * pinkBanner() - * pinkBed() - * pinkCarpet() - * pinkConcrete() - * pinkConcretePowder() - * pinkDye() - * pinkGlazedTerracotta() - * pinkShulkerBox() - * pinkStainedGlass() - * pinkStainedGlassPane() - * pinkTerracotta() - * pinkTulip() - * pinkWallBanner() - * pinkWool() - * piston() - * pistonHead() - * playerHead() - * playerWallHead() - * podzol() - * poisonousPotato() - * polarBearSpawnEgg() - * polishedAndesite() - * polishedDiorite() - * polishedGranite() - * poppedChorusFruit() - * poppy() - * porkchop() - * potato() - * potatoes() - * potion() - * pottedAcaciaSapling() - * pottedAllium() - * pottedAzureBluet() - * pottedBirchSapling() - * pottedBlueOrchid() - * pottedBrownMushroom() - * pottedCactus() - * pottedDandelion() - * pottedDarkOakSapling() - * pottedDeadBush() - * pottedFern() - * pottedJungleSapling() - * pottedOakSapling() - * pottedOrangeTulip() - * pottedOxeyeDaisy() - * pottedPinkTulip() - * pottedPoppy() - * pottedRedMushroom() - * pottedRedTulip() - * pottedSpruceSapling() - * pottedWhiteTulip() - * poweredRail() - * prismarine() - * prismarineBrickSlab() - * prismarineBrickStairs() - * prismarineBricks() - * prismarineCrystals() - * prismarineShard() - * prismarineSlab() - * prismarineStairs() - * pufferfish() - * pufferfishBucket() - * pufferfishSpawnEgg() - * pumpkin() - * pumpkinPie() - * pumpkinSeeds() - * pumpkinStem() - * purpleBanner() - * purpleBed() - * purpleCarpet() - * purpleConcrete() - * purpleConcretePowder() - * purpleDye() - * purpleGlazedTerracotta() - * purpleShulkerBox() - * purpleStainedGlass() - * purpleStainedGlassPane() - * purpleTerracotta() - * purpleWallBanner() - * purpleWool() - * purpurBlock() - * purpurPillar() - * purpurSlab() - * purpurStairs() - * quartz() - * quartzBlock() - * quartzPillar() - * quartzSlab() - * quartzStairs() - * rabbit() - * rabbitFoot() - * rabbitHide() - * rabbitSpawnEgg() - * rabbitStew() - * rail() - * redBanner() - * redBed() - * redCarpet() - * redConcrete() - * redConcretePowder() - * redGlazedTerracotta() - * redMushroom() - * redMushroomBlock() - * redNetherBricks() - * redSand() - * redSandstone() - * redSandstoneSlab() - * redSandstoneStairs() - * redShulkerBox() - * redStainedGlass() - * redStainedGlassPane() - * redTerracotta() - * redTulip() - * redWallBanner() - * redWool() - * redstone() - * redstoneBlock() - * redstoneLamp() - * redstoneOre() - * redstoneTorch() - * redstoneWallTorch() - * redstoneWire() - * repeater() - * repeatingCommandBlock() - * roseBush() - * roseRed() - * rottenFlesh() - * saddle() - * salmon() - * salmonBucket() - * salmonSpawnEgg() - * sand() - * sandstone() - * sandstoneSlab() - * sandstoneStairs() - * scute() - * seaLantern() - * seaPickle() - * seagrass() - * shears() - * sheepSpawnEgg() - * shield() - * shulkerBox() - * shulkerShell() - * shulkerSpawnEgg() - * sign() - * silverfishSpawnEgg() - * skeletonHorseSpawnEgg() - * skeletonSkull() - * skeletonSpawnEgg() - * skeletonWallSkull() - * slimeBall() - * slimeBlock() - * slimeSpawnEgg() - * smoothQuartz() - * smoothRedSandstone() - * smoothSandstone() - * smoothStone() - * snow() - * snowBlock() - * snowball() - * soulSand() - * spawner() - * spectralArrow() - * spiderEye() - * spiderSpawnEgg() - * splashPotion() - * sponge() - * spruceBoat() - * spruceButton() - * spruceDoor() - * spruceFence() - * spruceFenceGate() - * spruceLeaves() - * spruceLog() - * sprucePlanks() - * sprucePressurePlate() - * spruceSapling() - * spruceSlab() - * spruceStairs() - * spruceTrapdoor() - * spruceWood() - * squidSpawnEgg() - * stick() - * stickyPiston() - * stone() - * stoneAxe() - * stoneBrickSlab() - * stoneBrickStairs() - * stoneBricks() - * stoneButton() - * stoneHoe() - * stonePickaxe() - * stonePressurePlate() - * stoneShovel() - * stoneSlab() - * stoneSword() - * straySpawnEgg() - * string() - * strippedAcaciaLog() - * strippedAcaciaWood() - * strippedBirchLog() - * strippedBirchWood() - * strippedDarkOakLog() - * strippedDarkOakWood() - * strippedJungleLog() - * strippedJungleWood() - * strippedOakLog() - * strippedOakWood() - * strippedSpruceLog() - * strippedSpruceWood() - * structureBlock() - * structureVoid() - * sugar() - * sugarCane() - * sunflower() - * tallGrass() - * tallSeagrass() - * terracotta() - * tippedArrow() - * tnt() - * tntMinecart() - * torch() - * totemOfUndying() - * trappedChest() - * trident() - * tripwire() - * tripwireHook() - * tropicalFish() - * tropicalFishBucket() - * tropicalFishSpawnEgg() - * tubeCoral() - * tubeCoralBlock() - * tubeCoralFan() - * tubeCoralWallFan() - * turtleEgg() - * turtleHelmet() - * turtleSpawnEgg() - * vexSpawnEgg() - * villagerSpawnEgg() - * vindicatorSpawnEgg() - * vine() - * voidAir() - * wallSign() - * wallTorch() - * water() - * waterBucket() - * wetSponge() - * wheat() - * wheatSeeds() - * whiteBanner() - * whiteBed() - * whiteCarpet() - * whiteConcrete() - * whiteConcretePowder() - * whiteGlazedTerracotta() - * whiteShulkerBox() - * whiteStainedGlass() - * whiteStainedGlassPane() - * whiteTerracotta() - * whiteTulip() - * whiteWallBanner() - * whiteWool() - * witchSpawnEgg() - * witherSkeletonSkull() - * witherSkeletonSpawnEgg() - * witherSkeletonWallSkull() - * wolfSpawnEgg() - * woodenAxe() - * woodenHoe() - * woodenPickaxe() - * woodenShovel() - * woodenSword() - * writableBook() - * writtenBook() - * yellowBanner() - * yellowBed() - * yellowCarpet() - * yellowConcrete() - * yellowConcretePowder() - * yellowGlazedTerracotta() - * yellowShulkerBox() - * yellowStainedGlass() - * yellowStainedGlassPane() - * yellowTerracotta() - * yellowWallBanner() - * yellowWool() - * zombieHead() - * zombieHorseSpawnEgg() - * zombiePigmanSpawnEgg() - * zombieSpawnEgg() - * zombieVillagerSpawnEgg() - * zombieWallHead() - - -## Sounds module (SpigotMC version) - -This module provides a simple way to play sounds. - -### Usage - - var sounds = require("sounds"); - // plays ENTITY_WOLF_HOWL sound at full volume and medium pitch - sounds.play( org.bukkit.Sound.ENTITY_WOLF_HOWL, self, 1, 0); - // same as previous statement - sounds.play( org.bukkit.Sound.ENTITY_WOLF_HOWL , self ); - -The play() function takes as parameters: - - * A Sound value (see https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Sound.html for a list of possible values) - * A Location orbject or any object which has a location - * The Volume parameter is in the range 0 to 1 (default: 1) - * The Pitch parameter is in the range 0 to 4 (default: 0) - -In addition, the Sounds module provides a suite of helper functions - one for each possible sound. - - var sounds = require("sounds"); - // same as previous examples - sounds.entityWolfHowl( self ); - -Each of the following functions takes as parameters: - - * A Location orbject or any object which has a location - * The Volume parameter is in the range 0 to 1 (default: 1) - * The Pitch parameter is in the range 0 to 4 (default: 0) - -The following functions are provided for convenience and to help beginners explore sounds using TAB completion: - - * ambientCave() - * ambientUnderwaterEnter() - * ambientUnderwaterExit() - * ambientUnderwaterLoop() - * ambientUnderwaterLoopAdditions() - * ambientUnderwaterLoopAdditionsRare() - * ambientUnderwaterLoopAdditionsUltraRare() - * blockAnvilBreak() - * blockAnvilDestroy() - * blockAnvilFall() - * blockAnvilHit() - * blockAnvilLand() - * blockAnvilPlace() - * blockAnvilStep() - * blockAnvilUse() - * blockBeaconActivate() - * blockBeaconAmbient() - * blockBeaconDeactivate() - * blockBeaconPowerSelect() - * blockBrewingStandBrew() - * blockBubbleColumnBubblePop() - * blockBubbleColumnUpwardsAmbient() - * blockBubbleColumnUpwardsInside() - * blockBubbleColumnWhirlpoolAmbient() - * blockBubbleColumnWhirlpoolInside() - * blockChestClose() - * blockChestLocked() - * blockChestOpen() - * blockChorusFlowerDeath() - * blockChorusFlowerGrow() - * blockComparatorClick() - * blockConduitActivate() - * blockConduitAmbient() - * blockConduitAmbientShort() - * blockConduitAttackTarget() - * blockConduitDeactivate() - * blockCoralBlockBreak() - * blockCoralBlockFall() - * blockCoralBlockHit() - * blockCoralBlockPlace() - * blockCoralBlockStep() - * blockDispenserDispense() - * blockDispenserFail() - * blockDispenserLaunch() - * blockEnchantmentTableUse() - * blockEndGatewaySpawn() - * blockEndPortalFrameFill() - * blockEndPortalSpawn() - * blockEnderChestClose() - * blockEnderChestOpen() - * blockFenceGateClose() - * blockFenceGateOpen() - * blockFireAmbient() - * blockFireExtinguish() - * blockFurnaceFireCrackle() - * blockGlassBreak() - * blockGlassFall() - * blockGlassHit() - * blockGlassPlace() - * blockGlassStep() - * blockGrassBreak() - * blockGrassFall() - * blockGrassHit() - * blockGrassPlace() - * blockGrassStep() - * blockGravelBreak() - * blockGravelFall() - * blockGravelHit() - * blockGravelPlace() - * blockGravelStep() - * blockIronDoorClose() - * blockIronDoorOpen() - * blockIronTrapdoorClose() - * blockIronTrapdoorOpen() - * blockLadderBreak() - * blockLadderFall() - * blockLadderHit() - * blockLadderPlace() - * blockLadderStep() - * blockLavaAmbient() - * blockLavaExtinguish() - * blockLavaPop() - * blockLeverClick() - * blockLilyPadPlace() - * blockMetalBreak() - * blockMetalFall() - * blockMetalHit() - * blockMetalPlace() - * blockMetalPressurePlateClickOff() - * blockMetalPressurePlateClickOn() - * blockMetalStep() - * blockNoteBlockBasedrum() - * blockNoteBlockBass() - * blockNoteBlockBell() - * blockNoteBlockChime() - * blockNoteBlockFlute() - * blockNoteBlockGuitar() - * blockNoteBlockHarp() - * blockNoteBlockHat() - * blockNoteBlockPling() - * blockNoteBlockSnare() - * blockNoteBlockXylophone() - * blockPistonContract() - * blockPistonExtend() - * blockPortalAmbient() - * blockPortalTravel() - * blockPortalTrigger() - * blockPumpkinCarve() - * blockRedstoneTorchBurnout() - * blockSandBreak() - * blockSandFall() - * blockSandHit() - * blockSandPlace() - * blockSandStep() - * blockShulkerBoxClose() - * blockShulkerBoxOpen() - * blockSlimeBlockBreak() - * blockSlimeBlockFall() - * blockSlimeBlockHit() - * blockSlimeBlockPlace() - * blockSlimeBlockStep() - * blockSnowBreak() - * blockSnowFall() - * blockSnowHit() - * blockSnowPlace() - * blockSnowStep() - * blockStoneBreak() - * blockStoneButtonClickOff() - * blockStoneButtonClickOn() - * blockStoneFall() - * blockStoneHit() - * blockStonePlace() - * blockStonePressurePlateClickOff() - * blockStonePressurePlateClickOn() - * blockStoneStep() - * blockTripwireAttach() - * blockTripwireClickOff() - * blockTripwireClickOn() - * blockTripwireDetach() - * blockWaterAmbient() - * blockWetGrassBreak() - * blockWetGrassFall() - * blockWetGrassHit() - * blockWetGrassPlace() - * blockWetGrassStep() - * blockWoodBreak() - * blockWoodFall() - * blockWoodHit() - * blockWoodPlace() - * blockWoodStep() - * blockWoodenButtonClickOff() - * blockWoodenButtonClickOn() - * blockWoodenDoorClose() - * blockWoodenDoorOpen() - * blockWoodenPressurePlateClickOff() - * blockWoodenPressurePlateClickOn() - * blockWoodenTrapdoorClose() - * blockWoodenTrapdoorOpen() - * blockWoolBreak() - * blockWoolFall() - * blockWoolHit() - * blockWoolPlace() - * blockWoolStep() - * enchantThornsHit() - * entityArmorStandBreak() - * entityArmorStandFall() - * entityArmorStandHit() - * entityArmorStandPlace() - * entityArrowHit() - * entityArrowHitPlayer() - * entityArrowShoot() - * entityBatAmbient() - * entityBatDeath() - * entityBatHurt() - * entityBatLoop() - * entityBatTakeoff() - * entityBlazeAmbient() - * entityBlazeBurn() - * entityBlazeDeath() - * entityBlazeHurt() - * entityBlazeShoot() - * entityBoatPaddleLand() - * entityBoatPaddleWater() - * entityCatAmbient() - * entityCatDeath() - * entityCatHiss() - * entityCatHurt() - * entityCatPurr() - * entityCatPurreow() - * entityChickenAmbient() - * entityChickenDeath() - * entityChickenEgg() - * entityChickenHurt() - * entityChickenStep() - * entityCodAmbient() - * entityCodDeath() - * entityCodFlop() - * entityCodHurt() - * entityCowAmbient() - * entityCowDeath() - * entityCowHurt() - * entityCowMilk() - * entityCowStep() - * entityCreeperDeath() - * entityCreeperHurt() - * entityCreeperPrimed() - * entityDolphinAmbient() - * entityDolphinAmbientWater() - * entityDolphinAttack() - * entityDolphinDeath() - * entityDolphinEat() - * entityDolphinHurt() - * entityDolphinJump() - * entityDolphinPlay() - * entityDolphinSplash() - * entityDolphinSwim() - * entityDonkeyAmbient() - * entityDonkeyAngry() - * entityDonkeyChest() - * entityDonkeyDeath() - * entityDonkeyHurt() - * entityDragonFireballExplode() - * entityDrownedAmbient() - * entityDrownedAmbientWater() - * entityDrownedDeath() - * entityDrownedDeathWater() - * entityDrownedHurt() - * entityDrownedHurtWater() - * entityDrownedShoot() - * entityDrownedStep() - * entityDrownedSwim() - * entityEggThrow() - * entityElderGuardianAmbient() - * entityElderGuardianAmbientLand() - * entityElderGuardianCurse() - * entityElderGuardianDeath() - * entityElderGuardianDeathLand() - * entityElderGuardianFlop() - * entityElderGuardianHurt() - * entityElderGuardianHurtLand() - * entityEnderDragonAmbient() - * entityEnderDragonDeath() - * entityEnderDragonFlap() - * entityEnderDragonGrowl() - * entityEnderDragonHurt() - * entityEnderDragonShoot() - * entityEnderEyeDeath() - * entityEnderEyeLaunch() - * entityEnderPearlThrow() - * entityEndermanAmbient() - * entityEndermanDeath() - * entityEndermanHurt() - * entityEndermanScream() - * entityEndermanStare() - * entityEndermanTeleport() - * entityEndermiteAmbient() - * entityEndermiteDeath() - * entityEndermiteHurt() - * entityEndermiteStep() - * entityEvokerAmbient() - * entityEvokerCastSpell() - * entityEvokerDeath() - * entityEvokerFangsAttack() - * entityEvokerHurt() - * entityEvokerPrepareAttack() - * entityEvokerPrepareSummon() - * entityEvokerPrepareWololo() - * entityExperienceBottleThrow() - * entityExperienceOrbPickup() - * entityFireworkRocketBlast() - * entityFireworkRocketBlastFar() - * entityFireworkRocketLargeBlast() - * entityFireworkRocketLargeBlastFar() - * entityFireworkRocketLaunch() - * entityFireworkRocketShoot() - * entityFireworkRocketTwinkle() - * entityFireworkRocketTwinkleFar() - * entityFishSwim() - * entityFishingBobberRetrieve() - * entityFishingBobberSplash() - * entityFishingBobberThrow() - * entityGenericBigFall() - * entityGenericBurn() - * entityGenericDeath() - * entityGenericDrink() - * entityGenericEat() - * entityGenericExplode() - * entityGenericExtinguishFire() - * entityGenericHurt() - * entityGenericSmallFall() - * entityGenericSplash() - * entityGenericSwim() - * entityGhastAmbient() - * entityGhastDeath() - * entityGhastHurt() - * entityGhastScream() - * entityGhastShoot() - * entityGhastWarn() - * entityGuardianAmbient() - * entityGuardianAmbientLand() - * entityGuardianAttack() - * entityGuardianDeath() - * entityGuardianDeathLand() - * entityGuardianFlop() - * entityGuardianHurt() - * entityGuardianHurtLand() - * entityHorseAmbient() - * entityHorseAngry() - * entityHorseArmor() - * entityHorseBreathe() - * entityHorseDeath() - * entityHorseEat() - * entityHorseGallop() - * entityHorseHurt() - * entityHorseJump() - * entityHorseLand() - * entityHorseSaddle() - * entityHorseStep() - * entityHorseStepWood() - * entityHostileBigFall() - * entityHostileDeath() - * entityHostileHurt() - * entityHostileSmallFall() - * entityHostileSplash() - * entityHostileSwim() - * entityHuskAmbient() - * entityHuskConvertedToZombie() - * entityHuskDeath() - * entityHuskHurt() - * entityHuskStep() - * entityIllusionerAmbient() - * entityIllusionerCastSpell() - * entityIllusionerDeath() - * entityIllusionerHurt() - * entityIllusionerMirrorMove() - * entityIllusionerPrepareBlindness() - * entityIllusionerPrepareMirror() - * entityIronGolemAttack() - * entityIronGolemDeath() - * entityIronGolemHurt() - * entityIronGolemStep() - * entityItemBreak() - * entityItemFrameAddItem() - * entityItemFrameBreak() - * entityItemFramePlace() - * entityItemFrameRemoveItem() - * entityItemFrameRotateItem() - * entityItemPickup() - * entityLeashKnotBreak() - * entityLeashKnotPlace() - * entityLightningBoltImpact() - * entityLightningBoltThunder() - * entityLingeringPotionThrow() - * entityLlamaAmbient() - * entityLlamaAngry() - * entityLlamaChest() - * entityLlamaDeath() - * entityLlamaEat() - * entityLlamaHurt() - * entityLlamaSpit() - * entityLlamaStep() - * entityLlamaSwag() - * entityMagmaCubeDeath() - * entityMagmaCubeDeathSmall() - * entityMagmaCubeHurt() - * entityMagmaCubeHurtSmall() - * entityMagmaCubeJump() - * entityMagmaCubeSquish() - * entityMagmaCubeSquishSmall() - * entityMinecartInside() - * entityMinecartRiding() - * entityMooshroomShear() - * entityMuleAmbient() - * entityMuleChest() - * entityMuleDeath() - * entityMuleHurt() - * entityPaintingBreak() - * entityPaintingPlace() - * entityParrotAmbient() - * entityParrotDeath() - * entityParrotEat() - * entityParrotFly() - * entityParrotHurt() - * entityParrotImitateBlaze() - * entityParrotImitateCreeper() - * entityParrotImitateDrowned() - * entityParrotImitateElderGuardian() - * entityParrotImitateEnderDragon() - * entityParrotImitateEnderman() - * entityParrotImitateEndermite() - * entityParrotImitateEvoker() - * entityParrotImitateGhast() - * entityParrotImitateHusk() - * entityParrotImitateIllusioner() - * entityParrotImitateMagmaCube() - * entityParrotImitatePhantom() - * entityParrotImitatePolarBear() - * entityParrotImitateShulker() - * entityParrotImitateSilverfish() - * entityParrotImitateSkeleton() - * entityParrotImitateSlime() - * entityParrotImitateSpider() - * entityParrotImitateStray() - * entityParrotImitateVex() - * entityParrotImitateVindicator() - * entityParrotImitateWitch() - * entityParrotImitateWither() - * entityParrotImitateWitherSkeleton() - * entityParrotImitateWolf() - * entityParrotImitateZombie() - * entityParrotImitateZombiePigman() - * entityParrotImitateZombieVillager() - * entityParrotStep() - * entityPhantomAmbient() - * entityPhantomBite() - * entityPhantomDeath() - * entityPhantomFlap() - * entityPhantomHurt() - * entityPhantomSwoop() - * entityPigAmbient() - * entityPigDeath() - * entityPigHurt() - * entityPigSaddle() - * entityPigStep() - * entityPlayerAttackCrit() - * entityPlayerAttackKnockback() - * entityPlayerAttackNodamage() - * entityPlayerAttackStrong() - * entityPlayerAttackSweep() - * entityPlayerAttackWeak() - * entityPlayerBigFall() - * entityPlayerBreath() - * entityPlayerBurp() - * entityPlayerDeath() - * entityPlayerHurt() - * entityPlayerHurtDrown() - * entityPlayerHurtOnFire() - * entityPlayerLevelup() - * entityPlayerSmallFall() - * entityPlayerSplash() - * entityPlayerSplashHighSpeed() - * entityPlayerSwim() - * entityPolarBearAmbient() - * entityPolarBearAmbientBaby() - * entityPolarBearDeath() - * entityPolarBearHurt() - * entityPolarBearStep() - * entityPolarBearWarning() - * entityPufferFishAmbient() - * entityPufferFishBlowOut() - * entityPufferFishBlowUp() - * entityPufferFishDeath() - * entityPufferFishFlop() - * entityPufferFishHurt() - * entityPufferFishSting() - * entityRabbitAmbient() - * entityRabbitAttack() - * entityRabbitDeath() - * entityRabbitHurt() - * entityRabbitJump() - * entitySalmonAmbient() - * entitySalmonDeath() - * entitySalmonFlop() - * entitySalmonHurt() - * entitySheepAmbient() - * entitySheepDeath() - * entitySheepHurt() - * entitySheepShear() - * entitySheepStep() - * entityShulkerAmbient() - * entityShulkerBulletHit() - * entityShulkerBulletHurt() - * entityShulkerClose() - * entityShulkerDeath() - * entityShulkerHurt() - * entityShulkerHurtClosed() - * entityShulkerOpen() - * entityShulkerShoot() - * entityShulkerTeleport() - * entitySilverfishAmbient() - * entitySilverfishDeath() - * entitySilverfishHurt() - * entitySilverfishStep() - * entitySkeletonAmbient() - * entitySkeletonDeath() - * entitySkeletonHorseAmbient() - * entitySkeletonHorseAmbientWater() - * entitySkeletonHorseDeath() - * entitySkeletonHorseGallopWater() - * entitySkeletonHorseHurt() - * entitySkeletonHorseJumpWater() - * entitySkeletonHorseStepWater() - * entitySkeletonHorseSwim() - * entitySkeletonHurt() - * entitySkeletonShoot() - * entitySkeletonStep() - * entitySlimeAttack() - * entitySlimeDeath() - * entitySlimeDeathSmall() - * entitySlimeHurt() - * entitySlimeHurtSmall() - * entitySlimeJump() - * entitySlimeJumpSmall() - * entitySlimeSquish() - * entitySlimeSquishSmall() - * entitySnowGolemAmbient() - * entitySnowGolemDeath() - * entitySnowGolemHurt() - * entitySnowGolemShoot() - * entitySnowballThrow() - * entitySpiderAmbient() - * entitySpiderDeath() - * entitySpiderHurt() - * entitySpiderStep() - * entitySplashPotionBreak() - * entitySplashPotionThrow() - * entitySquidAmbient() - * entitySquidDeath() - * entitySquidHurt() - * entitySquidSquirt() - * entityStrayAmbient() - * entityStrayDeath() - * entityStrayHurt() - * entityStrayStep() - * entityTntPrimed() - * entityTropicalFishAmbient() - * entityTropicalFishDeath() - * entityTropicalFishFlop() - * entityTropicalFishHurt() - * entityTurtleAmbientLand() - * entityTurtleDeath() - * entityTurtleDeathBaby() - * entityTurtleEggBreak() - * entityTurtleEggCrack() - * entityTurtleEggHatch() - * entityTurtleHurt() - * entityTurtleHurtBaby() - * entityTurtleLayEgg() - * entityTurtleShamble() - * entityTurtleShambleBaby() - * entityTurtleSwim() - * entityVexAmbient() - * entityVexCharge() - * entityVexDeath() - * entityVexHurt() - * entityVillagerAmbient() - * entityVillagerDeath() - * entityVillagerHurt() - * entityVillagerNo() - * entityVillagerTrade() - * entityVillagerYes() - * entityVindicatorAmbient() - * entityVindicatorDeath() - * entityVindicatorHurt() - * entityWitchAmbient() - * entityWitchDeath() - * entityWitchDrink() - * entityWitchHurt() - * entityWitchThrow() - * entityWitherAmbient() - * entityWitherBreakBlock() - * entityWitherDeath() - * entityWitherHurt() - * entityWitherShoot() - * entityWitherSkeletonAmbient() - * entityWitherSkeletonDeath() - * entityWitherSkeletonHurt() - * entityWitherSkeletonStep() - * entityWitherSpawn() - * entityWolfAmbient() - * entityWolfDeath() - * entityWolfGrowl() - * entityWolfHowl() - * entityWolfHurt() - * entityWolfPant() - * entityWolfShake() - * entityWolfStep() - * entityWolfWhine() - * entityZombieAmbient() - * entityZombieAttackIronDoor() - * entityZombieAttackWoodenDoor() - * entityZombieBreakWoodenDoor() - * entityZombieConvertedToDrowned() - * entityZombieDeath() - * entityZombieDestroyEgg() - * entityZombieHorseAmbient() - * entityZombieHorseDeath() - * entityZombieHorseHurt() - * entityZombieHurt() - * entityZombieInfect() - * entityZombiePigmanAmbient() - * entityZombiePigmanAngry() - * entityZombiePigmanDeath() - * entityZombiePigmanHurt() - * entityZombieStep() - * entityZombieVillagerAmbient() - * entityZombieVillagerConverted() - * entityZombieVillagerCure() - * entityZombieVillagerDeath() - * entityZombieVillagerHurt() - * entityZombieVillagerStep() - * itemArmorEquipChain() - * itemArmorEquipDiamond() - * itemArmorEquipElytra() - * itemArmorEquipGeneric() - * itemArmorEquipGold() - * itemArmorEquipIron() - * itemArmorEquipLeather() - * itemArmorEquipTurtle() - * itemAxeStrip() - * itemBottleEmpty() - * itemBottleFill() - * itemBottleFillDragonbreath() - * itemBucketEmpty() - * itemBucketEmptyFish() - * itemBucketEmptyLava() - * itemBucketFill() - * itemBucketFillFish() - * itemBucketFillLava() - * itemChorusFruitTeleport() - * itemElytraFlying() - * itemFirechargeUse() - * itemFlintandsteelUse() - * itemHoeTill() - * itemShieldBlock() - * itemShieldBreak() - * itemShovelFlatten() - * itemTotemUse() - * itemTridentHit() - * itemTridentHitGround() - * itemTridentReturn() - * itemTridentRiptide1() - * itemTridentRiptide2() - * itemTridentRiptide3() - * itemTridentThrow() - * itemTridentThunder() - * musicCreative() - * musicCredits() - * musicDisc11() - * musicDisc13() - * musicDiscBlocks() - * musicDiscCat() - * musicDiscChirp() - * musicDiscFar() - * musicDiscMall() - * musicDiscMellohi() - * musicDiscStal() - * musicDiscStrad() - * musicDiscWait() - * musicDiscWard() - * musicDragon() - * musicEnd() - * musicGame() - * musicMenu() - * musicNether() - * musicUnderWater() - * uiButtonClick() - * uiToastChallengeComplete() - * uiToastIn() - * uiToastOut() - * weatherRain() - * weatherRainAbove() - - -## Entities module -The Entities module provides a suite of functions - one for each possible entity type. -It acts as a helper or enumerated module to assist in use with the `spawn` module and command. -This module is useful for TAB-completion at the in-game prompt. - -When each function is called with no parameters, it will return the appropriate EntityType object. -For example `entities.polar_bear()` will return an `EntityType.POLAR_BEAR` object. - -When each function is called with a single parameter - an entity - the entity's type will be compared and return true or false. - -### Usage - - entities.zombie(); // returns a SpigotMC/CanaryMod EntityType.ZOMBIE enum value - entities.zombie( mob ); // compares the entity's type to a zombie, returns true if mob type is zombie, false otherwise - entities.player( self ); // at the in-game prompt this should return true (compares self to a player entity type) - entities.rabbit( self ); // at the in-game prompt this should return false (compares self to a rabbit entity type) - -The following functions are provided: - - * area_effect_cloud() - * armor_stand() - * arrow() - * bat() - * blaze() - * boat() - * cave_spider() - * chicken() - * cod() - * complex_part() - * cow() - * creeper() - * dolphin() - * donkey() - * dragon_fireball() - * dropped_item() - * drowned() - * egg() - * elder_guardian() - * ender_crystal() - * ender_dragon() - * ender_pearl() - * ender_signal() - * enderman() - * endermite() - * evoker() - * evoker_fangs() - * experience_orb() - * falling_block() - * fireball() - * firework() - * fishing_hook() - * ghast() - * giant() - * guardian() - * horse() - * husk() - * illusioner() - * iron_golem() - * item_frame() - * leash_hitch() - * lightning() - * lingering_potion() - * llama() - * llama_spit() - * magma_cube() - * minecart() - * minecart_chest() - * minecart_command() - * minecart_furnace() - * minecart_hopper() - * minecart_mob_spawner() - * minecart_tnt() - * mule() - * mushroom_cow() - * ocelot() - * painting() - * parrot() - * phantom() - * pig() - * pig_zombie() - * player() - * polar_bear() - * primed_tnt() - * pufferfish() - * rabbit() - * salmon() - * sheep() - * shulker() - * shulker_bullet() - * silverfish() - * skeleton() - * skeleton_horse() - * slime() - * small_fireball() - * snowball() - * snowman() - * spectral_arrow() - * spider() - * splash_potion() - * squid() - * stray() - * thrown_exp_bottle() - * tipped_arrow() - * trident() - * tropical_fish() - * turtle() - * unknown() - * vex() - * villager() - * vindicator() - * weather() - * witch() - * wither() - * wither_skeleton() - * wither_skull() - * wolf() - * zombie() - * zombie_horse() - * zombie_villager() - +## Table of Contents + * [Items module (SpigotMC version)](#items-module-spigotmc-version) + * [Usage](#usage) + * [Sounds module (SpigotMC version)](#sounds-module-spigotmc-version) + * [Usage](#usage-1) + * [Entities module](#entities-module) + * [Usage](#usage-2) + +## Items module (SpigotMC version) +The Items module provides a suite of functions - one for each possible item. +See https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html for a list of possible items + +### Usage + + items.book(); // returns org.bukkit.Material.BOOK + items.book(2); // returns a new org.bukkit.inventory.ItemStack object of 2 books + items.book( itemType ); // compares itemType parameter to org.bukkit.Material.BOOK or an Item of type book + +The following functions are provided: + + * acaciaBoat() + * acaciaButton() + * acaciaDoor() + * acaciaFence() + * acaciaFenceGate() + * acaciaLeaves() + * acaciaLog() + * acaciaPlanks() + * acaciaPressurePlate() + * acaciaSapling() + * acaciaSlab() + * acaciaStairs() + * acaciaTrapdoor() + * acaciaWood() + * activatorRail() + * air() + * allium() + * andesite() + * anvil() + * apple() + * armorStand() + * arrow() + * attachedMelonStem() + * attachedPumpkinStem() + * azureBluet() + * bakedPotato() + * barrier() + * batSpawnEgg() + * beacon() + * bedrock() + * beef() + * beetroot() + * beetrootSeeds() + * beetrootSoup() + * beetroots() + * birchBoat() + * birchButton() + * birchDoor() + * birchFence() + * birchFenceGate() + * birchLeaves() + * birchLog() + * birchPlanks() + * birchPressurePlate() + * birchSapling() + * birchSlab() + * birchStairs() + * birchTrapdoor() + * birchWood() + * blackBanner() + * blackBed() + * blackCarpet() + * blackConcrete() + * blackConcretePowder() + * blackGlazedTerracotta() + * blackShulkerBox() + * blackStainedGlass() + * blackStainedGlassPane() + * blackTerracotta() + * blackWallBanner() + * blackWool() + * blazePowder() + * blazeRod() + * blazeSpawnEgg() + * blueBanner() + * blueBed() + * blueCarpet() + * blueConcrete() + * blueConcretePowder() + * blueGlazedTerracotta() + * blueIce() + * blueOrchid() + * blueShulkerBox() + * blueStainedGlass() + * blueStainedGlassPane() + * blueTerracotta() + * blueWallBanner() + * blueWool() + * bone() + * boneBlock() + * boneMeal() + * book() + * bookshelf() + * bow() + * bowl() + * brainCoral() + * brainCoralBlock() + * brainCoralFan() + * brainCoralWallFan() + * bread() + * brewingStand() + * brick() + * brickSlab() + * brickStairs() + * bricks() + * brownBanner() + * brownBed() + * brownCarpet() + * brownConcrete() + * brownConcretePowder() + * brownGlazedTerracotta() + * brownMushroom() + * brownMushroomBlock() + * brownShulkerBox() + * brownStainedGlass() + * brownStainedGlassPane() + * brownTerracotta() + * brownWallBanner() + * brownWool() + * bubbleColumn() + * bubbleCoral() + * bubbleCoralBlock() + * bubbleCoralFan() + * bubbleCoralWallFan() + * bucket() + * cactus() + * cactusGreen() + * cake() + * carrot() + * carrotOnAStick() + * carrots() + * carvedPumpkin() + * cauldron() + * caveAir() + * caveSpiderSpawnEgg() + * chainCommandBlock() + * chainmailBoots() + * chainmailChestplate() + * chainmailHelmet() + * chainmailLeggings() + * charcoal() + * chest() + * chestMinecart() + * chicken() + * chickenSpawnEgg() + * chippedAnvil() + * chiseledQuartzBlock() + * chiseledRedSandstone() + * chiseledSandstone() + * chiseledStoneBricks() + * chorusFlower() + * chorusFruit() + * chorusPlant() + * clay() + * clayBall() + * clock() + * coal() + * coalBlock() + * coalOre() + * coarseDirt() + * cobblestone() + * cobblestoneSlab() + * cobblestoneStairs() + * cobblestoneWall() + * cobweb() + * cocoa() + * cocoaBeans() + * cod() + * codBucket() + * codSpawnEgg() + * commandBlock() + * commandBlockMinecart() + * comparator() + * compass() + * conduit() + * cookedBeef() + * cookedChicken() + * cookedCod() + * cookedMutton() + * cookedPorkchop() + * cookedRabbit() + * cookedSalmon() + * cookie() + * cowSpawnEgg() + * crackedStoneBricks() + * craftingTable() + * creeperHead() + * creeperSpawnEgg() + * creeperWallHead() + * cutRedSandstone() + * cutSandstone() + * cyanBanner() + * cyanBed() + * cyanCarpet() + * cyanConcrete() + * cyanConcretePowder() + * cyanDye() + * cyanGlazedTerracotta() + * cyanShulkerBox() + * cyanStainedGlass() + * cyanStainedGlassPane() + * cyanTerracotta() + * cyanWallBanner() + * cyanWool() + * damagedAnvil() + * dandelion() + * dandelionYellow() + * darkOakBoat() + * darkOakButton() + * darkOakDoor() + * darkOakFence() + * darkOakFenceGate() + * darkOakLeaves() + * darkOakLog() + * darkOakPlanks() + * darkOakPressurePlate() + * darkOakSapling() + * darkOakSlab() + * darkOakStairs() + * darkOakTrapdoor() + * darkOakWood() + * darkPrismarine() + * darkPrismarineSlab() + * darkPrismarineStairs() + * daylightDetector() + * deadBrainCoral() + * deadBrainCoralBlock() + * deadBrainCoralFan() + * deadBrainCoralWallFan() + * deadBubbleCoral() + * deadBubbleCoralBlock() + * deadBubbleCoralFan() + * deadBubbleCoralWallFan() + * deadBush() + * deadFireCoral() + * deadFireCoralBlock() + * deadFireCoralFan() + * deadFireCoralWallFan() + * deadHornCoral() + * deadHornCoralBlock() + * deadHornCoralFan() + * deadHornCoralWallFan() + * deadTubeCoral() + * deadTubeCoralBlock() + * deadTubeCoralFan() + * deadTubeCoralWallFan() + * debugStick() + * detectorRail() + * diamond() + * diamondAxe() + * diamondBlock() + * diamondBoots() + * diamondChestplate() + * diamondHelmet() + * diamondHoe() + * diamondHorseArmor() + * diamondLeggings() + * diamondOre() + * diamondPickaxe() + * diamondShovel() + * diamondSword() + * diorite() + * dirt() + * dispenser() + * dolphinSpawnEgg() + * donkeySpawnEgg() + * dragonBreath() + * dragonEgg() + * dragonHead() + * dragonWallHead() + * driedKelp() + * driedKelpBlock() + * dropper() + * drownedSpawnEgg() + * egg() + * elderGuardianSpawnEgg() + * elytra() + * emerald() + * emeraldBlock() + * emeraldOre() + * enchantedBook() + * enchantedGoldenApple() + * enchantingTable() + * endCrystal() + * endGateway() + * endPortal() + * endPortalFrame() + * endRod() + * endStone() + * endStoneBricks() + * enderChest() + * enderEye() + * enderPearl() + * endermanSpawnEgg() + * endermiteSpawnEgg() + * evokerSpawnEgg() + * experienceBottle() + * farmland() + * feather() + * fermentedSpiderEye() + * fern() + * filledMap() + * fire() + * fireCharge() + * fireCoral() + * fireCoralBlock() + * fireCoralFan() + * fireCoralWallFan() + * fireworkRocket() + * fireworkStar() + * fishingRod() + * flint() + * flintAndSteel() + * flowerPot() + * frostedIce() + * furnace() + * furnaceMinecart() + * ghastSpawnEgg() + * ghastTear() + * glass() + * glassBottle() + * glassPane() + * glisteringMelonSlice() + * glowstone() + * glowstoneDust() + * goldBlock() + * goldIngot() + * goldNugget() + * goldOre() + * goldenApple() + * goldenAxe() + * goldenBoots() + * goldenCarrot() + * goldenChestplate() + * goldenHelmet() + * goldenHoe() + * goldenHorseArmor() + * goldenLeggings() + * goldenPickaxe() + * goldenShovel() + * goldenSword() + * granite() + * grass() + * grassBlock() + * grassPath() + * gravel() + * grayBanner() + * grayBed() + * grayCarpet() + * grayConcrete() + * grayConcretePowder() + * grayDye() + * grayGlazedTerracotta() + * grayShulkerBox() + * grayStainedGlass() + * grayStainedGlassPane() + * grayTerracotta() + * grayWallBanner() + * grayWool() + * greenBanner() + * greenBed() + * greenCarpet() + * greenConcrete() + * greenConcretePowder() + * greenGlazedTerracotta() + * greenShulkerBox() + * greenStainedGlass() + * greenStainedGlassPane() + * greenTerracotta() + * greenWallBanner() + * greenWool() + * guardianSpawnEgg() + * gunpowder() + * hayBlock() + * heartOfTheSea() + * heavyWeightedPressurePlate() + * hopper() + * hopperMinecart() + * hornCoral() + * hornCoralBlock() + * hornCoralFan() + * hornCoralWallFan() + * horseSpawnEgg() + * huskSpawnEgg() + * ice() + * infestedChiseledStoneBricks() + * infestedCobblestone() + * infestedCrackedStoneBricks() + * infestedMossyStoneBricks() + * infestedStone() + * infestedStoneBricks() + * inkSac() + * ironAxe() + * ironBars() + * ironBlock() + * ironBoots() + * ironChestplate() + * ironDoor() + * ironHelmet() + * ironHoe() + * ironHorseArmor() + * ironIngot() + * ironLeggings() + * ironNugget() + * ironOre() + * ironPickaxe() + * ironShovel() + * ironSword() + * ironTrapdoor() + * itemFrame() + * jackOLantern() + * jukebox() + * jungleBoat() + * jungleButton() + * jungleDoor() + * jungleFence() + * jungleFenceGate() + * jungleLeaves() + * jungleLog() + * junglePlanks() + * junglePressurePlate() + * jungleSapling() + * jungleSlab() + * jungleStairs() + * jungleTrapdoor() + * jungleWood() + * kelp() + * kelpPlant() + * knowledgeBook() + * ladder() + * lapisBlock() + * lapisLazuli() + * lapisOre() + * largeFern() + * lava() + * lavaBucket() + * lead() + * leather() + * leatherBoots() + * leatherChestplate() + * leatherHelmet() + * leatherLeggings() + * legacyAcaciaDoor() + * legacyAcaciaDoorItem() + * legacyAcaciaFence() + * legacyAcaciaFenceGate() + * legacyAcaciaStairs() + * legacyActivatorRail() + * legacyAir() + * legacyAnvil() + * legacyApple() + * legacyArmorStand() + * legacyArrow() + * legacyBakedPotato() + * legacyBanner() + * legacyBarrier() + * legacyBeacon() + * legacyBed() + * legacyBedBlock() + * legacyBedrock() + * legacyBeetroot() + * legacyBeetrootBlock() + * legacyBeetrootSeeds() + * legacyBeetrootSoup() + * legacyBirchDoor() + * legacyBirchDoorItem() + * legacyBirchFence() + * legacyBirchFenceGate() + * legacyBirchWoodStairs() + * legacyBlackGlazedTerracotta() + * legacyBlackShulkerBox() + * legacyBlazePowder() + * legacyBlazeRod() + * legacyBlueGlazedTerracotta() + * legacyBlueShulkerBox() + * legacyBoat() + * legacyBoatAcacia() + * legacyBoatBirch() + * legacyBoatDarkOak() + * legacyBoatJungle() + * legacyBoatSpruce() + * legacyBone() + * legacyBoneBlock() + * legacyBook() + * legacyBookAndQuill() + * legacyBookshelf() + * legacyBow() + * legacyBowl() + * legacyBread() + * legacyBrewingStand() + * legacyBrewingStandItem() + * legacyBrick() + * legacyBrickStairs() + * legacyBrownGlazedTerracotta() + * legacyBrownMushroom() + * legacyBrownShulkerBox() + * legacyBucket() + * legacyBurningFurnace() + * legacyCactus() + * legacyCake() + * legacyCakeBlock() + * legacyCarpet() + * legacyCarrot() + * legacyCarrotItem() + * legacyCarrotStick() + * legacyCauldron() + * legacyCauldronItem() + * legacyChainmailBoots() + * legacyChainmailChestplate() + * legacyChainmailHelmet() + * legacyChainmailLeggings() + * legacyChest() + * legacyChorusFlower() + * legacyChorusFruit() + * legacyChorusFruitPopped() + * legacyChorusPlant() + * legacyClay() + * legacyClayBall() + * legacyClayBrick() + * legacyCoal() + * legacyCoalBlock() + * legacyCoalOre() + * legacyCobbleWall() + * legacyCobblestone() + * legacyCobblestoneStairs() + * legacyCocoa() + * legacyCommand() + * legacyCommandChain() + * legacyCommandMinecart() + * legacyCommandRepeating() + * legacyCompass() + * legacyConcrete() + * legacyConcretePowder() + * legacyCookedBeef() + * legacyCookedChicken() + * legacyCookedFish() + * legacyCookedMutton() + * legacyCookedRabbit() + * legacyCookie() + * legacyCrops() + * legacyCyanGlazedTerracotta() + * legacyCyanShulkerBox() + * legacyDarkOakDoor() + * legacyDarkOakDoorItem() + * legacyDarkOakFence() + * legacyDarkOakFenceGate() + * legacyDarkOakStairs() + * legacyDaylightDetector() + * legacyDaylightDetectorInverted() + * legacyDeadBush() + * legacyDetectorRail() + * legacyDiamond() + * legacyDiamondAxe() + * legacyDiamondBarding() + * legacyDiamondBlock() + * legacyDiamondBoots() + * legacyDiamondChestplate() + * legacyDiamondHelmet() + * legacyDiamondHoe() + * legacyDiamondLeggings() + * legacyDiamondOre() + * legacyDiamondPickaxe() + * legacyDiamondSpade() + * legacyDiamondSword() + * legacyDiode() + * legacyDiodeBlockOff() + * legacyDiodeBlockOn() + * legacyDirt() + * legacyDispenser() + * legacyDoublePlant() + * legacyDoubleStep() + * legacyDoubleStoneSlab2() + * legacyDragonEgg() + * legacyDragonsBreath() + * legacyDropper() + * legacyEgg() + * legacyElytra() + * legacyEmerald() + * legacyEmeraldBlock() + * legacyEmeraldOre() + * legacyEmptyMap() + * legacyEnchantedBook() + * legacyEnchantmentTable() + * legacyEndBricks() + * legacyEndCrystal() + * legacyEndGateway() + * legacyEndRod() + * legacyEnderChest() + * legacyEnderPearl() + * legacyEnderPortal() + * legacyEnderPortalFrame() + * legacyEnderStone() + * legacyExpBottle() + * legacyExplosiveMinecart() + * legacyEyeOfEnder() + * legacyFeather() + * legacyFence() + * legacyFenceGate() + * legacyFermentedSpiderEye() + * legacyFire() + * legacyFireball() + * legacyFirework() + * legacyFireworkCharge() + * legacyFishingRod() + * legacyFlint() + * legacyFlintAndSteel() + * legacyFlowerPot() + * legacyFlowerPotItem() + * legacyFrostedIce() + * legacyFurnace() + * legacyGhastTear() + * legacyGlass() + * legacyGlassBottle() + * legacyGlowingRedstoneOre() + * legacyGlowstone() + * legacyGlowstoneDust() + * legacyGoldAxe() + * legacyGoldBarding() + * legacyGoldBlock() + * legacyGoldBoots() + * legacyGoldChestplate() + * legacyGoldHelmet() + * legacyGoldHoe() + * legacyGoldIngot() + * legacyGoldLeggings() + * legacyGoldNugget() + * legacyGoldOre() + * legacyGoldPickaxe() + * legacyGoldPlate() + * legacyGoldRecord() + * legacyGoldSpade() + * legacyGoldSword() + * legacyGoldenApple() + * legacyGoldenCarrot() + * legacyGrass() + * legacyGrassPath() + * legacyGravel() + * legacyGrayGlazedTerracotta() + * legacyGrayShulkerBox() + * legacyGreenGlazedTerracotta() + * legacyGreenRecord() + * legacyGreenShulkerBox() + * legacyGrilledPork() + * legacyHardClay() + * legacyHayBlock() + * legacyHopper() + * legacyHopperMinecart() + * legacyHugeMushroom1() + * legacyHugeMushroom2() + * legacyIce() + * legacyInkSack() + * legacyIronAxe() + * legacyIronBarding() + * legacyIronBlock() + * legacyIronBoots() + * legacyIronChestplate() + * legacyIronDoor() + * legacyIronDoorBlock() + * legacyIronFence() + * legacyIronHelmet() + * legacyIronHoe() + * legacyIronIngot() + * legacyIronLeggings() + * legacyIronNugget() + * legacyIronOre() + * legacyIronPickaxe() + * legacyIronPlate() + * legacyIronSpade() + * legacyIronSword() + * legacyIronTrapdoor() + * legacyItemFrame() + * legacyJackOLantern() + * legacyJukebox() + * legacyJungleDoor() + * legacyJungleDoorItem() + * legacyJungleFence() + * legacyJungleFenceGate() + * legacyJungleWoodStairs() + * legacyKnowledgeBook() + * legacyLadder() + * legacyLapisBlock() + * legacyLapisOre() + * legacyLava() + * legacyLavaBucket() + * legacyLeash() + * legacyLeather() + * legacyLeatherBoots() + * legacyLeatherChestplate() + * legacyLeatherHelmet() + * legacyLeatherLeggings() + * legacyLeaves() + * legacyLeaves2() + * legacyLever() + * legacyLightBlueGlazedTerracotta() + * legacyLightBlueShulkerBox() + * legacyLimeGlazedTerracotta() + * legacyLimeShulkerBox() + * legacyLingeringPotion() + * legacyLog() + * legacyLog2() + * legacyLongGrass() + * legacyMagentaGlazedTerracotta() + * legacyMagentaShulkerBox() + * legacyMagma() + * legacyMagmaCream() + * legacyMap() + * legacyMelon() + * legacyMelonBlock() + * legacyMelonSeeds() + * legacyMelonStem() + * legacyMilkBucket() + * legacyMinecart() + * legacyMobSpawner() + * legacyMonsterEgg() + * legacyMonsterEggs() + * legacyMossyCobblestone() + * legacyMushroomSoup() + * legacyMutton() + * legacyMycel() + * legacyNameTag() + * legacyNetherBrick() + * legacyNetherBrickItem() + * legacyNetherBrickStairs() + * legacyNetherFence() + * legacyNetherStalk() + * legacyNetherStar() + * legacyNetherWartBlock() + * legacyNetherWarts() + * legacyNetherrack() + * legacyNoteBlock() + * legacyObserver() + * legacyObsidian() + * legacyOrangeGlazedTerracotta() + * legacyOrangeShulkerBox() + * legacyPackedIce() + * legacyPainting() + * legacyPaper() + * legacyPinkGlazedTerracotta() + * legacyPinkShulkerBox() + * legacyPistonBase() + * legacyPistonExtension() + * legacyPistonMovingPiece() + * legacyPistonStickyBase() + * legacyPoisonousPotato() + * legacyPork() + * legacyPortal() + * legacyPotato() + * legacyPotatoItem() + * legacyPotion() + * legacyPoweredMinecart() + * legacyPoweredRail() + * legacyPrismarine() + * legacyPrismarineCrystals() + * legacyPrismarineShard() + * legacyPumpkin() + * legacyPumpkinPie() + * legacyPumpkinSeeds() + * legacyPumpkinStem() + * legacyPurpleGlazedTerracotta() + * legacyPurpleShulkerBox() + * legacyPurpurBlock() + * legacyPurpurDoubleSlab() + * legacyPurpurPillar() + * legacyPurpurSlab() + * legacyPurpurStairs() + * legacyQuartz() + * legacyQuartzBlock() + * legacyQuartzOre() + * legacyQuartzStairs() + * legacyRabbit() + * legacyRabbitFoot() + * legacyRabbitHide() + * legacyRabbitStew() + * legacyRails() + * legacyRawBeef() + * legacyRawChicken() + * legacyRawFish() + * legacyRecord10() + * legacyRecord11() + * legacyRecord12() + * legacyRecord3() + * legacyRecord4() + * legacyRecord5() + * legacyRecord6() + * legacyRecord7() + * legacyRecord8() + * legacyRecord9() + * legacyRedGlazedTerracotta() + * legacyRedMushroom() + * legacyRedNetherBrick() + * legacyRedRose() + * legacyRedSandstone() + * legacyRedSandstoneStairs() + * legacyRedShulkerBox() + * legacyRedstone() + * legacyRedstoneBlock() + * legacyRedstoneComparator() + * legacyRedstoneComparatorOff() + * legacyRedstoneComparatorOn() + * legacyRedstoneLampOff() + * legacyRedstoneLampOn() + * legacyRedstoneOre() + * legacyRedstoneTorchOff() + * legacyRedstoneTorchOn() + * legacyRedstoneWire() + * legacyRottenFlesh() + * legacySaddle() + * legacySand() + * legacySandstone() + * legacySandstoneStairs() + * legacySapling() + * legacySeaLantern() + * legacySeeds() + * legacyShears() + * legacyShield() + * legacyShulkerShell() + * legacySign() + * legacySignPost() + * legacySilverGlazedTerracotta() + * legacySilverShulkerBox() + * legacySkull() + * legacySkullItem() + * legacySlimeBall() + * legacySlimeBlock() + * legacySmoothBrick() + * legacySmoothStairs() + * legacySnow() + * legacySnowBall() + * legacySnowBlock() + * legacySoil() + * legacySoulSand() + * legacySpeckledMelon() + * legacySpectralArrow() + * legacySpiderEye() + * legacySplashPotion() + * legacySponge() + * legacySpruceDoor() + * legacySpruceDoorItem() + * legacySpruceFence() + * legacySpruceFenceGate() + * legacySpruceWoodStairs() + * legacyStainedClay() + * legacyStainedGlass() + * legacyStainedGlassPane() + * legacyStandingBanner() + * legacyStationaryLava() + * legacyStationaryWater() + * legacyStep() + * legacyStick() + * legacyStone() + * legacyStoneAxe() + * legacyStoneButton() + * legacyStoneHoe() + * legacyStonePickaxe() + * legacyStonePlate() + * legacyStoneSlab2() + * legacyStoneSpade() + * legacyStoneSword() + * legacyStorageMinecart() + * legacyString() + * legacyStructureBlock() + * legacyStructureVoid() + * legacySugar() + * legacySugarCane() + * legacySugarCaneBlock() + * legacySulphur() + * legacyThinGlass() + * legacyTippedArrow() + * legacyTnt() + * legacyTorch() + * legacyTotem() + * legacyTrapDoor() + * legacyTrappedChest() + * legacyTripwire() + * legacyTripwireHook() + * legacyVine() + * legacyWallBanner() + * legacyWallSign() + * legacyWatch() + * legacyWater() + * legacyWaterBucket() + * legacyWaterLily() + * legacyWeb() + * legacyWheat() + * legacyWhiteGlazedTerracotta() + * legacyWhiteShulkerBox() + * legacyWood() + * legacyWoodAxe() + * legacyWoodButton() + * legacyWoodDoor() + * legacyWoodDoubleStep() + * legacyWoodHoe() + * legacyWoodPickaxe() + * legacyWoodPlate() + * legacyWoodSpade() + * legacyWoodStairs() + * legacyWoodStep() + * legacyWoodSword() + * legacyWoodenDoor() + * legacyWool() + * legacyWorkbench() + * legacyWrittenBook() + * legacyYellowFlower() + * legacyYellowGlazedTerracotta() + * legacyYellowShulkerBox() + * lever() + * lightBlueBanner() + * lightBlueBed() + * lightBlueCarpet() + * lightBlueConcrete() + * lightBlueConcretePowder() + * lightBlueDye() + * lightBlueGlazedTerracotta() + * lightBlueShulkerBox() + * lightBlueStainedGlass() + * lightBlueStainedGlassPane() + * lightBlueTerracotta() + * lightBlueWallBanner() + * lightBlueWool() + * lightGrayBanner() + * lightGrayBed() + * lightGrayCarpet() + * lightGrayConcrete() + * lightGrayConcretePowder() + * lightGrayDye() + * lightGrayGlazedTerracotta() + * lightGrayShulkerBox() + * lightGrayStainedGlass() + * lightGrayStainedGlassPane() + * lightGrayTerracotta() + * lightGrayWallBanner() + * lightGrayWool() + * lightWeightedPressurePlate() + * lilac() + * lilyPad() + * limeBanner() + * limeBed() + * limeCarpet() + * limeConcrete() + * limeConcretePowder() + * limeDye() + * limeGlazedTerracotta() + * limeShulkerBox() + * limeStainedGlass() + * limeStainedGlassPane() + * limeTerracotta() + * limeWallBanner() + * limeWool() + * lingeringPotion() + * llamaSpawnEgg() + * magentaBanner() + * magentaBed() + * magentaCarpet() + * magentaConcrete() + * magentaConcretePowder() + * magentaDye() + * magentaGlazedTerracotta() + * magentaShulkerBox() + * magentaStainedGlass() + * magentaStainedGlassPane() + * magentaTerracotta() + * magentaWallBanner() + * magentaWool() + * magmaBlock() + * magmaCream() + * magmaCubeSpawnEgg() + * map() + * melon() + * melonSeeds() + * melonSlice() + * melonStem() + * milkBucket() + * minecart() + * mooshroomSpawnEgg() + * mossyCobblestone() + * mossyCobblestoneWall() + * mossyStoneBricks() + * movingPiston() + * muleSpawnEgg() + * mushroomStem() + * mushroomStew() + * musicDisc11() + * musicDisc13() + * musicDiscBlocks() + * musicDiscCat() + * musicDiscChirp() + * musicDiscFar() + * musicDiscMall() + * musicDiscMellohi() + * musicDiscStal() + * musicDiscStrad() + * musicDiscWait() + * musicDiscWard() + * mutton() + * mycelium() + * nameTag() + * nautilusShell() + * netherBrick() + * netherBrickFence() + * netherBrickSlab() + * netherBrickStairs() + * netherBricks() + * netherPortal() + * netherQuartzOre() + * netherStar() + * netherWart() + * netherWartBlock() + * netherrack() + * noteBlock() + * oakBoat() + * oakButton() + * oakDoor() + * oakFence() + * oakFenceGate() + * oakLeaves() + * oakLog() + * oakPlanks() + * oakPressurePlate() + * oakSapling() + * oakSlab() + * oakStairs() + * oakTrapdoor() + * oakWood() + * observer() + * obsidian() + * ocelotSpawnEgg() + * orangeBanner() + * orangeBed() + * orangeCarpet() + * orangeConcrete() + * orangeConcretePowder() + * orangeDye() + * orangeGlazedTerracotta() + * orangeShulkerBox() + * orangeStainedGlass() + * orangeStainedGlassPane() + * orangeTerracotta() + * orangeTulip() + * orangeWallBanner() + * orangeWool() + * oxeyeDaisy() + * packedIce() + * painting() + * paper() + * parrotSpawnEgg() + * peony() + * petrifiedOakSlab() + * phantomMembrane() + * phantomSpawnEgg() + * pigSpawnEgg() + * pinkBanner() + * pinkBed() + * pinkCarpet() + * pinkConcrete() + * pinkConcretePowder() + * pinkDye() + * pinkGlazedTerracotta() + * pinkShulkerBox() + * pinkStainedGlass() + * pinkStainedGlassPane() + * pinkTerracotta() + * pinkTulip() + * pinkWallBanner() + * pinkWool() + * piston() + * pistonHead() + * playerHead() + * playerWallHead() + * podzol() + * poisonousPotato() + * polarBearSpawnEgg() + * polishedAndesite() + * polishedDiorite() + * polishedGranite() + * poppedChorusFruit() + * poppy() + * porkchop() + * potato() + * potatoes() + * potion() + * pottedAcaciaSapling() + * pottedAllium() + * pottedAzureBluet() + * pottedBirchSapling() + * pottedBlueOrchid() + * pottedBrownMushroom() + * pottedCactus() + * pottedDandelion() + * pottedDarkOakSapling() + * pottedDeadBush() + * pottedFern() + * pottedJungleSapling() + * pottedOakSapling() + * pottedOrangeTulip() + * pottedOxeyeDaisy() + * pottedPinkTulip() + * pottedPoppy() + * pottedRedMushroom() + * pottedRedTulip() + * pottedSpruceSapling() + * pottedWhiteTulip() + * poweredRail() + * prismarine() + * prismarineBrickSlab() + * prismarineBrickStairs() + * prismarineBricks() + * prismarineCrystals() + * prismarineShard() + * prismarineSlab() + * prismarineStairs() + * pufferfish() + * pufferfishBucket() + * pufferfishSpawnEgg() + * pumpkin() + * pumpkinPie() + * pumpkinSeeds() + * pumpkinStem() + * purpleBanner() + * purpleBed() + * purpleCarpet() + * purpleConcrete() + * purpleConcretePowder() + * purpleDye() + * purpleGlazedTerracotta() + * purpleShulkerBox() + * purpleStainedGlass() + * purpleStainedGlassPane() + * purpleTerracotta() + * purpleWallBanner() + * purpleWool() + * purpurBlock() + * purpurPillar() + * purpurSlab() + * purpurStairs() + * quartz() + * quartzBlock() + * quartzPillar() + * quartzSlab() + * quartzStairs() + * rabbit() + * rabbitFoot() + * rabbitHide() + * rabbitSpawnEgg() + * rabbitStew() + * rail() + * redBanner() + * redBed() + * redCarpet() + * redConcrete() + * redConcretePowder() + * redGlazedTerracotta() + * redMushroom() + * redMushroomBlock() + * redNetherBricks() + * redSand() + * redSandstone() + * redSandstoneSlab() + * redSandstoneStairs() + * redShulkerBox() + * redStainedGlass() + * redStainedGlassPane() + * redTerracotta() + * redTulip() + * redWallBanner() + * redWool() + * redstone() + * redstoneBlock() + * redstoneLamp() + * redstoneOre() + * redstoneTorch() + * redstoneWallTorch() + * redstoneWire() + * repeater() + * repeatingCommandBlock() + * roseBush() + * roseRed() + * rottenFlesh() + * saddle() + * salmon() + * salmonBucket() + * salmonSpawnEgg() + * sand() + * sandstone() + * sandstoneSlab() + * sandstoneStairs() + * scute() + * seaLantern() + * seaPickle() + * seagrass() + * shears() + * sheepSpawnEgg() + * shield() + * shulkerBox() + * shulkerShell() + * shulkerSpawnEgg() + * sign() + * silverfishSpawnEgg() + * skeletonHorseSpawnEgg() + * skeletonSkull() + * skeletonSpawnEgg() + * skeletonWallSkull() + * slimeBall() + * slimeBlock() + * slimeSpawnEgg() + * smoothQuartz() + * smoothRedSandstone() + * smoothSandstone() + * smoothStone() + * snow() + * snowBlock() + * snowball() + * soulSand() + * spawner() + * spectralArrow() + * spiderEye() + * spiderSpawnEgg() + * splashPotion() + * sponge() + * spruceBoat() + * spruceButton() + * spruceDoor() + * spruceFence() + * spruceFenceGate() + * spruceLeaves() + * spruceLog() + * sprucePlanks() + * sprucePressurePlate() + * spruceSapling() + * spruceSlab() + * spruceStairs() + * spruceTrapdoor() + * spruceWood() + * squidSpawnEgg() + * stick() + * stickyPiston() + * stone() + * stoneAxe() + * stoneBrickSlab() + * stoneBrickStairs() + * stoneBricks() + * stoneButton() + * stoneHoe() + * stonePickaxe() + * stonePressurePlate() + * stoneShovel() + * stoneSlab() + * stoneSword() + * straySpawnEgg() + * string() + * strippedAcaciaLog() + * strippedAcaciaWood() + * strippedBirchLog() + * strippedBirchWood() + * strippedDarkOakLog() + * strippedDarkOakWood() + * strippedJungleLog() + * strippedJungleWood() + * strippedOakLog() + * strippedOakWood() + * strippedSpruceLog() + * strippedSpruceWood() + * structureBlock() + * structureVoid() + * sugar() + * sugarCane() + * sunflower() + * tallGrass() + * tallSeagrass() + * terracotta() + * tippedArrow() + * tnt() + * tntMinecart() + * torch() + * totemOfUndying() + * trappedChest() + * trident() + * tripwire() + * tripwireHook() + * tropicalFish() + * tropicalFishBucket() + * tropicalFishSpawnEgg() + * tubeCoral() + * tubeCoralBlock() + * tubeCoralFan() + * tubeCoralWallFan() + * turtleEgg() + * turtleHelmet() + * turtleSpawnEgg() + * vexSpawnEgg() + * villagerSpawnEgg() + * vindicatorSpawnEgg() + * vine() + * voidAir() + * wallSign() + * wallTorch() + * water() + * waterBucket() + * wetSponge() + * wheat() + * wheatSeeds() + * whiteBanner() + * whiteBed() + * whiteCarpet() + * whiteConcrete() + * whiteConcretePowder() + * whiteGlazedTerracotta() + * whiteShulkerBox() + * whiteStainedGlass() + * whiteStainedGlassPane() + * whiteTerracotta() + * whiteTulip() + * whiteWallBanner() + * whiteWool() + * witchSpawnEgg() + * witherSkeletonSkull() + * witherSkeletonSpawnEgg() + * witherSkeletonWallSkull() + * wolfSpawnEgg() + * woodenAxe() + * woodenHoe() + * woodenPickaxe() + * woodenShovel() + * woodenSword() + * writableBook() + * writtenBook() + * yellowBanner() + * yellowBed() + * yellowCarpet() + * yellowConcrete() + * yellowConcretePowder() + * yellowGlazedTerracotta() + * yellowShulkerBox() + * yellowStainedGlass() + * yellowStainedGlassPane() + * yellowTerracotta() + * yellowWallBanner() + * yellowWool() + * zombieHead() + * zombieHorseSpawnEgg() + * zombiePigmanSpawnEgg() + * zombieSpawnEgg() + * zombieVillagerSpawnEgg() + * zombieWallHead() + + +## Sounds module (SpigotMC version) + +This module provides a simple way to play sounds. + +### Usage + + var sounds = require("sounds"); + // plays ENTITY_WOLF_HOWL sound at full volume and medium pitch + sounds.play( org.bukkit.Sound.ENTITY_WOLF_HOWL, self, 1, 0); + // same as previous statement + sounds.play( org.bukkit.Sound.ENTITY_WOLF_HOWL , self ); + +The play() function takes as parameters: + + * A Sound value (see https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Sound.html for a list of possible values) + * A Location orbject or any object which has a location + * The Volume parameter is in the range 0 to 1 (default: 1) + * The Pitch parameter is in the range 0 to 4 (default: 0) + +In addition, the Sounds module provides a suite of helper functions - one for each possible sound. + + var sounds = require("sounds"); + // same as previous examples + sounds.entityWolfHowl( self ); + +Each of the following functions takes as parameters: + + * A Location orbject or any object which has a location + * The Volume parameter is in the range 0 to 1 (default: 1) + * The Pitch parameter is in the range 0 to 4 (default: 0) + +The following functions are provided for convenience and to help beginners explore sounds using TAB completion: + + * ambientCave() + * ambientUnderwaterEnter() + * ambientUnderwaterExit() + * ambientUnderwaterLoop() + * ambientUnderwaterLoopAdditions() + * ambientUnderwaterLoopAdditionsRare() + * ambientUnderwaterLoopAdditionsUltraRare() + * blockAnvilBreak() + * blockAnvilDestroy() + * blockAnvilFall() + * blockAnvilHit() + * blockAnvilLand() + * blockAnvilPlace() + * blockAnvilStep() + * blockAnvilUse() + * blockBeaconActivate() + * blockBeaconAmbient() + * blockBeaconDeactivate() + * blockBeaconPowerSelect() + * blockBrewingStandBrew() + * blockBubbleColumnBubblePop() + * blockBubbleColumnUpwardsAmbient() + * blockBubbleColumnUpwardsInside() + * blockBubbleColumnWhirlpoolAmbient() + * blockBubbleColumnWhirlpoolInside() + * blockChestClose() + * blockChestLocked() + * blockChestOpen() + * blockChorusFlowerDeath() + * blockChorusFlowerGrow() + * blockComparatorClick() + * blockConduitActivate() + * blockConduitAmbient() + * blockConduitAmbientShort() + * blockConduitAttackTarget() + * blockConduitDeactivate() + * blockCoralBlockBreak() + * blockCoralBlockFall() + * blockCoralBlockHit() + * blockCoralBlockPlace() + * blockCoralBlockStep() + * blockDispenserDispense() + * blockDispenserFail() + * blockDispenserLaunch() + * blockEnchantmentTableUse() + * blockEndGatewaySpawn() + * blockEndPortalFrameFill() + * blockEndPortalSpawn() + * blockEnderChestClose() + * blockEnderChestOpen() + * blockFenceGateClose() + * blockFenceGateOpen() + * blockFireAmbient() + * blockFireExtinguish() + * blockFurnaceFireCrackle() + * blockGlassBreak() + * blockGlassFall() + * blockGlassHit() + * blockGlassPlace() + * blockGlassStep() + * blockGrassBreak() + * blockGrassFall() + * blockGrassHit() + * blockGrassPlace() + * blockGrassStep() + * blockGravelBreak() + * blockGravelFall() + * blockGravelHit() + * blockGravelPlace() + * blockGravelStep() + * blockIronDoorClose() + * blockIronDoorOpen() + * blockIronTrapdoorClose() + * blockIronTrapdoorOpen() + * blockLadderBreak() + * blockLadderFall() + * blockLadderHit() + * blockLadderPlace() + * blockLadderStep() + * blockLavaAmbient() + * blockLavaExtinguish() + * blockLavaPop() + * blockLeverClick() + * blockLilyPadPlace() + * blockMetalBreak() + * blockMetalFall() + * blockMetalHit() + * blockMetalPlace() + * blockMetalPressurePlateClickOff() + * blockMetalPressurePlateClickOn() + * blockMetalStep() + * blockNoteBlockBasedrum() + * blockNoteBlockBass() + * blockNoteBlockBell() + * blockNoteBlockChime() + * blockNoteBlockFlute() + * blockNoteBlockGuitar() + * blockNoteBlockHarp() + * blockNoteBlockHat() + * blockNoteBlockPling() + * blockNoteBlockSnare() + * blockNoteBlockXylophone() + * blockPistonContract() + * blockPistonExtend() + * blockPortalAmbient() + * blockPortalTravel() + * blockPortalTrigger() + * blockPumpkinCarve() + * blockRedstoneTorchBurnout() + * blockSandBreak() + * blockSandFall() + * blockSandHit() + * blockSandPlace() + * blockSandStep() + * blockShulkerBoxClose() + * blockShulkerBoxOpen() + * blockSlimeBlockBreak() + * blockSlimeBlockFall() + * blockSlimeBlockHit() + * blockSlimeBlockPlace() + * blockSlimeBlockStep() + * blockSnowBreak() + * blockSnowFall() + * blockSnowHit() + * blockSnowPlace() + * blockSnowStep() + * blockStoneBreak() + * blockStoneButtonClickOff() + * blockStoneButtonClickOn() + * blockStoneFall() + * blockStoneHit() + * blockStonePlace() + * blockStonePressurePlateClickOff() + * blockStonePressurePlateClickOn() + * blockStoneStep() + * blockTripwireAttach() + * blockTripwireClickOff() + * blockTripwireClickOn() + * blockTripwireDetach() + * blockWaterAmbient() + * blockWetGrassBreak() + * blockWetGrassFall() + * blockWetGrassHit() + * blockWetGrassPlace() + * blockWetGrassStep() + * blockWoodBreak() + * blockWoodFall() + * blockWoodHit() + * blockWoodPlace() + * blockWoodStep() + * blockWoodenButtonClickOff() + * blockWoodenButtonClickOn() + * blockWoodenDoorClose() + * blockWoodenDoorOpen() + * blockWoodenPressurePlateClickOff() + * blockWoodenPressurePlateClickOn() + * blockWoodenTrapdoorClose() + * blockWoodenTrapdoorOpen() + * blockWoolBreak() + * blockWoolFall() + * blockWoolHit() + * blockWoolPlace() + * blockWoolStep() + * enchantThornsHit() + * entityArmorStandBreak() + * entityArmorStandFall() + * entityArmorStandHit() + * entityArmorStandPlace() + * entityArrowHit() + * entityArrowHitPlayer() + * entityArrowShoot() + * entityBatAmbient() + * entityBatDeath() + * entityBatHurt() + * entityBatLoop() + * entityBatTakeoff() + * entityBlazeAmbient() + * entityBlazeBurn() + * entityBlazeDeath() + * entityBlazeHurt() + * entityBlazeShoot() + * entityBoatPaddleLand() + * entityBoatPaddleWater() + * entityCatAmbient() + * entityCatDeath() + * entityCatHiss() + * entityCatHurt() + * entityCatPurr() + * entityCatPurreow() + * entityChickenAmbient() + * entityChickenDeath() + * entityChickenEgg() + * entityChickenHurt() + * entityChickenStep() + * entityCodAmbient() + * entityCodDeath() + * entityCodFlop() + * entityCodHurt() + * entityCowAmbient() + * entityCowDeath() + * entityCowHurt() + * entityCowMilk() + * entityCowStep() + * entityCreeperDeath() + * entityCreeperHurt() + * entityCreeperPrimed() + * entityDolphinAmbient() + * entityDolphinAmbientWater() + * entityDolphinAttack() + * entityDolphinDeath() + * entityDolphinEat() + * entityDolphinHurt() + * entityDolphinJump() + * entityDolphinPlay() + * entityDolphinSplash() + * entityDolphinSwim() + * entityDonkeyAmbient() + * entityDonkeyAngry() + * entityDonkeyChest() + * entityDonkeyDeath() + * entityDonkeyHurt() + * entityDragonFireballExplode() + * entityDrownedAmbient() + * entityDrownedAmbientWater() + * entityDrownedDeath() + * entityDrownedDeathWater() + * entityDrownedHurt() + * entityDrownedHurtWater() + * entityDrownedShoot() + * entityDrownedStep() + * entityDrownedSwim() + * entityEggThrow() + * entityElderGuardianAmbient() + * entityElderGuardianAmbientLand() + * entityElderGuardianCurse() + * entityElderGuardianDeath() + * entityElderGuardianDeathLand() + * entityElderGuardianFlop() + * entityElderGuardianHurt() + * entityElderGuardianHurtLand() + * entityEnderDragonAmbient() + * entityEnderDragonDeath() + * entityEnderDragonFlap() + * entityEnderDragonGrowl() + * entityEnderDragonHurt() + * entityEnderDragonShoot() + * entityEnderEyeDeath() + * entityEnderEyeLaunch() + * entityEnderPearlThrow() + * entityEndermanAmbient() + * entityEndermanDeath() + * entityEndermanHurt() + * entityEndermanScream() + * entityEndermanStare() + * entityEndermanTeleport() + * entityEndermiteAmbient() + * entityEndermiteDeath() + * entityEndermiteHurt() + * entityEndermiteStep() + * entityEvokerAmbient() + * entityEvokerCastSpell() + * entityEvokerDeath() + * entityEvokerFangsAttack() + * entityEvokerHurt() + * entityEvokerPrepareAttack() + * entityEvokerPrepareSummon() + * entityEvokerPrepareWololo() + * entityExperienceBottleThrow() + * entityExperienceOrbPickup() + * entityFireworkRocketBlast() + * entityFireworkRocketBlastFar() + * entityFireworkRocketLargeBlast() + * entityFireworkRocketLargeBlastFar() + * entityFireworkRocketLaunch() + * entityFireworkRocketShoot() + * entityFireworkRocketTwinkle() + * entityFireworkRocketTwinkleFar() + * entityFishSwim() + * entityFishingBobberRetrieve() + * entityFishingBobberSplash() + * entityFishingBobberThrow() + * entityGenericBigFall() + * entityGenericBurn() + * entityGenericDeath() + * entityGenericDrink() + * entityGenericEat() + * entityGenericExplode() + * entityGenericExtinguishFire() + * entityGenericHurt() + * entityGenericSmallFall() + * entityGenericSplash() + * entityGenericSwim() + * entityGhastAmbient() + * entityGhastDeath() + * entityGhastHurt() + * entityGhastScream() + * entityGhastShoot() + * entityGhastWarn() + * entityGuardianAmbient() + * entityGuardianAmbientLand() + * entityGuardianAttack() + * entityGuardianDeath() + * entityGuardianDeathLand() + * entityGuardianFlop() + * entityGuardianHurt() + * entityGuardianHurtLand() + * entityHorseAmbient() + * entityHorseAngry() + * entityHorseArmor() + * entityHorseBreathe() + * entityHorseDeath() + * entityHorseEat() + * entityHorseGallop() + * entityHorseHurt() + * entityHorseJump() + * entityHorseLand() + * entityHorseSaddle() + * entityHorseStep() + * entityHorseStepWood() + * entityHostileBigFall() + * entityHostileDeath() + * entityHostileHurt() + * entityHostileSmallFall() + * entityHostileSplash() + * entityHostileSwim() + * entityHuskAmbient() + * entityHuskConvertedToZombie() + * entityHuskDeath() + * entityHuskHurt() + * entityHuskStep() + * entityIllusionerAmbient() + * entityIllusionerCastSpell() + * entityIllusionerDeath() + * entityIllusionerHurt() + * entityIllusionerMirrorMove() + * entityIllusionerPrepareBlindness() + * entityIllusionerPrepareMirror() + * entityIronGolemAttack() + * entityIronGolemDeath() + * entityIronGolemHurt() + * entityIronGolemStep() + * entityItemBreak() + * entityItemFrameAddItem() + * entityItemFrameBreak() + * entityItemFramePlace() + * entityItemFrameRemoveItem() + * entityItemFrameRotateItem() + * entityItemPickup() + * entityLeashKnotBreak() + * entityLeashKnotPlace() + * entityLightningBoltImpact() + * entityLightningBoltThunder() + * entityLingeringPotionThrow() + * entityLlamaAmbient() + * entityLlamaAngry() + * entityLlamaChest() + * entityLlamaDeath() + * entityLlamaEat() + * entityLlamaHurt() + * entityLlamaSpit() + * entityLlamaStep() + * entityLlamaSwag() + * entityMagmaCubeDeath() + * entityMagmaCubeDeathSmall() + * entityMagmaCubeHurt() + * entityMagmaCubeHurtSmall() + * entityMagmaCubeJump() + * entityMagmaCubeSquish() + * entityMagmaCubeSquishSmall() + * entityMinecartInside() + * entityMinecartRiding() + * entityMooshroomShear() + * entityMuleAmbient() + * entityMuleChest() + * entityMuleDeath() + * entityMuleHurt() + * entityPaintingBreak() + * entityPaintingPlace() + * entityParrotAmbient() + * entityParrotDeath() + * entityParrotEat() + * entityParrotFly() + * entityParrotHurt() + * entityParrotImitateBlaze() + * entityParrotImitateCreeper() + * entityParrotImitateDrowned() + * entityParrotImitateElderGuardian() + * entityParrotImitateEnderDragon() + * entityParrotImitateEnderman() + * entityParrotImitateEndermite() + * entityParrotImitateEvoker() + * entityParrotImitateGhast() + * entityParrotImitateHusk() + * entityParrotImitateIllusioner() + * entityParrotImitateMagmaCube() + * entityParrotImitatePhantom() + * entityParrotImitatePolarBear() + * entityParrotImitateShulker() + * entityParrotImitateSilverfish() + * entityParrotImitateSkeleton() + * entityParrotImitateSlime() + * entityParrotImitateSpider() + * entityParrotImitateStray() + * entityParrotImitateVex() + * entityParrotImitateVindicator() + * entityParrotImitateWitch() + * entityParrotImitateWither() + * entityParrotImitateWitherSkeleton() + * entityParrotImitateWolf() + * entityParrotImitateZombie() + * entityParrotImitateZombiePigman() + * entityParrotImitateZombieVillager() + * entityParrotStep() + * entityPhantomAmbient() + * entityPhantomBite() + * entityPhantomDeath() + * entityPhantomFlap() + * entityPhantomHurt() + * entityPhantomSwoop() + * entityPigAmbient() + * entityPigDeath() + * entityPigHurt() + * entityPigSaddle() + * entityPigStep() + * entityPlayerAttackCrit() + * entityPlayerAttackKnockback() + * entityPlayerAttackNodamage() + * entityPlayerAttackStrong() + * entityPlayerAttackSweep() + * entityPlayerAttackWeak() + * entityPlayerBigFall() + * entityPlayerBreath() + * entityPlayerBurp() + * entityPlayerDeath() + * entityPlayerHurt() + * entityPlayerHurtDrown() + * entityPlayerHurtOnFire() + * entityPlayerLevelup() + * entityPlayerSmallFall() + * entityPlayerSplash() + * entityPlayerSplashHighSpeed() + * entityPlayerSwim() + * entityPolarBearAmbient() + * entityPolarBearAmbientBaby() + * entityPolarBearDeath() + * entityPolarBearHurt() + * entityPolarBearStep() + * entityPolarBearWarning() + * entityPufferFishAmbient() + * entityPufferFishBlowOut() + * entityPufferFishBlowUp() + * entityPufferFishDeath() + * entityPufferFishFlop() + * entityPufferFishHurt() + * entityPufferFishSting() + * entityRabbitAmbient() + * entityRabbitAttack() + * entityRabbitDeath() + * entityRabbitHurt() + * entityRabbitJump() + * entitySalmonAmbient() + * entitySalmonDeath() + * entitySalmonFlop() + * entitySalmonHurt() + * entitySheepAmbient() + * entitySheepDeath() + * entitySheepHurt() + * entitySheepShear() + * entitySheepStep() + * entityShulkerAmbient() + * entityShulkerBulletHit() + * entityShulkerBulletHurt() + * entityShulkerClose() + * entityShulkerDeath() + * entityShulkerHurt() + * entityShulkerHurtClosed() + * entityShulkerOpen() + * entityShulkerShoot() + * entityShulkerTeleport() + * entitySilverfishAmbient() + * entitySilverfishDeath() + * entitySilverfishHurt() + * entitySilverfishStep() + * entitySkeletonAmbient() + * entitySkeletonDeath() + * entitySkeletonHorseAmbient() + * entitySkeletonHorseAmbientWater() + * entitySkeletonHorseDeath() + * entitySkeletonHorseGallopWater() + * entitySkeletonHorseHurt() + * entitySkeletonHorseJumpWater() + * entitySkeletonHorseStepWater() + * entitySkeletonHorseSwim() + * entitySkeletonHurt() + * entitySkeletonShoot() + * entitySkeletonStep() + * entitySlimeAttack() + * entitySlimeDeath() + * entitySlimeDeathSmall() + * entitySlimeHurt() + * entitySlimeHurtSmall() + * entitySlimeJump() + * entitySlimeJumpSmall() + * entitySlimeSquish() + * entitySlimeSquishSmall() + * entitySnowGolemAmbient() + * entitySnowGolemDeath() + * entitySnowGolemHurt() + * entitySnowGolemShoot() + * entitySnowballThrow() + * entitySpiderAmbient() + * entitySpiderDeath() + * entitySpiderHurt() + * entitySpiderStep() + * entitySplashPotionBreak() + * entitySplashPotionThrow() + * entitySquidAmbient() + * entitySquidDeath() + * entitySquidHurt() + * entitySquidSquirt() + * entityStrayAmbient() + * entityStrayDeath() + * entityStrayHurt() + * entityStrayStep() + * entityTntPrimed() + * entityTropicalFishAmbient() + * entityTropicalFishDeath() + * entityTropicalFishFlop() + * entityTropicalFishHurt() + * entityTurtleAmbientLand() + * entityTurtleDeath() + * entityTurtleDeathBaby() + * entityTurtleEggBreak() + * entityTurtleEggCrack() + * entityTurtleEggHatch() + * entityTurtleHurt() + * entityTurtleHurtBaby() + * entityTurtleLayEgg() + * entityTurtleShamble() + * entityTurtleShambleBaby() + * entityTurtleSwim() + * entityVexAmbient() + * entityVexCharge() + * entityVexDeath() + * entityVexHurt() + * entityVillagerAmbient() + * entityVillagerDeath() + * entityVillagerHurt() + * entityVillagerNo() + * entityVillagerTrade() + * entityVillagerYes() + * entityVindicatorAmbient() + * entityVindicatorDeath() + * entityVindicatorHurt() + * entityWitchAmbient() + * entityWitchDeath() + * entityWitchDrink() + * entityWitchHurt() + * entityWitchThrow() + * entityWitherAmbient() + * entityWitherBreakBlock() + * entityWitherDeath() + * entityWitherHurt() + * entityWitherShoot() + * entityWitherSkeletonAmbient() + * entityWitherSkeletonDeath() + * entityWitherSkeletonHurt() + * entityWitherSkeletonStep() + * entityWitherSpawn() + * entityWolfAmbient() + * entityWolfDeath() + * entityWolfGrowl() + * entityWolfHowl() + * entityWolfHurt() + * entityWolfPant() + * entityWolfShake() + * entityWolfStep() + * entityWolfWhine() + * entityZombieAmbient() + * entityZombieAttackIronDoor() + * entityZombieAttackWoodenDoor() + * entityZombieBreakWoodenDoor() + * entityZombieConvertedToDrowned() + * entityZombieDeath() + * entityZombieDestroyEgg() + * entityZombieHorseAmbient() + * entityZombieHorseDeath() + * entityZombieHorseHurt() + * entityZombieHurt() + * entityZombieInfect() + * entityZombiePigmanAmbient() + * entityZombiePigmanAngry() + * entityZombiePigmanDeath() + * entityZombiePigmanHurt() + * entityZombieStep() + * entityZombieVillagerAmbient() + * entityZombieVillagerConverted() + * entityZombieVillagerCure() + * entityZombieVillagerDeath() + * entityZombieVillagerHurt() + * entityZombieVillagerStep() + * itemArmorEquipChain() + * itemArmorEquipDiamond() + * itemArmorEquipElytra() + * itemArmorEquipGeneric() + * itemArmorEquipGold() + * itemArmorEquipIron() + * itemArmorEquipLeather() + * itemArmorEquipTurtle() + * itemAxeStrip() + * itemBottleEmpty() + * itemBottleFill() + * itemBottleFillDragonbreath() + * itemBucketEmpty() + * itemBucketEmptyFish() + * itemBucketEmptyLava() + * itemBucketFill() + * itemBucketFillFish() + * itemBucketFillLava() + * itemChorusFruitTeleport() + * itemElytraFlying() + * itemFirechargeUse() + * itemFlintandsteelUse() + * itemHoeTill() + * itemShieldBlock() + * itemShieldBreak() + * itemShovelFlatten() + * itemTotemUse() + * itemTridentHit() + * itemTridentHitGround() + * itemTridentReturn() + * itemTridentRiptide1() + * itemTridentRiptide2() + * itemTridentRiptide3() + * itemTridentThrow() + * itemTridentThunder() + * musicCreative() + * musicCredits() + * musicDisc11() + * musicDisc13() + * musicDiscBlocks() + * musicDiscCat() + * musicDiscChirp() + * musicDiscFar() + * musicDiscMall() + * musicDiscMellohi() + * musicDiscStal() + * musicDiscStrad() + * musicDiscWait() + * musicDiscWard() + * musicDragon() + * musicEnd() + * musicGame() + * musicMenu() + * musicNether() + * musicUnderWater() + * uiButtonClick() + * uiToastChallengeComplete() + * uiToastIn() + * uiToastOut() + * weatherRain() + * weatherRainAbove() + + +## Entities module +The Entities module provides a suite of functions - one for each possible entity type. +It acts as a helper or enumerated module to assist in use with the `spawn` module and command. +This module is useful for TAB-completion at the in-game prompt. + +When each function is called with no parameters, it will return the appropriate EntityType object. +For example `entities.polar_bear()` will return an `EntityType.POLAR_BEAR` object. + +When each function is called with a single parameter - an entity - the entity's type will be compared and return true or false. + +### Usage + + entities.zombie(); // returns a SpigotMC/CanaryMod EntityType.ZOMBIE enum value + entities.zombie( mob ); // compares the entity's type to a zombie, returns true if mob type is zombie, false otherwise + entities.player( self ); // at the in-game prompt this should return true (compares self to a player entity type) + entities.rabbit( self ); // at the in-game prompt this should return false (compares self to a rabbit entity type) + +The following functions are provided: + + * area_effect_cloud() + * armor_stand() + * arrow() + * bat() + * blaze() + * boat() + * cave_spider() + * chicken() + * cod() + * complex_part() + * cow() + * creeper() + * dolphin() + * donkey() + * dragon_fireball() + * dropped_item() + * drowned() + * egg() + * elder_guardian() + * ender_crystal() + * ender_dragon() + * ender_pearl() + * ender_signal() + * enderman() + * endermite() + * evoker() + * evoker_fangs() + * experience_orb() + * falling_block() + * fireball() + * firework() + * fishing_hook() + * ghast() + * giant() + * guardian() + * horse() + * husk() + * illusioner() + * iron_golem() + * item_frame() + * leash_hitch() + * lightning() + * lingering_potion() + * llama() + * llama_spit() + * magma_cube() + * minecart() + * minecart_chest() + * minecart_command() + * minecart_furnace() + * minecart_hopper() + * minecart_mob_spawner() + * minecart_tnt() + * mule() + * mushroom_cow() + * ocelot() + * painting() + * parrot() + * phantom() + * pig() + * pig_zombie() + * player() + * polar_bear() + * primed_tnt() + * pufferfish() + * rabbit() + * salmon() + * sheep() + * shulker() + * shulker_bullet() + * silverfish() + * skeleton() + * skeleton_horse() + * slime() + * small_fireball() + * snowball() + * snowman() + * spectral_arrow() + * spider() + * splash_potion() + * squid() + * stray() + * thrown_exp_bottle() + * tipped_arrow() + * trident() + * tropical_fish() + * turtle() + * unknown() + * vex() + * villager() + * vindicator() + * weather() + * witch() + * wither() + * wither_skeleton() + * wither_skull() + * wolf() + * zombie() + * zombie_horse() + * zombie_villager() + diff --git a/docs/YoungPersonsGuideToProgrammingMinecraft.md b/docs/YoungPersonsGuideToProgrammingMinecraft.md index cc327120a..302d23f43 100644 --- a/docs/YoungPersonsGuideToProgrammingMinecraft.md +++ b/docs/YoungPersonsGuideToProgrammingMinecraft.md @@ -1,48 +1,48 @@ - # The Young Person's Guide to Programming in Minecraft -## Table of Contents - * [Introduction](#introduction) - * [Installing and Running SpigotMC](#installing-and-running-spigotmc) - * [Installing ScriptCraft](#installing-scriptcraft) - * [Configuring your Server (optional)](#configuring-your-server-optional) - * [Learning Javascript](#learning-javascript) - * [First Steps](#first-steps) - * [Variables](#variables) - * [Functions](#functions) - * [Building stuff in Minecraft](#building-stuff-in-minecraft) - * [Common Block Materials](#common-block-materials) - * [Dimensions](#dimensions) - * [More shapes](#more-shapes) - * [The Drone Object](#the-drone-object) - * [Movement](#movement) - * [Chaining - combining building and movement.](#chaining---combining-building-and-movement) - * [Exercise - Build a simple dwelling](#exercise---build-a-simple-dwelling) - * [Remembering where you started.](#remembering-where-you-started) - * [Saving your work](#saving-your-work) - * [Your First Minecraft Mod!](#your-first-minecraft-mod) - * [Parameters](#parameters) - * [true or false](#true-or-false) - * [More fun with `true` or `false`](#more-fun-with-true-or-false) - * [Booleans and JavaBeans](#booleans-and-javabeans) - * [SIDENOTE](#sidenote) - * [...and Again, and Again, and Again,...](#and-again-and-again-and-again) - * [Counting to 100](#counting-to-100) - * [Saying "Hi!" to every player](#saying-hi-to-every-player) - * [While Loops](#while-loops) - * [`utils.foreach()` - Yet another way to process Arrays](#utilsforeach---yet-another-way-to-process-arrays) - * [Exercise](#exercise) - * [Putting `for` loops to use - Building a Skyscraper](#putting-for-loops-to-use---building-a-skyscraper) - * [Making Decisions](#making-decisions) - * [Event-Driven programming](#event-driven-programming) - * [Stop listening to events.](#stop-listening-to-events) - * [Keeping Score - Lookup tables in Javascript](#keeping-score---lookup-tables-in-javascript) - * [Counting block break events for each player](#counting-block-break-events-for-each-player) - * [Next Steps](#next-steps) +## Table of Contents + * [Introduction](#introduction) + * [Installing and Running SpigotMC](#installing-and-running-spigotmc) + * [Installing ScriptCraft](#installing-scriptcraft) + * [Configuring your Server (optional)](#configuring-your-server-optional) + * [Learning Javascript](#learning-javascript) + * [First Steps](#first-steps) + * [Variables](#variables) + * [Functions](#functions) + * [Building stuff in Minecraft](#building-stuff-in-minecraft) + * [Common Block Materials](#common-block-materials) + * [Dimensions](#dimensions) + * [More shapes](#more-shapes) + * [The Drone Object](#the-drone-object) + * [Movement](#movement) + * [Chaining - combining building and movement.](#chaining---combining-building-and-movement) + * [Exercise - Build a simple dwelling](#exercise---build-a-simple-dwelling) + * [Remembering where you started.](#remembering-where-you-started) + * [Saving your work](#saving-your-work) + * [Your First Minecraft Mod!](#your-first-minecraft-mod) + * [Parameters](#parameters) + * [true or false](#true-or-false) + * [More fun with `true` or `false`](#more-fun-with-true-or-false) + * [Booleans and JavaBeans](#booleans-and-javabeans) + * [SIDENOTE](#sidenote) + * [...and Again, and Again, and Again,...](#and-again-and-again-and-again) + * [Counting to 100](#counting-to-100) + * [Saying "Hi!" to every player](#saying-hi-to-every-player) + * [While Loops](#while-loops) + * [`utils.foreach()` - Yet another way to process Arrays](#utilsforeach---yet-another-way-to-process-arrays) + * [Exercise](#exercise) + * [Putting `for` loops to use - Building a Skyscraper](#putting-for-loops-to-use---building-a-skyscraper) + * [Making Decisions](#making-decisions) + * [Event-Driven programming](#event-driven-programming) + * [Stop listening to events.](#stop-listening-to-events) + * [Keeping Score - Lookup tables in Javascript](#keeping-score---lookup-tables-in-javascript) + * [Counting block break events for each player](#counting-block-break-events-for-each-player) + * [Next Steps](#next-steps) ## Introduction Minecraft is an open-ended 3D game where you can build and craft diff --git a/src/docs/java/jscript.java b/src/docs/java/jscript.java index 5b06fd541..475d0fe00 100644 --- a/src/docs/java/jscript.java +++ b/src/docs/java/jscript.java @@ -8,10 +8,15 @@ public static void main(String[] args) throws Exception { ScriptEngineManager factory = new ScriptEngineManager(); ScriptEngine engine = factory.getEngineByName("JavaScript"); + // Adding bindings to work with GraalJS + Bindings bindings = engine.getBindings(ScriptContext.ENGINE_SCOPE); + bindings.put("polyglot.js.allowAllAccess", true); + bindings.put("polyglot.js.nashorn-compat", true); + java.io.File file = new java.io.File(args[0]); engine.put("engine",engine); engine.put("args",args); - try { + try { engine.put("cmItemTypeClass",Class.forName("net.canarymod.api.inventroy.ItemType")); }catch(Exception e){ } diff --git a/src/main/java/bukkit/org/scriptcraftjs/bukkit/ScriptCraftPlugin.java b/src/main/java/bukkit/org/scriptcraftjs/bukkit/ScriptCraftPlugin.java index d65736910..afc8b999f 100644 --- a/src/main/java/bukkit/org/scriptcraftjs/bukkit/ScriptCraftPlugin.java +++ b/src/main/java/bukkit/org/scriptcraftjs/bukkit/ScriptCraftPlugin.java @@ -6,7 +6,11 @@ import javax.script.Invocable; import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; +import javax.script.ScriptEngineManager; +// imports for GraalJS bindings +import javax.script.Bindings; +import javax.script.ScriptContext; + import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; @@ -27,11 +31,21 @@ public class ScriptCraftPlugin extends JavaPlugin ClassLoader previousClassLoader = currentThread.getContextClassLoader(); currentThread.setContextClassLoader(getClassLoader()); try { - ScriptEngineManager factory = new ScriptEngineManager(null); + ScriptEngineManager factory = new ScriptEngineManager(); + // This older fix does not work with GraalVM in R21.2.0; in this case + // it does not return any engine ('engine' is null) + //ScriptEngineManager factory = new ScriptEngineManager(null); this.engine = factory.getEngineByName("JavaScript"); + if (this.engine == null) { this.getLogger().severe(NO_JAVASCRIPT_MESSAGE); } else { + // Enrico, adding bindings to work with GraalJS, + // see https://www.graalvm.org/reference-manual/js/NashornMigrationGuide/ + Bindings bindings = this.engine.getBindings(ScriptContext.ENGINE_SCOPE); + bindings.put("polyglot.js.allowAllAccess", true); + bindings.put("polyglot.js.nashorn-compat", true); + Invocable inv = (Invocable) this.engine; this.engine.eval(new InputStreamReader(this.getResource("boot.js"))); inv.invokeFunction("__scboot", this, engine); @@ -62,7 +76,7 @@ public List onTabComplete(CommandSender sender, Command cmd, } return result; } - + public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { boolean result = false; diff --git a/src/main/js/lib/task-bukkit.js b/src/main/js/lib/task-bukkit.js index 444e1422a..5e178590d 100644 --- a/src/main/js/lib/task-bukkit.js +++ b/src/main/js/lib/task-bukkit.js @@ -2,19 +2,40 @@ /*global __plugin, module, server*/ function bukkitSetTimeout(callback, delayInMillis) { var delay = Math.ceil(delayInMillis / 50); - var task = server.scheduler[ - 'runTaskLater(org.bukkit.plugin.Plugin, java.lang.Runnable ,long)' - ](__plugin, callback, delay); + + // This does not work, as GraalJS does not enable picking the specific runTaskLater() + // overloaded funciton out of the different possibilities as Nashorn does + // (see https://docs.oracle.com/javase/8/docs/technotes/guides/scripting/prog_guide/javascript.html and + // https://www.gitmemory.com/issue/graalvm/graaljs/37/739925131 + // In principle, GraalJS should support this method but at least in GraalJS 21.2.0 this is not working. + // Reverting to work-around as per https://github.com/walterhiggins/ScriptCraft/issues/396 + // +// var task = server.scheduler[ +// 'runTaskLater(org.bukkit.plugin.Plugin, java.lang.Runnable ,long)' +// ](__plugin, callback, delay); + var Run = Java.type('java.lang.Runnable'); + var MyRun = Java.extend(Run, { + run: callback + }); + var task = server.scheduler.runTaskLater(__plugin, new MyRun(), delay); + return task; } function bukkitClearTimeout(task) { task.cancel(); } function bukkitSetInterval(callback, intervalInMillis) { - var delay = Math.ceil(intervalInMillis / 50); - var task = server.scheduler[ - 'runTaskTimer(org.bukkit.plugin.Plugin, java.lang.Runnable ,long, long)' - ](__plugin, callback, delay, delay); + var delay = Math.ceil(intervalInMillis / 50); + // See comment in bukkitSetTimeout() +// var task = server.scheduler[ +// 'runTaskTimer(org.bukkit.plugin.Plugin, java.lang.Runnable ,long, long)' +// ](__plugin, callback, delay, delay); + var Run = Java.type('java.lang.Runnable'); + var MyRun = Java.extend(Run, { + run: callback + }); + var task = server.scheduler.runTaskTimer(__plugin, new MyRun(), delay, delay); + return task; } function bukkitClearInterval(bukkitTask) { diff --git a/src/main/js/modules/drone/index.js b/src/main/js/modules/drone/index.js index 369f7a696..178a67b6b 100644 --- a/src/main/js/modules/drone/index.js +++ b/src/main/js/modules/drone/index.js @@ -13,22 +13,22 @@ The Drone is a convenience class for building. It uses a fluent interface which means all of the Drone's methods return `this` and can be chained together like so... var theDrone = new Drone(self); - theDrone.up().left().box(blocks.oak).down().fwd(3).cylinder0(blocks.lava,8); + theDrone.up().left().box(blocks.oak).down().fwd(3).cylinder0(blocks.lava,8); ### Constructing a Drone Object Drones can be created in any of the following ways... - + 1. Calling any one of the methods listed below will return a Drone object. For example... - + var d = box( blocks.oak ) ... creates a 1x1x1 wooden block at the cross-hairs or player's location and returns a Drone object. This might look odd (if you're familiar with Java's Object-dot-method syntax) but all of the Drone class's methods are also global functions that return new Drone objects. This is short-hand for creating drones and is useful for playing around with Drones at the in-game command prompt. It's shorter than typing ... - - var d = new Drone(self).box( blocks.oak ) - + + var d = new Drone(self).box( blocks.oak ) + ... All of the Drone's methods return `this` so you can chain operations together like this... - + var d = box( blocks.oak ) .up() .box( blocks.oak ,3,1,3) @@ -41,30 +41,30 @@ Drones can be created in any of the following ways... .turn() .fwd(2) .box( blocks.oak ); - + 2. Using the following form... d = new Drone(self) - + ...will create a new Drone taking the current player as the parameter. If the player's cross-hairs are pointing at a block at the time then, that block's location becomes the drone's starting point. If the cross-hairs are _not_ pointing at a block, then the drone's starting location will be 2 blocks directly in front of the player. TIP: Building always happens right and front of the drone's position... - + Plan View: ^ | | D----> - + For convenience you can use a _corner stone_ to begin building. The corner stone should be located just above ground level. If the cross-hair is point at or into ground level when you create a new Drone() with either a player or location given as a parameter, then building begins at the location the player was looking at or at the location. You can get around this by pointing at a 'corner stone' just above ground level or alternatively use the following statement... - + d = new Drone(self).up(); - + ... which will move the drone up one block as soon as it's created. ![corner stone](img/cornerstone1.png) 3. Or by using the following form... - + d = new Drone(x,y,z,direction,world); This will create a new Drone at the location you specified using x, y, z In minecraft, the X axis runs west to east and the Z axis runs north to south. The direction parameter says what direction you want the drone to face: 0 = east, 1 = south, 2 = west, 3 = north. If the direction parameter is omitted, the player's direction is used instead. Both the `direction` and `world` parameters are optional. @@ -75,7 +75,7 @@ Drones can be created in any of the following ways... This is useful when you want to create a drone at a given `org.bukkit.Location` . The `Location` class is used throughout the bukkit API. For example, if you want to create a drone when a block is broken at the block's location you would do so like this... - events.blockBreak( function( event ) { + events.blockBreak( function( event ) { var location = event.block.location; var drone = new Drone(location); // do more stuff with the drone here... @@ -86,11 +86,11 @@ Drones can be created in any of the following ways... * Player : If a player reference is given as the sole parameter then the block the player was looking at will be used as the starting point for the drone. If the player was not looking at a block then the player's location will be used as the starting point. If a `Player` object is provided as a paramter then it should be the only parameter. * location : *NB* If a `Location` object is provided as a parameter, then it should be the only parameter. * x : The x coordinate of the Drone (x,y,z,direction and world are not needed if either a player or location parameter is provided) - * y : The y coordinate of the Drone - * z : The z coordinate of the Drone - * direction : The direction in which the Drone is facing. Possible values are 0 (east), 1 (south), 2 (west) or 3 (north) - * world : The world in which the drone is created. - + * y : The y coordinate of the Drone + * z : The z coordinate of the Drone + * direction : The direction in which the Drone is facing. Possible values are 0 (east), 1 (south), 2 (west) or 3 (north) + * world : The world in which the drone is created. + ### Drone.box() method the box() method is a convenience method for building things. (For the more performance-oriented method - see cuboid) @@ -98,14 +98,14 @@ the box() method is a convenience method for building things. (For the more perf #### parameters * b - the block id - e.g. 6 for an oak sapling or '6:2' for a birch sapling. Alternatively you can use any one of the `blocks` values e.g. `blocks.sapling.birch` - * w (optional - default 1) - the width of the structure - * h (optional - default 1) - the height of the structure + * w (optional - default 1) - the width of the structure + * h (optional - default 1) - the height of the structure * d (optional - default 1) - the depth of the structure - NB this is not how deep underground the structure lies - this is how far away (depth of field) from the drone the structure will extend. #### Example To create a black structure 4 blocks wide, 9 blocks tall and 1 block long... - + box(blocks.wool.black, 4, 9, 1); ... or the following code does the same but creates a variable that can be used for further methods... @@ -114,7 +114,7 @@ To create a black structure 4 blocks wide, 9 blocks tall and 1 block long... drone.box(blocks.wool.black, 4, 9, 1); ![box example 1](img/boxex1.png) - + ### Drone.box0() method Another convenience method - this one creates 4 walls with no floor or ceiling. @@ -122,8 +122,8 @@ Another convenience method - this one creates 4 walls with no floor or ceiling. #### Parameters * block - the block id - e.g. 6 for an oak sapling or '6:2' for a birch sapling. Alternatively you can use any one of the `blocks` values e.g. `blocks.sapling.birch` - * width (optional - default 1) - the width of the structure - * height (optional - default 1) - the height of the structure + * width (optional - default 1) - the width of the structure + * height (optional - default 1) - the height of the structure * length (optional - default 1) - the length of the structure - how far away (depth of field) from the drone the structure will extend. @@ -134,7 +134,7 @@ To create a stone building with the insided hollowed out 7 wide by 3 tall by 6 l box0( blocks.stone, 7, 3, 6); ![example box0](img/box0ex1.png) - + ### Drone.boxa() method Construct a cuboid using an array of blocks. As the drone moves first along the width axis, then the height (y axis) then the length, each block is picked from the array and placed. @@ -152,7 +152,7 @@ Construct a rainbow-colored road 100 blocks long... var rainbowColors = [blocks.wool.red, blocks.wool.orange, blocks.wool.yellow, blocks.wool.lime, blocks.wool.lightblue, blocks.wool.blue, blocks.wool.purple]; - + boxa(rainbowColors,7,1,30); ![boxa example](img/boxaex1.png) @@ -161,20 +161,20 @@ Construct a rainbow-colored road 100 blocks long... All of the Drone methods return a Drone object, which means methods can be 'chained' together so instead of writing this... - drone = new Drone( self ); + drone = new Drone( self ); drone.fwd( 3 ); drone.left( 2 ); - drone.box( blocks.grass ); // create a grass block + drone.box( blocks.grass ); // create a grass block drone.up(); drone.box( blocks.grass ); // create another grass block drone.down(); ...you could simply write ... - + var drone = new Drone(self).fwd(3).left(2).box(blocks.grass).up().box(blocks.grass).down(); ... since each Drone method is also a global function that constructs a drone if none is supplied, you can shorten even further to just... - + fwd(3).left(2).box(blocks.grass).up().box(blocks.grass).down() The Drone object uses a [Fluent Interface][fl] to make ScriptCraft scripts more concise and easier to write and read. Minecraft's in-game command prompt is limited to about 80 characters so chaining drone commands together means more can be done before hitting the command prompt limit. For complex building you should save your commands in a new script file and load it using /js load() @@ -190,7 +190,7 @@ The Drone object uses a [Fluent Interface][fl] to make ScriptCraft scripts more ### Extending Drone -The Drone object can be easily extended - new buidling recipes/blueprints can be added and can become part of a Drone's chain using the *static* method `Drone.extend`. +The Drone object can be easily extended - new buidling recipes/blueprints can be added and can become part of a Drone's chain using the *static* method `Drone.extend`. ### Drone.extend() static method @@ -198,7 +198,7 @@ Use this method to add new methods (which also become chainable global functions #### Parameters - * name - The name of the new method e.g. 'pyramid'. + * name - The name of the new method e.g. 'pyramid'. * function - The method body. Alternatively if you provide just a function as a parameter, then the function name will be used as the new method name. For example the following two approaches are both valid. @@ -206,24 +206,24 @@ Alternatively if you provide just a function as a parameter, then the function n #### Example 1 Using name and function as parameters // submitted by [edonaldson][edonaldson] - var Drone = require('drone'); - Drone.extend('pyramid', function( block, height ) { + var Drone = require('drone'); + Drone.extend('pyramid', function( block, height ) { this.chkpt('pyramid'); for ( var i = height; i > 0; i -= 2) { this.box(block, i, 1, i).up().right().fwd(); } - return this.move('pyramid'); + return this.move('pyramid'); }); #### Example 2 Using just a named function as a parameter - var Drone = require('drone'); - function pyramid( block, height ) { + var Drone = require('drone'); + function pyramid( block, height ) { this.chkpt('pyramid'); for ( var i = height; i > 0; i -= 2) { this.box(block, i, 1, i).up().right().fwd(); } - return this.move('pyramid'); + return this.move('pyramid'); } Drone.extend( pyramid ); @@ -253,7 +253,7 @@ An array which can be used when constructing stairs facing in the Drone's direct An array which can be used when placing signs so they face in a given direction. This is used internally by the Drone.sign() method. It should also be used for placing any of the following blocks... - * chest + * chest * ladder * furnace * dispenser @@ -346,7 +346,10 @@ function makeTypeIdAndDataSetter() { }; } else { try { - var CraftEvil = Java.type(server.class.package.name + '.util.CraftEvil'); + // Enrico, fix as per https://github.com/walterhiggins/ScriptCraft/issues/447 + // since CraftEvil become legacy (obsoleted) + //var CraftEvil = Java.type(server.class.package.name + '.util.CraftEvil'); + var CraftEvil = Java.type(server.class.package.name + '.legacy.CraftEvil'); console.log('Drone using CraftEvil.setTypeIdAndData method'); return function(block, typeId, data, applyPhysics) { CraftEvil.setTypeIdAndData(block, typeId, data, applyPhysics); @@ -355,7 +358,8 @@ function makeTypeIdAndDataSetter() { console.log( 'Drone support is experimental on 1.15.2 and above, and may be broken...' ); - return function(block, typeId, data, applyPhysics) { + return function(block, typeId, data, applyPhysics) { + // not working: setBlockData() 'data' parameter is not an integer block.setBlockData(data, applyPhysics); block.setType(typeId); }; @@ -364,7 +368,7 @@ function makeTypeIdAndDataSetter() { } /* - low-level function to place a block in the world - all drone methods which + low-level function to place a block in the world - all drone methods which place blocks ultimately invoke this function. */ function putBlock(x, y, z, blockId, metadata, world, update) { @@ -386,8 +390,9 @@ function putBlock(x, y, z, blockId, metadata, world, update) { } } if (__plugin.bukkit) { - setTypeIdAndData(block, blockId, metadata, update); - } + // Adding '!!' to force conversion of 'null' or 'undefined' to 'false' + // otherwise GraalJS refuses to cast 'undefined' to a boolean value + setTypeIdAndData(block, blockId, metadata, !!update); } return block; } /* @@ -562,7 +567,7 @@ declare a new Drone object first, then write a `for` loop to create the syntax for what should really be simple. * You can use a `while` loop … - + d = new Drone(); var i=4; while (i--) { d.cottage().right(8); } … which is slightly shorter but still too much syntax. Each of the @@ -725,7 +730,7 @@ function isTooBig(w, h, d) { ); } /* - faster cuboid because blockid, meta and world must be provided + faster cuboid because blockid, meta and world must be provided use this method when you need to repeatedly place blocks */ Drone.prototype.cuboidX = function(blockType, meta, w, h, d, immediate) { diff --git a/target/scriptcraft.jar b/target/scriptcraft.jar new file mode 100644 index 000000000..bb5273a91 Binary files /dev/null and b/target/scriptcraft.jar differ