@@ -16,29 +16,41 @@ files in a directory.
16
16
This is a simple mod in a file called greet.js in the scriptcraft/plugins directory...
17
17
18
18
``` javascript
19
- exports .greet = function ( player ) {
20
- echo ( player, ' Hello ' + player .name );
21
- };
19
+ function greet ( player ) {
20
+ echo ( player, ' Hello ' + player .name );
21
+ }
22
+ exports .greet = greet;
22
23
```
23
24
24
- At the in-game prompt, type...
25
+ At the in-game prompt, type:
25
26
26
- /js greet(self)
27
+ ``` javascript
28
+ / js greet (self )
29
+ ```
27
30
28
- ... to see the greeting. Anything you can do using CanaryMod or CraftBukkit's API in Java, you can do using ScriptCraft in Javascript.
31
+ Anything you can do using the CanaryMod or CraftBukkit APIs in Java,
32
+ you can do using ScriptCraft in Javascript.
29
33
30
34
# Description
31
35
32
36
ScriptCraft is a plugin for Minecraft Servers which lets operators,
33
37
administrators and plug-in authors customize the game using
34
38
Javascript. ScriptCraft makes it easier to create your own mods. Mods
35
39
can be written in Javscript and can use the full [ CanaryMod API] [ cm ]
36
- or [ Bukkit API] [ bukkit ] . I recommend using CanaryMod because
37
- CraftBukkit is no longer being actively developed due to a legal
38
- dispute. The ScriptCraft mod also lets you enter javascript commands
39
- at the in-game prompt. To bring up the in-game prompt press the ` / `
40
- key then type ` js ` followed by any javascript statement.
41
- For example: ` /js 1 + 1 ` will print 2.
40
+ or [ Bukkit API] [ bukkit ] . ScriptCraft works with all of the following Minecraft Server software:
41
+
42
+ * [ CanaryMod] [ cm ] (Recommended)
43
+ * [ SpigotMC] [ spigot ] (Bukkit-compatible)
44
+ * [ GlowStone] [ gs ] (Bukkit-compatible)
45
+
46
+ [ spigot ] : http://www.spigotmc.org/
47
+ [ gs ] : http://www.glowstone.net/
48
+
49
+ I recommend using CanaryMod because CraftBukkit is no longer being
50
+ actively developed due to a legal dispute. The ScriptCraft mod also
51
+ lets you enter javascript commands at the in-game prompt. To bring up
52
+ the in-game prompt press the ` / ` key then type ` js ` followed by any
53
+ javascript statement. For example: ` /js 1 + 1 ` will print 2.
42
54
43
55
ScriptCraft also includes many objects and functions to make building
44
56
and modding easier using Javascript. The Javascript ` Drone ` object
@@ -55,29 +67,28 @@ Minecraft.
55
67
56
68
# Prerequisites
57
69
58
- You will need to have Java version 6 or later installed on your
59
- machine. Check the version by typing ` java -version ` at a command
60
- prompt. You will need to [ install CanaryMod ] [ ic ] or [ install Bukkit ] [ ib ]
61
- on your machine (I recommend using CanaryMod as Bukkit is
62
- no longer being actively developed). CanaryMod and Bukkit are both
63
- versions of Minecraft (server) that make it easy to install plugins
64
- and customize Minecraft. You can [ download the CanaryMod server
65
- here.] [ ic ]
70
+ * You will need to have Java version 6 or later installed on your
71
+ machine. Check the version by typing ` java -version ` at a command
72
+ prompt.
73
+
74
+ * You will need to [ install CanaryMod] [ ic ] on your
75
+ machine. CanaryMod is a customized version of Minecraft Server that
76
+ makes it easy to install plugins and customize Minecraft. You can
77
+ [ download the CanaryMod server here.] [ ic ]
66
78
67
79
# Installation
68
80
69
81
If you don't want to compile from source, you can [ download the
70
- compiled plugin here] [ dl ] and copy it the craftbukkit's plugins
71
- directory.
82
+ compiled plugin here] [ dl ] and copy it to the CanaryMod plugins directory.
72
83
73
84
# Post Install
74
85
75
- Once installed, a new scriptcraft/plugins directory is automatically created. All files in the scriptcraft/plugins
76
- directory will be automatically loaded when the server starts. * Only
77
- players who are ops can use this plugin. * You can grant a player ` op `
78
- privileges by typing 'op < username >' at the server console prompt or
79
- by adding the player's username to the ops.txt file in your
80
- server directory.
86
+ Once installed, a new scriptcraft/plugins directory is automatically
87
+ created. All files in the scriptcraft/plugins directory will be
88
+ automatically loaded when the server starts. * Only players who are
89
+ ops can use this plugin. * You can grant a player ` op ` privileges by
90
+ typing 'op < username >' at the server console prompt or by adding the
91
+ player's username to the ops.txt file in your server directory.
81
92
82
93
Launch the server, then launch the Minecraft client and create a new
83
94
server connection. The IP address will be ` localhost ` . Once you've
@@ -90,19 +101,16 @@ ground-level block and type ...
90
101
blocks high by 1 block long. Take a look at the
91
102
src/main/javascript/drone/drone.js file to see what ScriptCraft's
92
103
drone can do. If you're interested in customizing minecraft beyond
93
- just creating new buildings, take a look at [ ./homes/homes.js] [ homes ] for examples of how to create a
94
- javascript plugin for Minecraft.
95
-
96
- [ ho ] : blob/master/src/main/js/plugins/homes/homes.js
97
- [ ar ] : blob/master/src/main/js/plugins/arrows.js
98
- [ si ] : blob/master/src/main/js/modules/signs/menu.js
104
+ just creating new buildings, take a look at [ the homes mod] [ homes ] for an example of how to create a more fully-featured javascript plugin for Minecraft.
99
105
100
106
A Javascript mod for minecraft is just a javascript source file (.js)
101
- located in the craftbukkit/plugins/scriptcraft/plugins directory. All .js files in this
102
- directory will be automatically loaded when the craftbukkit server
103
- starts. To get started writing your own mod, first take a look at some
104
- of the existing mods in the [ homes] [ ho ] , [ arrows] [ ar ] and
105
- [ signs] [ si ] directories.
107
+ located in the scriptcraft/plugins directory. All .js files in this
108
+ directory will be automatically loaded when the server starts. To get
109
+ started writing your own mod, take a look at some of the
110
+ [ examples] [ examples ] .
111
+
112
+ [ ho ] : src/main/js/plugins/homes/homes.js
113
+ [ examples ] : src/main/js/plugins/examples/
106
114
107
115
# Additional information
108
116
@@ -127,9 +135,7 @@ ScriptCraft plugin...
127
135
128
136
[ dl ] : http://scriptcraftjs.org/download
129
137
[ api ] : https://ci.visualillusionsent.net/job/CanaryLib/javadoc/
130
- [ ib ] : http://wiki.bukkit.org/Setting_up_a_server
131
138
[ ic ] : http://canarymod.net/releases
132
- [ cbdl ] : http://dl.bukkit.org/downloads/craftbukkit/
133
139
[ cmapi ] : https://ci.visualillusionsent.net/job/CanaryLib/javadoc/
134
140
135
141
# Contributing
0 commit comments