Programming Bukkit Plugins for Beginners

Discussion in 'Resources' started by Wundark, Mar 4, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Wundark

    Hey there,

    I had some requests from people who are beginners, for how to make plugins and to explain and take time to show them what lots of the complex parts do and how they function.

    I will be making videos on:
    • How to make Bukkit Plugins.
    • 20 Minute Plugin. (I will be given a task for a plugin to do and I will try and make it within 20 minutes)

    Playlist Link:
    http://www.youtube.com/playlist?list=PL8CE0F0AEE64D4461
     
    toastonrye, nhoclesnar and VicHardy like this.
  2. Offline

    Wundark

    Second Video is up!

     
    nhoclesnar, HunterT and VicHardy like this.
  3. Offline

    TheClaus

    This was helpful. Keep it up.
     
  4. Offline

    XandalorZ

    Thank you for this. Hopefully start making some plugins soon. :)
     
  5. Offline

    Wundark

    Latest Video

     
    nhoclesnar and VicHardy like this.
  6. Offline

    fishiecracker

    I'm having trouble with the "plugin.blockProtection.add(l);" part, it says "no suitable method found for add(org.bukkit.Location)" Any ideas? Otherwise Great tutorials!
     
  7. Offline

    Wundark

    We made a variable called 'l' which stores the 'Location' of the block.

    You can't add the Location Type to the array.

    Blow is the code for that section:

    PHP:
        @EventHandler
        
    public void blockProtect(PlayerInteractEvent event){
            
    Location l event.getClickedBlock().getLocation();
           
            if(
    event.getPlayer().getItemInHand().getType() == Material.SLIME_BALL && event.getAction() == Action.RIGHT_CLICK_BLOCK){
                if(
    plugin.blockProtecion.contains(l)){
                    
    event.getPlayer().sendMessage(ChatColor.RED+"This block is already protected");
                }else{
                    
    plugin.blockProtecion.add(l);
                    
    event.getPlayer().sendMessage(ChatColor.BLUE+"This block has now been protected");
                }
            }
        }
     
  8. Offline

    tymcneer

    Excellent video! Well prepared, and throughly explained.

    Please keep up the great work.

    Ty

    PS The entire reason I went from lurking to membership was to post this. :)
     
    VicHardy likes this.
  9. Offline

    cubesteak

  10. Offline

    Wundark

  11. Offline

    DaveK

    nice work .. clear voice... good explained.. keep up the great work. I was looking for new vidoes about the new api and how to get started with plugins... thx
     
  12. Offline

    VicHardy

    Awesome. This is much more concise and clear than other tutorials i've watched so far... AND up to date. :)
     
  13. Offline

    DaveK

    thats right... the best thing --> up to date, thats true... cant wait for more tutors... i really have to know hoe to make own blocks with own textures... anyone now a good tutor for this?
     
  14. Offline

    Wundark

    Thats either Spout or making a Client Mod.
     
  15. Offline

    DaveK

    there must be a way without spout or? and i would do it as a plugin, not a mod. there exist a lot of plugins allrady with heaps of new blocks like computercraft, buildcraft etc.... and for this one you dont need spout :(
     
  16. Offline

    VicHardy

    DaveK

    either Spout or making a Client Mod

    So Either / Or.

    BuildCraft / IC2 / ComputerCraft etc.
    Have Client mods
     
  17. Offline

    DaveK

    thanks... after hours looking arround i am so far does i know now i have to use spout for the idea what i got and want to do. Now i stuck on the next problem. I really cant find any good tutorials how to start with spout plugin programming. I all ready looked into the spout side tutorials but they dont really help me very much. Does someone now a few good tutorials how to get started to make plugins with / for spout?
     
  18. Offline

    Pancake37

  19. Offline

    DaveK

  20. Offline

    Pancake37

    So you can do it? I have absoutly no clue how to do it
     
  21. Offline

    Musaddict

    The realistic water mod is a client mod. It changes the look of your client only. Server mods (plugins) can't change the way your client looks (unless if you're using Spout, but even then I'm not sure that THIS kind of modding is possible, even with Spout).

    If you want realistic water, you need to manually alter your own client. Otherwise it's not possible.
     
  22. Offline

    tedhead2

    Very good tutorials, they have helped me very much.

    I would really like to see a tutorial on potion effects and enchanting.
     
  23. Offline

    diegoa1997

    i am really greatful for this i dont know anything about plugins and i want to make one that helps with my hunger games server so plz keep up becasue u are helping make thoes small baby steps
     
  24. Offline

    Wundark

  25. Offline

    DaveK

    YAY another video... i will try this out right now.. i love you videos ...
     
  26. Offline

    Mr_H4mm3r

    Can you please add a video showing how to add different languages? And maybe more explaining the config stuff? :)
     
  27. Offline

    Wundark

    I only make English Videos. Yes, I will do some more very in depth videos.


    Thanks, You guys are great!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 24, 2016
  28. Offline

    Mr_H4mm3r

    Wundark You didn't understood me right.. I wanted to see how I can make a plugin with different languages in.. Like I can have a file called; language_en.yml = English and a language_dk.yml = Danish.. In the config there will be a option; Langauge: en // Or dk
     
  29. Offline

    Oplosthee

    Mr_H4mm3r, Wouldn't it be easier to make one messages file, where every message is stored in so the people could change it? Instead of having different files for every language.
    TLDR: Make (error)messages changeable using a config file.
     
  30. Offline

    DaveK

    hi, i get an errormessage

    error log from server
    Show Spoiler

    Code:
    2012-04-16 22:21:37 [INFO] Starting minecraft server version 1.2.5
    2012-04-16 22:21:37 [INFO] Loading properties
    2012-04-16 22:21:37 [INFO] Starting Minecraft server on *:25565
    2012-04-16 22:21:37 [INFO] This server is running CraftBukkit version git-Bukkit-1.2.5-R1.0-b2149jnks (MC: 1.2.5) (Implementing API version 1.2.5-R1.0)
    2012-04-16 22:21:37 [INFO] [Spout] Loading Spout v1099
    2012-04-16 22:21:37 [INFO] [TestPlugin] Loading TestPlugin v0.1
    2012-04-16 22:21:37 [INFO] [Spout] Enabling Spout v1099
    2012-04-16 22:21:37 [INFO] Preparing level "world"
    2012-04-16 22:21:37 [INFO] Default game type: 0
    2012-04-16 22:21:37 [INFO] Preparing start region for level 0 (Seed: -7297082926360528119)
    2012-04-16 22:21:38 [INFO] Preparing start region for level 1 (Seed: -7297082926360528119)
    2012-04-16 22:21:38 [INFO] Preparing spawn area: 77%
    2012-04-16 22:21:38 [INFO] Preparing start region for level 2 (Seed: -7297082926360528119)
    2012-04-16 22:21:39 [INFO] [TestPlugin] Enabling TestPlugin v0.1
    2012-04-16 22:21:39 [SEVERE] Error occurred while enabling TestPlugin v0.1 (Is it up to date?)
    java.lang.NullPointerException
        at com.github.icedave.testplugin.TestPlugin.onEnable(TestPlugin.java:38)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:215)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:336)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:381)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:250)
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:232)
        at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:371)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:358)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:187)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:422)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:492)
    2012-04-16 22:21:39 [INFO] Server permissions file permissions.yml is empty, ignoring it
    2012-04-16 22:21:39 [INFO] Done (1.520s)! For help, type "help" or "?"
    2012-04-16 22:21:42 [INFO] CONSOLE: Stopping the server..
    2012-04-16 22:21:42 [INFO] Stopping server
    2012-04-16 22:21:42 [INFO] [Spout] Disabling Spout v1099
    2012-04-16 22:21:42 [INFO] [TestPlugin] Disabling TestPlugin v0.1
    2012-04-16 22:21:42 [INFO] Saving chunks
    


    Plugin.jar
    Show Spoiler

    Code:
    package com.github.icedave.testplugin;
     
    import java.util.List;
    import java.util.logging.Logger;
     
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandExecutor;
    import org.bukkit.command.CommandSender;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerJoinEvent;
    //import org.bukkit.plugin.PluginDescriptionFile;
    import org.bukkit.plugin.java.JavaPlugin;
     
    public class TestPlugin extends JavaPlugin
    {
        Logger log = Logger.getLogger("Minecraft");
       
     
        public void onDisable()
        {
            //PluginDescriptionFile pdfFile = this.getDescription();
            //log.info(String.format("[%s] version %s disabled", pdfFile.getName(), pdfFile.getVersion()));
        }
     
        public void onEnable()
        {
            //PluginDescriptionFile pdfFile = this.getDescription();
            //log.info(String.format("[%s] version %s enabled", pdfFile.getName(), pdfFile.getVersion()));
           
            getServer().getPluginManager().registerEvents(new Listener(){
                @EventHandler
                public void playerjoin(PlayerJoinEvent e){
                    e.getPlayer().sendMessage(getConfig().getString("loginmessage"));
                }
            }, this);
           
            getCommand("rules").setExecutor(new CommandExecutor(){
                public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
                    List<String> rules = getConfig().getStringList("rules");
                    for (String rule : rules){
                        sender.sendMessage(rule);
                    }
                    return true;
                }
            });
            getConfig().options().copyDefaults(true);
            saveConfig();
        }
    }



    config.yml

    Show Spoiler


    loginmessage: Welcome to my Server
    rules:
    - Play Nice.
    - Don't Grief.




    If i connect to my server i get the welcome message but i get *unknow command* error if i try that command.
    could someone help why thats happen? i got no clou at all
     
Thread Status:
Not open for further replies.

Share This Page