Beginner Question

Discussion in 'Plugin Development' started by killgoblen, Jun 22, 2011.

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

    killgoblen

    Ok, so I solved my first problem, but I have another. Check the third post.

    And thanks for any help!
     
  2. Offline

    bleachisback

    You need this:
    Code:
    public void onPlayerDropItem(PlayerDropItemEvent  event){
     event.setCancelled(true);
    }
    
     
  3. Offline

    killgoblen

    Thanks! Now I know why it seemed weird compared to the other source code I'd looked at in the past...


    Now I have another question: I got that working, and now I'm trying to get it to send a message to the player who tried to drop the item. I did this:
    Code:
        public void onPlayerDropItem(PlayerDropItemEvent event){
            Player player = event.getPlayer();
            player.sendMessage("No item dropping! =D");
            event.setCancelled(true);
    
        }
    It still blocks the action, but it sends no message. What's wrong here?
     
  4. Offline

    Shamebot

    Did you recompile it? Looks right.
     
  5. Offline

    killgoblen

    Yes, I did recompile. I thought that might be the problem, too, so I recompiled it like 5 times. And yes, I did the whole export as Jar thing, so that shouldn't be the problem...
     
  6. Offline

    Shamebot

    Hhm comment the event.setCancelled(..) line out and check whether it doesn't block it anymore.
     
  7. Offline

    killgoblen

    Oh my god I'm an idiot... I've been typing the wrong command and getting the non-updated version from my desktop... *Facepalm*
     
  8. Offline

    wwsean08

    haha don't feel bad, i tested the same version for about an hour cause i kept recompiling the wrong one
     
Thread Status:
Not open for further replies.

Share This Page