Skript Plugin

Skript

Skript is a plugin that allows you to customize Minecraft's mechanics with simple scripts written in plain English sentences. You can easily create complex custom commands, triggers that execute effects under certain conditions, and scripts that just run periodically - all without having to know even the slightest bit about programming! The (hopefully) intuitive language has the advantage that you don't even need to learn much to be able to use Skript.

To get an idea of what is possible with Skript consider taking a look at the scripts forum where users of this plugin share the scripts they have written themselves, improving their servers without the need for a plugin developer. Skript can also be used to replace smaller plugins, allowing you to shorten your likely long plugin list. An incomplete list of replaceable plugins can be found on the replacers forum.

The latest version of Skript is 2.1.2

Introduction
To write a script you simply have to write down what you want Skript to do when some conditions are met. This is a simple 'event → condition(s) → effect(s)' syntax, which could look like the following example:

on mine of stone: send "You just mined stone!" to player Each script can contain many such triggers which each start with an event and have a list of as many conditions and effects as you want.
 * 1) This example informs the player when he mines stone

A trigger, which is a collection of conditons & effects, must start with an event and have zero or more conditions and effects. The event determines when the conditions are checked, and if all are met, the effects are executed in order. Take a look at the following example which has everything:


 * 1) A simple lightning strike/smite/Thor's hammer script:

MUAHAHAHAHAHAHAHAAHAHAHHAHAAAAAAAA
 * 1) the trigger has an event:

wdqxoi

deqwdecdffre

frv

fwerf

dc

sdw

sw

aqxxs

w

ed

edw

Custom commands can be defined similarly, e.g. the following defines a powerful '/item' command that can be used like '/item 5 diamond swords of sharpness 5 and a cake':

command /item : description: Spawn yourself some items permission: skript.item trigger: give argument to the player Furthermore Skript also features more complex script elements like loops, which are described in the documentation. Skript also supports variables that can persistently store information globally, per player, per block, etc., and has a wide range of expressions that you can use in conditions, effects, messages and variable names.

A notable featue of Skript are aliases, which are names for Minecraft's items and blocks. Each alias can consist of multiple IDs and data values and allow you to use any item's or block's name in scripts instead of having to use their IDs like many plugins force you to. Along with the ability to define enchanted items you can create some of the possibly most powerful '/item' commands for Bukkit with just a few lines! (two example commands are included in the download)

Need help?
You can always ask for help on the forums, though it can be faster for you and easier for me if you first look through the available tutorials and examples. If you get many "indentation error"s or "invalid line" errors you should read this explanation to understand what indentation is all about.

Tutorials

If you're new to Skript you should read the basic tutorial. It explains how to write a new script step by step. In the likely case that the basic tutorial was too short you can read the more exhaustive tutorial by DemonPenguin. There are also some more official tutorials as well as user-created ones on the tutorials forum.

Documentation

To learn more about writing scripts please read the documentation on my website. There are also lists of all possible events, conditions, effects, expressions and types with examples for each of them.

The Team
Njol: Manager & programmer of Skript DemonPenguin: Wrote some tutorials and moderates the forums mazius123: Submits tons of bug reports MegaNarwhal: Made the old Skript banner and a signature image

Features
Natural syntax As you might already have noticed writing scripts is not very difficult. You can write (almost) normal english sentences and Skript will try to interpret them. If Skript doesn't understand something, please check your spelling and/or refer to the documentation to find out how to write your sentence to make Skript understand it. Custom Commands Skript can be used to define custom commands. These commands can use Skript's syntax which allows to make very user-friendly commands, like one of the most powerful /item commands available, and any other command you or others come up with. Skript also has a setting to try to interpret all unknown commands as effects. This basically allows to use any effects you can put into triggers as a command. A short introdution on how to create custom commands can be found on my website. Please note that Skript is NOT suited for creating aliases of commands or for creating a command that executes multiple other commands. I suggest to use Commander or some other plugin for this purpose. Independent Scripts Triggers can be put into multiple files, and each file is treated independently. This means that you can easily use triggers made by other people by simply copy&pasting their files into the scripts directory. Scripts are thus like small plugins for Skript with the advantage of being able to edit them easily. You can find some scripts on the forums, and you can also post your own. Please read the Guidelines before posting a file. Item and Block Aliases Aliases help to make the config more user-friendly by using comprehensive names for items and blocks, e.g. you can write 'bonemeal' instead of '351:15', or 'any hoe' instead of listing all hoe types. Aliases support data value ranges and can even consist of multiple types. You can easily define your own aliases, e.g. "blacklisted = TNT, bedrock, obsidian, monster spawner, lava, lava bucket" and there are also many useful predefined aliases in the main config. Error Handling Skript automatically logs errors in the scripts to the console, e.g. if it can't understand a line of a trigger. It will not cease operation, but simply skip the invalid parts of the scripts, be it a whole trigger (e.g. if the event is invalid) or just a single condition (e.g. if there's a typo in the condition's name). This might lead to unexpected behaviour, so always check for errors in the console after you have changed something. If you use the "/skript reload" command all errors will be sent to the player who used the command (or printed to the console if the command was used from there). Extensible Java developers can add their own conditions, effects and variables using a provided API.

