Solved Custom Inventory

Discussion in 'Plugin Development' started by ShadowBalrog, Apr 8, 2014.

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

    ShadowBalrog

    Hey I've recently started coding, and don't understand what's wrong with my code. My plugin plan is when you type /smallbackpack (as shown in the example below!) it would open up a 9 slot inventory labbeled small backpack. Please help out, I can't find what's wrong with it!

    Link for my code: http://pastebin.com/h8R4HYjQ
     
  2. Offline

    Serializator

    1. Put @Override above the onEnable(); and onCommand();
    2. Put a "return true" in the onCommand(); if the command is used right.
    3. Put a cmd.getName().equalsIgnoreCase(); or commandLabel.equalsIgnoreCase(); in onCommand();.
     
  3. Offline

    iPoke111

    Serializator
    It is good practice to put @Override and return true in those places, but in my experience it has never failed my plugin when I forgot to put it in...

    ShadowBalrog
    Have you registered your command in your plugin.yml?

    EDIT: Also, in your code you have the command saying /backpack, not /smallbackpack
     
  4. Offline

    Serializator

    iPoke111, it is better to do it. It is not for nothing in the tutorial to :p
     
  5. Offline

    iPoke111

    Serializator
    *shrug* it doesn't actually answer the OP's question in any way, though. They asked why it wasn't working, what you said was etiquette. (not trying to start a flame war)
     
  6. Offline

    Serializator

    iPoke111, alright. But he needs to return true in the onCommand(); to.
     
  7. Offline

    iPoke111

  8. Offline

    ShadowBalrog

    Thanks guys! Turns out it was to do with the smallbackpack and backpack command! Anyway thanks for the great help and a good sense of community round here!
     
Thread Status:
Not open for further replies.

Share This Page