/item

Discussion in 'Plugin Development' started by shade2010, Feb 9, 2011.

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

    shade2010

    so i love to code but just started started learning java let alone bukkit 2 days ago... and yes that time frame is literal.

    I'm running into an error which I can't get right now as my server admin is offline, but in a short description, the command works fine, its really badly coded of course haha as im just starting... it will eventually use a switch case and have more functions built in. ANYWHO the command has the following syntax :: /item(or /i) <itemid> <amount>
    the command works fine :) glad to say, except that after its been initiated it blocks all further commands other then itself, and gives an error when they are used... im not sure why.

    all code except for the pm.register PLAYER_COMMAND event playerlistener call in the main .java file, is in this. (the itemPlayerListener.java)

    http://pastebin.com/Ks08eHGD
     
  2. Offline

    nickthemenace

    I would guess it's this, try removing it:

    Line 68: event.setCancelled(true);


    Edit: Actually, it looks like you might want to keep it in, in which case you could try switching lines 67 and 68 (looks to me like you might want to call that line if the player uses the /item command, not whenever he sends any command at all.)
     
  3. Offline

    shade2010

    ill try it thanks
    --- merged: Feb 10, 2011 4:13 AM ---
    from what i can see that actually works, i just miscounted my brackets, but i actually moved around lines 69 and just put it after 39 as well as move around declaration and setting the values of some variables so that if the command isn't initialized, the data never needs used.
     
Thread Status:
Not open for further replies.

Share This Page