Basic BUKKIT plugin Tutorial Hello I noticed although there is great documentation on how to set up a plugin there wasn't much on actually writing it. So i thought seeing as i had some free time to make a BUKKIT plugin tutorial that teaches you to make a plugin from scratch that actually does something. Hope this is helpful for people that don't have a clue. This tutorial shows you how to make a toggle commandable feature where when the user places a torch it relays a message. Video: Note: Bukkit has changed since the making of this video. http://forums.bukkit.org/threads/oops-i-broke-your-plugins.599 This post here will tell you what has changed. See updated tutorial: http://forums.bukkit.org/threads/bukkit-updates-tutorial.7093/ Note: Do NOT use org.bukkit.* name for your plugin: http://forums.bukkit.org/threads/on-namespaces-please-do-not-use-bukkit-in-your-plugins.3732/ Text: First up links: Latest BUKKIT: http://ci.bukkit.org/job/dev-Bukkit/ Eclipse: http://www.eclipse.org/ Java SE: http://www.oracle.com/technetwork/java/javase/downloads/index.html Source (Fully Annotated): http://www.mediafire.com/?ep4lze85tqcfqn4 Souce: Basic.javahttp://pastebin.com/dZa0hKDZ BasicBlockListenerhttp://pastebin.com/PFT3Gsix BasicPlayerListenerhttp://pastebin.com/xmx0UbGr Feel free to PM me any questions you have
Thanks Samkio, im currently learning java, 2nd course now and starting to get a hang of it, just transitioning to bukkit can be overwhelming especially when there isn't much for code reference, lots of code hunting and such!
Samkio, maybe useful for adding a section for git to grab the source code to use in the reference libraries with the .jar file? https://github.com/Bukkit/Bukkit.git
You're a winner. Thank you for this, saw a link to your post in another forum. Anxious to get started now. Downloading everything I need.
Well from what i can gather. iConomy saves the users balance in a flat file. This flat file is located root>iConomy>accounts.flat What you would need to do is run a method to access the values stored in the flat file. In the flatfile the data is: Samkio=50 So using a players name we can get their balance. Hope that helps
I would like to get some more info on how to work with SQLite/flatfiles in combination with Bukkit. Any clues?
Maybe another tutorial me thinks As for now look at the source code for other plugins maybe helpful. They are in the source code aswell as at the top of these source links: Souce: Basic.javahttp://pastebin.com/dZa0hKDZ BasicBlockListenerhttp://pastebin.com/PFT3Gsix BasicPlayerListenerhttp://pastebin.com/xmx0UbGr Hope this helps
Can you make a tutorial, how to work with just SQL? I Dont have it, and i dont know what i need to do with it. ;D
Thank you, i couldn't find them in the source i downloaded =) Will you continue this tutorial and show us how to use permissions, configs and so on? because i need this things for programming a plugin i want. Or can you give me any source examples of more advanced plugins? Thanks! Edit: and maybe arguments?
I will make one seeing as it has had a lot of interest! Yes this is a Basic plugin i will make a new one for more advanced stuff.
I would just say, if you make another tutorial. Try not to copy and paste all the source and put it in a txt file. Some people might find it hard to follow along.
Yeah I agree with Torrent. I don't care if the video is up to 1 hour long if I can really learn something from it. And afaik you can upload up to 5 hours to youtube
Sweet stuff Ok then im working on a new plugin tutorial slightly more advanced with dir creation, settings files and storing data(Sql/data etc).
And again, I got it figured out before the tutorial. I knew some JDBC from a course on databases, the problem was that I needed to specify the sqlite library in a manifest file. You really want to mention that in your tutorial.
Hello I have a question, when I create the plugin.yml file I get errors.. One of them: null; mapping values are not allowed here.. name: Basic version: 1.1 main:com.bukkit.minikahn.Basic.Basic Now when I create it without a space ( name: Basic version:1.1 main:com.bukkit.minikahn.Basic.Basic) the server says.. could not load the plugin, because the version is not defined so, what I can do? ----> name:Basic --> The Name is not definied name: Basic -> it's okay version:1.1 -> the version is not defined version: 1.1 --> the argument is not allowed....( with 1.0 it's the same) pls help me!
Just right-click on src, then on new->file, name it plugin.yml and copy this into your file: Code: name: Basic version: 1.1 main: com.bukkit.minikahn.Basic.Basic