Wiki

Clone wiki

BukkitGames / Creating abilities

Intro

So you are just a normal server owner? You have no idea of Java (If not, then click here for JavaDocs) but you still want to create new abilities for the BukkitGames or add potion effects to kits?
Well then here is the solution: Skript. Skript by Njolbrim is a plugin that allows you to customize Minecraft's mechanics with simple scripts written in plain English sentences. That's it.

Let's start: Get used to Skript

Ok, so if you aren't familiar with Skript I think you should first get an idea of how Skript works. This tutorial should help you with that. (If you want to know even more check this site. It offers you even more possibilities with Skript and has great documentation.) You should also check out the things BukkitGames adds to Skript here.

Write your first ability with Skript

Let's think of an ability

So you now know how Skript works and what it can do. Well then let's start creating our first ability. Let's say we want to create an ability called LuckyFarmer. What it should do is, whenever a player with this ability destroys a leave, there should be a chance to drop a golden apple.

Create a new skript

Now that we got an idea of what we want to do, let's create a new skript at plugins/Skript/scripts. I will name it 9-LuckyFarmer.sk but you can name it whatever you want. Just make sure the file ending is .sk. For writing scripts I use Notepad++, but you can just use whatever you want.

Register your new ability

Let's register the ability right when our script is being loaded. We will give it the id 9. Notice the "" around the name and the description.

# Hi, this is a comment! :) Let's register the ability.
on load:
    register new ability 9 name "LuckyFarmer" description "Leaves have a chance to drop a golden apple."

Let's create an event

We need an event when a player breaks a leave. (You can find all events and more documentation here.) So in this event if the player has the ability and the ability is not on cooldown (using player might use ability 9.) Then with a chance of 10% we will drop a golden apple. Last, we will set the ability of that player on cooldown, so he doesn't get an overload of golden apples.

# Let's make it drop golden apples when a tribute with this ability breaks a leave
on break of leaves:
    player might use ability 9
    chance of 10%:
        drop 1 golden apple at the block
    cooldown ability 9 of player for 15 seconds

Let's give it a potion effect

I think we should also give this ability a downside to make it fair. And because golden apples can really make you loose your mind, let's add nausea to the player right after invincibility turned off. Note that we are using the %player% has ability %id% in this case, because we want to give the potion effect to the player even when his ability is currently on cooldown.

# Give all tributs with this ability a potion effect when invincibility ends
on game enable:
    loop all players:
        loop-player has ability 9
        apply nausea 1 to loop-player for 10 seconds

Downloads

You can find the whole script here. There are even more scripts for abilities listed here.

Looking for the abilites of the old version of BukkitGames? Click here.

Problems?

You can visit the forum of the Skript plugin and ask for help there or go to this site for more information.

Updated