Future Features
More events/effects/conditions/expressions/loops/etc. I'm always looking for ideas ;) Triggers which are executed when a player presses a specific button, steps on a predefined pressure plate, etc. This sounds awesome but will definitely take a while. Economy support add/remove/move money from/to a player Full list of planned features: https://github.com/Njol/Skript/issues?labels=new+feature&state=open

Permissions
Skript works without permissions plugins, but It also provides some permission in case you use one:

skript.admin Grants access to the /skript command. skript.effectcommands Allows to use effects as commands if effect commands are enabled in the config. You can also use the ' has/doesn't have the permission "permission.here"' condition in scripts to check whether a player has/doesn't have a certain permission. You can even create your own permissions this way, but you should note that "mypermissions.*" does not give all permission that start with "mypermissions." (The exception to this rule are other plugins' "*" permissions and any permissions starting with "skript.").

Download
Download the full zip containing the jar, the configs and some example scripts and extract it into your server's plugins directory. If you were previously using Skript 1.4.9 or a beta version you only have to update the .jar file, and the aliases files should you still have an 'aliases.sk', or rename yours to 'aliases-english.sk'.

The source code can be found on github.

Donations
If you like the plugin feel free to make a donation :)

Changelog
2.0 (15 September 2013) please note that this is the changelog from version 1.4.9 to 2.0, i.e. most features aren't new if you were using the beta versions. Additions New effects: colour armour, enchant, log, open inventory, parse, potion, replace, shear, and vehicle New conditions: contains, damage cause, date, is alive, is blocking, is empty, is riding New expressions: amount of, bed, chunk, coloured, command, command sender, compass target, damage cause, direction, element, enchantment level, ender chest, exe location, hash, item, items in, level, level progress, location of, location at, max health, named, parse, parse error, passenger, remaining air, round, script, skull, speed, value, vehicle, version, yaw/pitch, at New events: command, entity target, experience spawn, grow, move on, script load/unload, Skript enable/disable New types: type, timespan, direction, tree type, enchantment type, experience, potion effect type, damage cause, chunk, enchantment New script features: while loop, expression lists, grouped expressions (see documentation for more info on the new elements above) Skript now updates automatically if specified in the config, or by commands Started making Skript localizeable, german is included in the defauld download Added option 'case sensitive' Variables can be stored in a database which can also be monitored for changes Added saddled pigs and wither skeletons Skript can now hook into other plugins. Currently Vault, WorldGuard and Factions can be hooked and add the following new elements if present: type 'money', expression 'money', expression 'chat prefix/suffix', condition 'can build' Changes Improved error logging The /skript command now accept folders as arguments (use / or \ at the end) to enable/disable/reload whole folders of scripts Local variables now start with _ instead of * Variables can now be lists (including local variables) Variables that contain a time or date value can now be changed Improved changing variables %player% now always represents the Minecraft account name of a player, not their display name anymore. Use %display name of player% if you need it. ... and many more changes I can't remember Fixes Fixed number accuracy of 0 resulting in errors Fixed database storage from stopping from an error if loading variables takes longer than 'monitor interval' Fixed Minecraft times from comparing erroneously ... and myriads of other bug fixes Older changelog can be found in the respective files.

Source: http://dev.bukkit.org/bukkit-plugins/skript/