Skript
This version of Skript is not maintained any more (since 2014).
Please download new releases from the SkriptLang fork.
Updated documentation can be found on SkriptLang.org. Docs for Skript and Addons can be found on skUnity.
More resources may be found on skUnity. Need help with Skript? Join the skUnity Discord.
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.1 (11 March 2014)
Notice
I'm back from my hiatus, but I will likely not be able to update Skript until I can download a recent build of CraftBukkit to fix new bugs. Also, with the future of Bukkit uncertain and no official Minecraft API in sight, I don't know how actively I'll update this plugin.
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:
# This example informs the player when he mines stone on mine of stone: send "You just mined stone!" to player
Each script can contain many so-called triggers which each start with an event and have a list of as many conditions and effects as you want. 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:
# A simple lightning strike/smite/Thor's hammer script: # the trigger has an event: on leftclick with a golden axe: # a condition: player has the permission "thor" # and some effects: strike lightning at the targeted block broadcast "Fear the mighty Thor!"
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 <items>:
description: Spawn yourself some items
permission: skript.item
trigger:
give argument to the player
Furthermore Skript also features more complex script elements like loops and conditional statements, 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 feature 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
- joeuguce99: Helps programming by adding new features
- DemonPenguin: Wrote some tutorials and moderates the forums
- mazius123: Submits tons of bug reports
- MegaNarwhal: Made the old Skript banner and a signature image
- MostFunGuy: Expert in Skript and Skript accessories. The glue that holds everyone together
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 well suited for creating aliases of other plugins' commands or for creating a command that executes multiple other commands. I suggest to use Commander or some other plugin for this purpose.
- Inventory Menus
- Using SkQuery (An addon for Skript), you can create dynamic inventory menus found in many popular plugins. Want a couple items to display that will do different things such as warps and console commands? This becomes an easy task. Slots can be formatted to do nothing, run a console command and close the menu, or even run a console command and keep the menu open (Usefull for dynamic updating menus that change based on selections)
- Chat Formatting/Json Capability
- Again, using SkQuery (An addon for Skript), you can completely customize how your chat looks from prefix to suffix to player's name to the actual message itself.
- In addition, you can add JSON formatting to your chat in game... Want to highlight a player's name and display a location? A rank? A specific class they have selected? Want to click someones name and have kick/ban/mute/message inventory menu to appear? Easy!
- 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).
- Automatic Update
- Skript can detect new versions and update itself, either by a command (
/skript update) or automatically when the server starts. You can turn the automatic check on or off, configure whether to check for updates only, and choose whether to download them as well in the config file. If a new version is found, all players with the permission 'skript.admin' will get notified of the new version.
- As Simple or as Complicated as You Want To Go
- Want to create a message that displays after the player logs in? Sure, easy, 2 lines, done in a flash. Want to create a completely custom, unique experience that will WOW your users and astound them? Sure, it's more complex, but it's all worth it to see your users blown away by the customizability of your creations.
- See a user complain that something doesn't work right? Fix the code, reload the skript (Without restarting the server) and watch them be so confused as to how it was already fixed.
- Extensible
- Java developers can add their own conditions, effects and variables using a provided API.
- Many users have completed addons, and these addons contribute IMMENSE amounts of conditions, expressions and triggers. Some give you access to items in item frames, some let you create scoreboards, and some even let you send resource packs to players.
- These are just some of the addons available
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.
- Full list of planned features:
- https://github.com/Njol/Skript/issues?labels=new+feature&state=open
- What I'm currently working on:
- https://github.com/Njol/Skript/issues/assigned/Njol?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
/skriptcommand. - skript.effectcommands
- Allows to use effects as commands if effect commands are enabled in the config.
You can also use the '<player> 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
To install or update Skript, download the latest Skript.jar and save it in your server's plugin directory. If you're installing Skript for the first time, start & stop your server once to generate the config files and some example scripts.
- Please read the changelog when updating, and create a backup of your database(s) just to play it safe.
You can also download the newest aliases-english.sk and aliases-german.sk (updated to Minecraft 1.7.2).
The source code can be found on github.
Donations
If you like the plugin feel free to make a donation :)
Changelog
v2.1.1 (11 March 2014)
- Main Change
- Fixed most (if not all) database issues.
- Please still create a backup of the old variables table just to play it safe.
- Part of the fix required to save and load all variables on the main server thread, i.e. performance may suffer.
- Improvements
- Changed the updater to adhere to the new Bukkit guidelines
- Improved the automatic config updating
- Should be compatible with Java 6 again
- Decreased chances of errors due to improved automatic code analysis
- Added a workaround to be able to remove a player's tool in a click event
- Added workaround to make Skript more compatible with mods that dynamically change enums via reflection. If they do this improperly Skript will still not be compatible with them however.
- Added some 1.7 block to the code
- Improved/fixed visual effects
- Improved expression lists
- Added an error on an unsuccessful hook into another plugin
- Improved regions support
- Added expression 'me' that can only be used in effect commands
- Improved documentation generation
- Improved effect commands
- Added 'luck' and 'lure' enchantments now that Bukkit supports them
- Fixes
- Fixed configs only working with tabs. You can now use any indentation again, and even use different types in one file.
- Fixed some other minor config related issues
- Fixed error reporting not reporting the whole error
- Fixed the pressure plate event to also fire for golden and iron pressure plates
- Fixed a few issues with custom language files
- Fixed "neither ... nor ..." not working as expected
- Fixed some log-related errors and fixed some log messages that didn't appear at all
- Fixed not complaining about storing an entity or other non-serialisable data in list variables
- Fixed the Bukkit command registration hack to work in 1.7.2 R0.4 as well
- Fixed effect command to use english
- Code Related
- Slightly improved directions
- Minor performance improvements
- Added draft for sound support
- Removed script caching completely, as it never worked anyway. This might break addons.
- Added some more comments to the API
2.1 (17 December 2013)
- Note
- this release includes two changes to how variables are saved, thus please test saving and loading variables on a test server before updating Skript on your main server (especially if you're using a database - but make sure to configure the test server to access a different database!)
- added support for multiple databases (this also allows to define variables that won't be saved at all)
- variables are no longer saved as text but in binary
- Improved support for regions plugins:
- supported plugins: WorldGuard, Factions, PreciousStones, and GriefPrevention
- new expressions: members/owner(s) of %region%, regions at %location%, block in %region%, the region
- new event: on region enter/exit
- new condition: %player% is member/owner of %region%, %region% contains %location%
- use regions in scripts like 'region "region name", or save them to variables and use the variables instead
- New Expressions
- experience, index of %text% in %text%, join/split %text% by/at %text%, length of %text%, subtext of %text% between %number% and %number%, first/last %number% characters of %text%, max stack size of %item%, line %number% of lore of %item%
- New Effects
- play effect (plays entity and particle effects), force %entity% to dismount
- Fixes and Improvements
- dropped items, falling blocks, and thrown potions can now have item types (e.g. falling dirt, dropped arrow)
- horse variants (mules, donkeys, etc.) can now be distinguished. colours and decorations are not supported yet.
- pigs can now be equipped with saddles, and horses can be equipped with saddles, horse armour, and chests
- added ability to shoot projectiles from any location, not just from entities
- added ability to directly change the id of an item or block
- added warning when using 'items in {var::*}'
- added ability to change the passenger of a vehicle and vice versa
- 'on experience spawn' is now called when fishing as well
- the shooter of a projectile can now be changed
- biomes can now be changed
- added a warning if a variable is assigned a value that cannot be saved
- 'colour of ...' might now work with more items (e.g. stained glass), but this depends on Bukkit
- improved localisation, mostly in regards to aliases
- improved changing expressions
- improved all expressions that have multiple time states when used with expression lists to return the expected value
- improved the 'parse' expression
- several small improvements to parsing
- fixed "<%color expressions%>" in text not working
- and many bug fixes
Older changelog can be found in the respective files.
Comments
Please don't use the comments to ask questions, report a bug or issue, or suggest a new feature, as comments can get extremely unorganized very quickly.
Use the help forum instead if you have a question, the suggestions forum for feature requests, or create a ticket to submit a bug report.
-
View User Profile
-
Send Message
Posted Jan 20, 2014@joeuguce99
Thanks for the update.
I'll be happy as long as Skript continues to work through future MC updates. However, I'm definitely looking forward to upcoming enhancements.
-
View User Profile
-
Send Message
Posted Jan 19, 2014@Rotebay
Not stable yet, it will be later (hopefully).
-
View User Profile
-
Send Message
Posted Jan 19, 2014RIP 2.1
-
View User Profile
-
Send Message
Posted Jan 15, 2014I don't care how this whole thing started, but I'm here to end it.
If you are not mature enough to discuss something without insulting or cursing at them, then you shouldn't be posting. If you can't be nice and act like mature adults, then I don't want you here.
If anyone involved wants to discuss this further with me then send me a pm and I will gladly talk endlessly with you.
- Demon
-
View User Profile
-
Send Message
Posted Jan 15, 2014@beastzone
Wait... What? The people complaining about me helping people are the people who... don't help people. Interesting how that works right? Either:
A. Actually try to help people
Or
B. Continue to do nothing, and butt out.
You never do anything here, of course people aren't going to say anything about you. People can not like me all they want. I really don't care, those are the people that are not helping the community in any way.
I didn't start this discussion.
So again, help people, or go away. This discussion has nothing to do with you guys remember?
-
View User Profile
-
Send Message
Posted Jan 15, 2014@MostFunGuy
My involvement in this plugin does not matter, people don't care about what I am posting or not posting, its you who is bothering everyone it seems. Frankly i do not care whether i help others, i taught myself by recreating already made scripts till they made sense to me and i could recreate others without copying. And it does seem people care what you are saying, i say nothing and you don't see people complaining because im not teaching others every second. While you still get complained about and you are a frequent poster.... Ironic right =) Im going to just go ahead and stop this argument now. Since you obviously are just trying redirect the argument back at the other person, so you don't look soo dumb. Don't bother replying, this is the last message to this argument. But im sure you won't be able to give up not having the last words.
-Dan
-
View User Profile
-
Send Message
Posted Jan 15, 2014@beastzone
Your saying It's only the moderator's job only to help people. You sure about that?
It's not an hour search, its as simple as clicking the help forum.
I am not obligated to respond, and i am fully aware of that. I point people in the correct direction (or tell them exactly what to do). What do you do?
Absolutely nothing.
-
View User Profile
-
Send Message
Posted Jan 15, 2014@MostFunGuy
I don't mind you helping, i find it extremely useful to help others, continue doing your help on the forum as you wish. And no one is obligated to answer any questions on the help forum, I help people who i see need help at a quick glance on the comments. I am not going to go on an hour search to help people, its not my job. That is the job for the forum moderators, its nice to help, and i do some work when on these forums when i see people with questions on the forums. Also if you have such an issue with repeat issue posters, then just don't respond, You are NOT obligated to respond....
-
View User Profile
-
Send Message
Posted Jan 15, 2014@beastzone
@Tsugaga
I am in no way the only person who thinks this way. The other people who help out players on the forums (not you guys, not at all) agree with me.
This page takes longer to get responses then the actual help forum.
Neither of you give very much (if any) help on the forums.
Try posting more then 2 helpful comments, and help out players over and over with the same issues over and over. When either of you actually use the forums to help players, then try and talk about this. Sound fair?
This is not an all out war. This is a civilized discussion about how you dont like how I am helping players. You guys start doing it yourself, maybe you'll understand.
-
View User Profile
-
Send Message
Posted Jan 15, 2014@MostFunGuy
(PS: I mean this in a resolving voice.... not angry) To sum things up, before this argument becomes a problem.... Tsugaga and others believe that it doesn't matter whether there is a rule there or not.... thats not the point we are trying to make. The point is that no one wants to listen to someone posting "POST ON THE HELP PAGE" every god damn time someone asks a question. Yes we understand that it would be more relevant to post in the help section, no one is denying that fact. Its just people are not patient and the fastest way to get a response is by posting here. This may not apply to you, but some very large population of people believe that rules are meant to be broken. Also if it weren't for the helpful people i have meet on the comments section, I wouldn't have had understood the amount that I do today. I'm sure that others can agree that posting in the comments is not a big issue.... or any at all. The only person who seems to disagree is you. Now I mean this in a resolving tone, not an angry one, but you really don't need to repeat a rule that is clearly noted in the last part of plugin page. There will always be someone to break the rules and just get there ideas out to get a quick response. Just you don't need to tell everyone, 3 times a day(I don't mean literally, but you do post ALOT). Thanks and I hope this issue could be resolved so these comments don't become an all out war.
-Dan
-
View User Profile
-
Send Message
Posted Jan 15, 2014@Tsugaga
Again, maybe you should use the search feature in the forum.
Of the 8 comments you have in the forums, Threads that have both me and you in them: 2.
Amount of those 2 threads that have me responding to you in any way: 0
Again, yourwordsnotmine.jpg.
Hey, Tsugaga, fact check your statements first, and take your own advice
-
View User Profile
-
Send Message
Posted Jan 15, 2014Your comments do involve me because you have replied to me a couple times with just the main forum links. Everyone is complaining about you for a reason. Do you see us all complaining about anyone else besides you? No. People don't like the way you act or reply in these comments, you annoy and bother everyone that asks a question here. You're trying to be helpful but are doing so in an annoying and forceful way.
-
View User Profile
-
Send Message
Posted Jan 14, 2014@Tsugaga
1. Complaining about me complaining.... That makes more sense than mine right?
2. I post either the correct forum that they should've searched in, the exact thread that they should look in, the code needed to fix their issue, or the section of the documentation that they should be using.
3. Again, not a tantrum, just defending myself against people who are complaining about what im doing.
4. Read number 2 (even though i know how much you hate to read)
5. It takes all of 40 seconds to post in the help forum. If you don't have time for that, you don't have time for skript.
Emphasis on the "defending myself" because other people are throwing tantrums about my comments. If players expect better responses, they should start using the tools that are there for them instead of expecting everyone else to do it for them.
Take some of your own advice. My comments have nothing to do with you, and if you don't like them just ignore them. (your words, not mine)
-
View User Profile
-
Send Message
Posted Jan 14, 2014@MostFunGuy
1. I never said people shouldn't read, and never said it was a bad idea, but complaining about people not reading everything above is senseless like I said.
2. I'm talking about the comments where all you post is the 4 large text main section links every time someone asks a question.
3. You are throwing a tantrum. You're getting hostile towards people asking questions and are getting annoyed that people are asking questions in the comments.
4. That's nice, and totally fine, but that's also not the same as your usual comment which just includes the 4 section links.
5. Typing a comment on the main page is easier that creating a topic and then checking it later. While creating a topic isn't hard, most people can just leave a question in the comments within seconds and easily check back every so often without navigating to the forum or setting a bookmark.
I do use the forum, but I also use the comments. Like I have already said twice, people will continue to ask questions in the comments no matter how much you don't like it. It has nothing to do with you, it does not have any affect on you at all, so if you can't calmly answer a persons question, then don't reply to them at all.
It's common for a person to continue defending themself or continue arguing even when they see they did something wrong, which I'd assume is what you're doing, or you really think you're doing nothing wrong. Your attitude sucks, nobody wants your snotty replies every time they ask a question here.
-
View User Profile
-
Send Message
Posted Jan 14, 2014@Tsugaga
1. Maybe people should read it, before asking questions that are answered on it? Might be a stupid idea
2. I post forum links when the forum links answer the question being asked. Or would copy and paste be better for you?
3. Not throwing a tantrum whatsoever. Just stating facts.
4. I answer as many posts as i can, with either clear, concise code that i spent alot of time on, a link to code that already works, or point the person the right direction (whether that be the a specific forum or the documentation)
5. The help forum is the place for quick and easy questions (and also have 16,256 responses). Chances are that someone has had the same issue you are having.
Maybe if you, and others, used the forums the way they were intended, there wouldn't be 16,256 posts in the help section.
-
View User Profile
-
Send Message
Posted Jan 14, 2014@MostFunGuy
Right, I know what the page says, and like I said already, nobody reads it. There would also be a lot less replies if you didn't reply to every question with forum links. People will continue asking questions in the comments whether you throw a tantrum or not. If you want to be a nice guy and give answers then go ahead, but getting annoyed or mad that they aren't using the forum is senseless.
I like using the comments for questions, always have, as do many others. If you don't like it then too bad, it really has nothing to do with you. The comments are a quick and easy way to just post a quick question.
-
View User Profile
-
Send Message
Posted Jan 14, 2014@beastzone
@Tsugaga
If the user in question had already looked through the forums, they would know that THIS HAS ALREADY BEEN DISCUSSED
If people used the forums correctly, there would be 1/5 of the posts that there are currently.
People could find the problem they're having and have it fixed in a tenth of the time, and not clog up the forums with the same issues over and over.
There is a search bar for a reason, and people need to use it.
This page states:
Then, post from NJOL on how to post in the help forums correctly:
If people cannot make posts correctly following the rules over and over and over, they should not be allowed to post.
Would be really nice.
-
View User Profile
-
Send Message
Posted Jan 14, 2014@Tsugaga
Took the words right out of my mouth.
-Dan
-
View User Profile
-
Send Message
Posted Jan 14, 2014Converting scripts into stand alone plugins isn't a bad question or suggestion, and the person doesn't need to be told to go away, that's just unnecessary hostility.
Also about using the forums and what not, people will continue asking questions in the comments whether you post forum links every day or not MostFunGuy. While you posting the links is fine imo, I'd assume you only do so to get noticed, and getting annoyed about posting the same reply repeatedly is senseless because the comments have nothing to do with you and you are forgetting that you're posting the same reply repeatedly, but are doing so to a different person each time. You can't post it once and expect thousands of future people to magically know that you posted the forum links 35 pages back.
And yes, people should read, I completely understand how it is for people to ask and do things when it's written down in plain sight, but getting mad over it just makes you look like an ass.
-
View User Profile
-
Send Message
Posted Jan 13, 2014@Brocodo
I have only run Skript on Spigot and have not run into any teleportation-related issues. For example, I've use something along the lines of this in-game:
set {aParticularLocation} to player's location
and that approach has worked pretty well for me so far. Also, stuff like:
set {deathlocation.%player%} to player's location
hasn't caused any problems either.
I recommend checking to make sure your variables file isn't getting too big (assuming you're using the file vs a db, which I haven't tried yet). Seems like almost every time I've had a Skript issue it was due to this.
Anyway, no clue if your issue is related but hopefully this'll help. Otherwise, I recommend the forums as a next step.