Share

Share

Welcome to the BukkitWiki!

This Wiki is home to Bukkit's documentation and regulations surrounding the Bukkit Project and it's services. Want to help out? We would love to have you! Signup to get started!

Talk:Plugin Tutorial

From BukkitWiki
Jump to: navigation, search

I was reading thru this for my own sake(I'm new to coding plugins) and I got stuck after I created the plugin file. It never said how/when to create the class files. Could someone add this to help people in the future? I figured it out myself, but I'm not that good at editing wiki's and I don't want to mess it up on accident. --Conmiro 22:11, 12 May 2011 (EST)

Permissions[edit]

What is 'doorman' here ? - Then name of the plugin ? - The name of a class ? - Neither, an arbitrary 'node name' ?

permissions:

   doorman.*:
       description: Gives access to all doorman commands

--Mstram (talk) 05:59, 4 July 2013 (UTC)

Commands[edit]

When the tutorial explains commands, it is helpful, but it doesn't ever specify where a developer should place the coding. Also, the tutorial does not, at least with much clarity, touch on why different bits of code go into different classes in the Bukkit setup. Cholo71796 17:41, 9 July 2011 (EST)

On that note I noticed it does not say anything about calling getCommand(s).setExecutor() in onEnable for a plugin --Sagacious Zed 07:19, 8 September 2011 (EST)

Cleanup[edit]

Could someone please clean this page up? It looks messy. Put some titles and shit in here RightLegRed 18:04, 1 June 2011 (EST)

I will go around and fix the HTML (its reaaallly ugly atm) and put in some titles soon, but if anyone gets around to it before me I won't be complaining ;-) -- Chris Ward - Volunteer Admin (Report Spam) 01:50, 2 June 2011 (EST)
It was copied directly from the forum thread, yay! I'll pick at it a bit too. resba - BukkitWiki Admin 08:46, 2 June 2011 (EST)
It looks like some of the English could be improved on too. If I find time later, I'll go through and re-word some of it and sort it into paragraphs. RightLegRed 07:53, 4 June 2011 (EST)

Video[edit]

Hey, I found this video that follows most of the patterns in this tutorial for setting up a basic plugin, it was really useful for my first plugin! I don't know if you can add it to the wiki, I don't want to touch it and ruin things :p

http://www.youtube.com/watch?v=DzyHpwRVtVw

--Conmiro 16:48, 13 May 2011 (EST)

Storing/loading objects.[edit]

Hey, I tried to implement your SLAPI in a plugin which I'm currently writing. The rest of the plugin works fine, I'm experimenting with saving objects directly instead of casting them to strings and storing them in properties.

Simply: when I try to write a Player or Hashmap, my server console freaks about about notSerializableException. If I try to write a simple int, there is no issue.

Am I missing something, or are things like Players (which you said would be ok) not able to be written with your SLAPI approach? If so, what's the most popular way of saving, say, a Hashmap with Player as a key and Location as value? Thanks.

Mcatoy 21:11, 25 May 2011 (EST)

OnEnable/OnDisable and registering listeners[edit]

Should there not at least be the suggestion in one of these two sections that a plugin developer should keep track whether their plugin has already registered event listeners already? You can disable/enable plugins and some would/will happily register an event a second time.

A more ideal situation would perhaps be that Bukkit let a plugin only register for one event just once (allowing for multiple priorities of course).

And also that they keep track when their plugin is disabled and that they wouldn't let their event handlers continue when that is the case. As it is now you cannot unregister your listeners. And same as above goes. Maybe Bukkit should just not send events to disabled plugins.

But those are feature requests that don't go here, I know. At least the tutorial could promote such behavior. ArmEagle 07:06, 1 June 2011 (EST)

YML Tutorial?[edit]

YML is awesome for writing config files so could instructions on that be posted here? -- Chris Ward - Volunteer Admin (Report Spam) 11:00, 29 July 2011 (EST)

Duplicated Page[edit]

What is the difference between this and the HUGE Plugin Tutorial -- Chris Ward - Volunteer Admin (Report Spam) 23:31, 6 September 2011 (EST)

Oh sorry, I didn't realize that it was moved :/ -- Chris Ward - Volunteer Admin (Report Spam) 23:31, 6 September 2011 (EST)

Advertising plugins and library?[edit]

Although I believe that Adamki11s should be given credit for starting this tutorial, the Adverts for Extra's etc. should be in my opinion removed. Also, some words should be changed, like "my", etc. It is an official plugin tutorial now, so we shouldn't advertise any plugins or libraries - that is unfair to other developers, who often made their own libraries. The wiki page isn't a place to advertise work, so - am I just nagging, or should we clean it up? -- Acrobot 16:41, 17 October 2011 (EST)

I agree, it does need cleaning up. I think it should be attributed but shouldn't have the plugins -- Chris Ward - Volunteer Admin (Report Spam) 11:13, 18 October 2011 (EST)

Requests Section[edit]

Should this be moved to this talk page? Thats the kind of thing that you don't put on the main page, but on the talk page -- Chris Ward - Volunteer Admin (Report Spam) 04:12, 18 September 2011 (EST)

Imports[edit]

Would it be possible to get what the actual imports are instead of just telling people how to do it with Eclipse? I use a different editor (not my choice) and it does not have the needed functionality for the low-detail of it at the moment.


This not enough for people that are not using eclipse. DemeGeek 00:34, 20 October 2011 (EST)

Spout Modding[edit]

I am interested in doing a section on the basics of Spout modding. Is this now a free wiki page now that it is not titled adamki11s huge plugin tutorial. And therefore when I am done can it be added the the appropriate section.

--Md 5 03:52, 24 October 2011 (EST)

Requests Section: "How to: Make a plugin using spout?"[edit]

I think making a tutorial on how to make a spout-api plugin is beyond the scope of this wiki, comments? resba - BukkitWiki Admin 15:46, 20 December 2011 (EST)

Package Names for Email addresses with a dot[edit]

In the section of this tutorial about package names, it says that using your e-mail as the package name would look something like com.gmail.<username> for an e-mail address like <username>@gmail.com.

But what if the <username> has a dot in it? Like, how would you use an e-mail address like [email protected] to come up with a package name? Would it be like com.gmail.world.hello, or com.gmail.hello.world?

Thanks in advance.

YoshiOG1 00:35, 18 November 2012 (EST)

  • What I say in the next section I have will probably help you. From my geuss, though, package names can be anything. Pokechu22 (talk) 00:00, 29 July 2013 (UTC)

Package names[edit]

Is it realy required that they have your email address? Or can it just be a unique identifier, such as for me "com.pokechu22.plugins"? My geuss from my work with java is that it doesn't realy matter, so long as it isn't something that already exists. Pokechu22 (talk) 00:00, 29 July 2013 (UTC)

I geuss "com.pokechu22" would be bad, sinse it implies a webside, but maybe "pokechu22.plugins.<PLUGINNAMEHERE>"?Pokechu22 (talk) 00:12, 29 July 2013 (UTC)
  • Well, it didn't explode or anything when I did that, so I geuss it is fine. Pokechu22 (talk) 22:12, 2 August 2013 (UTC)

Support for IntelliJ IDEA IDE[edit]

I noticed that this tutorial only covers the Eclipse IDE. Could I possibly "port" the setup instructions to IntelliJ, and if so, would I make a new section on the page or make a new page? 5chris100 (talk) 22:44, 7 April 2014 (UTC)

Some issues[edit]

I have used this to get up and running, from knowing nothing about modding minecraft. I hit a few issues. Could be just me, so I will mention them here so someone more knowledgeable can check and update the page if appropriate.

1. Need to download bukkit-1.7.2-R0.3.jar

2. Need to point your project at it

3. Need to set java compile version (can of worms, re: "Unsupported major.minor version 51.0"; I fixed by using Java 1.7). Probably worth getting the user to do java -version, and acting accordingly.

4. Need (to avoid warningsfrom Maven) to have a version element here:

    <build>
     <plugins>
         <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-compiler-plugin</artifactId>
             <version>3.1</version>
             <configuration>

5. Some examples use "Plugin" when it should be "MyPlugin" (look around MyPluginCommandExecutor)

6. To use the Player object, you need another import F2Andy (talk) 10:09, 5 May 2014 (UTC)

The first two steps should be completely unnecessary, if the Maven project is set up properly. Since maven automatigally handles the dependency for you, including downloading and setting up your IDE's build path. What you describe is not consistent with how Maven should behave. I have revised the section discussing the java version declaration, to make it more explicit, that while common, not all servers run Java 7, and to support all Bukkit servers requires Java 6. --Sagacious Zed (talk) 05:46, 6 May 2014 (UTC)

Page without maven[edit]

I would like to have a version of this page without maven, as the version with it is missing a few things. I found the oldid page that is like this, but do not know how to copy it. Can someone do this for me, or explain why it should not be done? (On a side note, this page is missing information on how to enable javadocs, which is on the old version...) --Pokechu22 (talk) 17:08, 23 August 2014 (UTC)