Programming Help

Discussion in 'Plugin Development' started by czaarek99, Jun 18, 2012.

Thread Status:
Not open for further replies.
  1. I did try to learn a bit of coding from youtube by doing a plugin its Called BlockChanger.
    Yes i know im not the only 1 but im just trying to learn some.
    Okey but the video is a bit outdated and i get 1 error!
    This is the code of the main class:
    And this is the BlockChangerListener class:
    Theres here i get the error the error is right next to the [X]
    The thing marked with red is the thing marked with red by eclipse!
    Plzz help me with this!
     
  2. Offline

    coldandtired

    The video is outdated and still showing the old way.

    Your listener class needs to implement Listener (not extend BlockListener).
     
  3. Then how should i change the code then?

    The same problem!

    Ok i got it but still the same problem:
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 26, 2016
  4. Offline

    coldandtired

    You imported the wrong Listener. The one you're using is javax.xml.bind.Marshaller.Listener but it needs to be org.bukkit.event.Listener.

    Delete those three imports and select the right one from the list (assuming you're using Eclipse).
     
  5. Ok done still the same thing:
     
  6. Offline

    TnT

    Moved to correct forum.
     
  7. Offline

    Slayer9x9

    What exactly is the error you're getting?
     
  8. Heres a picture of the error:
    [​IMG]
    It dosnt work putting {}
    or just }
    or just {
    I have tried
    I give you the project in a zip if it helps!

    Oops heres the link to the project:
    https://dl.dropbox.com/u/38237670/BlockChanger.zip

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Dec 22, 2020
  9. Offline

    Slayer9x9

  10. Offline

    r0306

    czaarek99
    The error clearly states that you are missing a bracket.
    Code:
    public class BlockChangerListener implements Listener
    { //here
     
    public static BlockChanger plugin;
     
    public BlockChangerListener(BlockChanger instance)
    {
     
    plugin = instance;
     
    }
    @EventHandler
    public void onBlockDamage(BlockDamageEvent event)
    {
    if(plugin.enabled(event.getPlayer()))
    event.getBlock().setTypeId(7);
    }
     
     
    }
     
  11. Offline

    tabr

  12. Im gon a try these solutions tomorrow guys!
    Thanks!

    r0306 I think i tried the though!

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

    r0306

    You have? Can you post the updated code below?
     
  14. I said i think i have i cant use the computer in like 40 minutes from now!
    Im going to try again but as i said i THINK i tried it.

    Ok got the plugin to work but i got another problem in the plugin.yml file!
    Plzz help me!
    The console errors: http://pastebin.com/C8HUywPZ
    The plugin.yml: http://pastebin.com/VURBrE93
    And thanks for all the help i alredy got from you guys!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 26, 2016
  15. ferrybig likes this.
  16. Offline

    r0306

  17. Offline

    r0306

Thread Status:
Not open for further replies.

Share This Page