Solved Not working command

Discussion in 'Plugin Development' started by zoltanvarga18, Jun 28, 2017.

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

    zoltanvarga18

  2. Offline

    yPedx

    @zoltanvarga18
    1. You don't need to log your own plugins, Bukkit does this automatically.
    2. Don't cast sender to player before checking if the sender is a player. What if the sender is the console? It will result in an error, as the plugin cannot add items to the console's inventory - which doesn't exist.
    3. You don't need to implement CommandExecutor if the command is in your main class.
    4. Instead of returning false, return true.
     
  3. Offline

    zoltanvarga18

    @yPedx
    Thank you! I fixed that problems, but it still doesn't works.
     
    Last edited: Jun 28, 2017
  4. Offline

    yPedx

    @zoltanvarga18
    Please post your updated code. What happens? Anything in console? Could you upload a screenshot of what is sent in-game?
    EDIT: And another thing, why are you registering all events in your main class, when it doesn't have any events? No need for that then :p
     
  5. Offline

    zoltanvarga18

  6. Offline

    Horsey

    @yPedx @zoltanvarga18 you do need to implement CommandExecutor in the main class, you don't need to use getCommand().setExecutor(); but you do need to implement CommandExecutor

    There's no need to implement Listener if you don't have any events.
     
  7. Offline

    timtower Administrator Administrator Moderator

  8. Offline

    Horsey

    @timtower huh I didn't know that :p
    Well you learn something new everyday I guess xD
     
  9. Offline

    zoltanvarga18

    Thank you for your kindness, but the command is not working. I think I will give up. :(
     
  10. Offline

    timtower Administrator Administrator Moderator

  11. Offline

    zoltanvarga18

Thread Status:
Not open for further replies.

Share This Page