forked from walterhiggins/ScriptCraft
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample-1-hello-module.js
More file actions
30 lines (21 loc) · 891 Bytes
/
example-1-hello-module.js
File metadata and controls
30 lines (21 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*************************************************************************
## 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);
};
***/
exports.hello = function(player) {
echo(player, 'Hello ' + player.name);
};