This repository has been archived on 2021-07-14. You can view files and clone it, but cannot push or open issues or pull requests.
scriptcraft/src/main/js/plugins/examples/example-1-hello-module.js
walterhiggins 19162c3688 First phase of transition from Bukkit to Canary.
Some of the plugins are not yet supported.
If you're feeling brave you can build from source using ant.
2014-09-29 23:42:41 +01:00

31 lines
895 B
JavaScript

/*************************************************************************
## 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 );
};