Simple ban/kick/unban not working.

Discussion in 'Plugin Development' started by diamob, Oct 1, 2016.

Thread Status:
Not open for further replies.
  1. So basically I made this plugin (my first plugin) that would ban someone when I type /b {name} , kick when I type /k {name} and /ub {name} for unban. However the plugin.yml seems to work fine but when I type the command nothing happens...

    The nodes are:
    - fastmoderation.ban
    - fastmoderation.unban
    - fastmoderation.kick

    Here is the code:
    http://pastebin.com/WLWBqC94
    Here is a download link if you want to see what happens when you type in one of the commands:
    https://www.dropbox.com/s/cwtv2vz0plrga64/FastM.jar?dl=0

    btw for some reason on eclipse it shows some words with a strike through them:
    http://prntscr.com/coh0im

    Thanks in advance.
     
  2. Offline

    timtower Administrator Administrator Moderator

    Moved to plugin development.

    @diamob
    1. Don't use that logger, if you log, use getLogger() instead
    2. Don't log in the onEnable and onDisable, Bukkit does that for you.
    3. Please post your plugin.yml
    4. Hover your mouse over them, they are deprecated, means that they might be removed, the getPlayer(name) won't though, that one is to get attention to the UUID changes
     
  3. Would it be possible if you could edit my script and post it on pastebin or something? I'm new to java programming. Also when I hover over them it says to add @supresswarning but when I do it still stays the same but only removes the yellow line underneath.


    plugin.yml:
    http://pastebin.com/1CaZuwgr
     
    Last edited: Oct 1, 2016
  4. Offline

    timtower Administrator Administrator Moderator

    That would be considered spoonfeeding what I don't do.
    And that suppress warnings is the only way to get rid of it.
    Writing Bukkit plugins also requires a decent Java knowledge, not just some copy paste stuff.
     
  5. @diamob
    We won't write your code for you, that's your job.

    Also, @SupressWarnings just means that it doesn't alert you of the warnings in your code, in most cases that is not the proper solution, you should fix the problem instead.
     
  6. Thanks for the help and fast replies. Also why are all posts moderated?
     
  7. Offline

    timtower Administrator Administrator Moderator

    You are a new user, new users are moderated.
     
  8. @timtower

    Btw when creating my project in Eclipse I clicked create new Java Project, I saw other click New Project then click Maven. Maybe that is why my plugin displays nothing when I use the command?
     
  9. Offline

    timtower Administrator Administrator Moderator

    @diamob Has nothing to do with it.
    That is just how eclipse finds all needed classes.
    Updated code? Server log?
     
  10. I'l work on the plugin tomorrow I was working on one of my old plugins which didn't seem to work. here is the code (btw everything seems to be alright no errors or warnings in eclipse or the server log.) :
    code: http://pastebin.com/ND8krx3V
    plugin.yml: http://pastebin.com/Vr04i1Vy
    It is suppose to be like a broadcasting plugin. So when I type /a hello it should say in the chat:
    [Announcement] hello
    also it should restrict the console from using the command.
     
    Last edited: Oct 1, 2016
  11. Offline

    timtower Administrator Administrator Moderator

    @diamob Your current code requires 2 arguments, not 1 so hello wouldnt work.
    Nor do you say anything when the statements return false which can give the impression that it is broken.
     
  12. @timtower
    I added the last return false because line 23 gives an error if it isn't there.
     
  13. Offline

    Zombie_Striker

    @diamob
    What is the error? Can you post the full error log?
     
  14. @Zombie_Striker

    This is what it says:
    This method must return a result of type boolean
     
Thread Status:
Not open for further replies.

Share This Page