Thanks for this. Sometimes the reader reads it wrong so its best to write on 3 sepertate lines. Will update tutorial.
No problem! Again thanks for this tutorial, this helped me to get started with programming plugins =) Btw, i don't want to put you under pressure, but when do you think you will release the next tutorial? Keep up the good work!
Hi. I started programming in Java some weeks ago. I'm administrator of a Minecraft-Server and I'm currently programming a plugin for it. But there's one problem: When I copy this code into my Plugin.java-File I get an error at this line (it's in the constructor): Code: super(pluginLoader, instance, desc, plugin, plugin, cLoader); This is the error-message: Code: The constructor JavaPlugin(PluginLoader, Server, PluginDescriptionFile, File, ClassLoader) is undefined I think something has changed in the Plugin-API so this doesn't work anymore. It says that I should add another File-argument so that the constructor looks like this: Code: public D3Whitelist(PluginLoader, Server, PluginDescriptionFile, File, File, ClassLoader) But what is this File-object good for? Sorry, my English isn't that good but I hope you understand what I'm asking. ~haiyyu
The source you link to is the sample plugin on the wiki and is not related to the basic plugin. That tutorial is outdated and the new was is below. Replace with this. Code: public D3Whitelist(PluginLoader pluginLoader, Server instance, PluginDescriptionFile desc, File folder, File plugin, ClassLoader cLoader) { super(pluginLoader, instance, desc, folder, plugin, cLoader); } Hope that solves your problem.
Thanks a lot for this tutorial, I would have had to try to cannibalize half the plugins on the forum and gone partially insane without it!
Can't wait for the next tut I'll make sure I don't upload to the channel at the same time like we did with the reviews xD
I have not written Java code in a few years, but after watching the tutorial... I think I'll write a plugin this weekend... Thanks!
Thanks a lot for the tutorial. Great way to get my foot in the door of the world of Java. Edit: Probably just something dumb I did but I get this Jan 30, 2011 9:35:11 PM org.bukkit.plugin.SimplePluginManager loadPlugins SEVERE: Could not load plugins\Basic.jar in plugins: name is not defined org.bukkit.plugin.InvalidDescriptionException: name is not defined at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile.java:114) at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:29) at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:68) at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:117) at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:82) at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:43) at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:153) at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:140) at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:104) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:181) at net.minecraft.server.ThreadServerApplication.run(SourceFile:512) Any idea? It's my first plugin :/
This normally occurs with an iccorect yml file. Place it in the .jar Also make sure the yml file has new lines. ie Code: name: Name main: com.bukkit.samkio.Package.Name version: 1.00
Thanks Samkio. I'm going to try this now. Hmm...Same error This is mine: Name: Basic main: com.bukkit.seed419.basic.Basic Version: 0.3
It is Idk what to do. I've tried like every case combination possible, but it's com.bukkit.seed419.basic.Basic in eclipse. Actually, I'm getting a different error now...hold on let me double check everything...
Alright i did it all and the plugins name is obviously Kila and I can't figure out what I did wrong. I did what you said to do but this error came up SEVERE: Could not load plugins\Kila.jar in plugins: null org.bukkit.plugin.InvalidPluginException at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j ava:78) at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager. java:117) at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager .java:82) at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:42) at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:156) at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:143) at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:104) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:186) at net.minecraft.server.ThreadServerApplication.run(SourceFile:512) Caused by: java.lang.ClassNotFoundException: com.bukkit.Owner-PC_Owner.kila.kila at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader. java:30) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j ava:72)
Great tutorial, thanks! I program in C++ and PHP for a living...no prior experience with Java, and this tutorial was easy to follow.
Thanks for the tutorial, this is actually my first Java creation, so yeah. Your tut popped my Java cherry