PlayerPickupItemEvent not called !

Discussion in 'Spigot Plugin Development' started by MinusKube, May 1, 2015.

  1. Hello, I'm creating a plugin, but I have a problem with an event, the PlayerPickupItemEvent. He is not called.
    I'm not a novice, I didn't forget the @EventHandler and I've registered the events.

    I've made some searchs, but didn't find any solution.

    I'm running the version : git-Spigot-2ec6f06-7722428 (1.8.3), it's the latest version at this moment.
  2. gigosaurus


    You'll need to provide us with some code for us to be able to help you.
  3. Code of our on Beale and entire listener class. Also, is the plugin loaded for sure, are you 100% positive the most up to date version is on? Plus, is there any code inside the listener that could throw errors and error the event?
  4. There is no code to provide, just :

    Code (Text):
    public void pickupItem(PlayerPickupItemEvent e) {
        Bukkit.broadcastMessage("Picked up...");
    The plugin is loaded: I don't have any problem with any other event. I just downloaded the last version using BuildTools. Nothing can error the event, he is just not called.
  5. gigosaurus


    So if you put another event method just below that one, it works?
  6. Yes
  7. post all the code.
  8. I can't, my plugin has thousands of lines and hundreds classes.
  9. @MinusKube Change the version 1 version up and see if it updates on the server. I know it's a long shot but i've been stupid before and haven't exported it to the right place... Make sure it's 100% updating.
  10. I've already tried with a version little bit older than the last version.
  11. @MinuesKube Update the version to and go in game do /about Plugin and tell me if the version update to or not.
  12. gigosaurus


    He means change the plugin version so you can be sure that you're compiling and running the new plugin, and not just the old not-working one.
    • Agree Agree x 1
  13. I'm totally sure the plugin is exported, i've tried many debug messages :p

    I forgot to say it, but players can't pickup the items, even if I don't cancel any PlayerpPlayerPickupItem event.
  14. Ahhh, maybe another plugin is overriding it? Idk... Change the event's priority to the HIGHEST and set it to ignorecancelled true and see if that does anything.... Honestly, I don't see a problem with your code at all so Idk what the problem would be.
  15. gigosaurus


    Do you have any other plugins running on the server or any other event handlers that are using PlayerPickupItemEvent?
    • Creative Creative x 1
  16. Even if another plugin was overriding it, my event would be called.
    I think it's a kind of bug or maybe I made something wrong but I don't see where...

    I do, but even if I remove them, the probel is still here. All the Plugins on the server have been created by myself (There are 2 Plugins)
  17. @MinusKube Yea... I don't know what to tell you man. Don't give up though :). I gotta get off so if you want any more help I can chat in the morning, I hope I helped maybe a tiny bit... :p
  18. Yeah, thanks for your help.
  19. gigosaurus


    The bug isn't to do with spigot because it works fine for me, so you must have some code somewhere that's messing with it.
  20. Okay, I don't see what is the problem :-/

    EDIT : I found the solution ! It was the ((CraftPlayer) p).spigot().setCollidesWithEntities(true); who was removing collides with items =p
    #20 MinusKube, May 1, 2015
    Last edited: May 1, 2015