Weird PlayerPickupItemEvent issue.

Discussion in 'Plugin Development' started by justin_393, Aug 30, 2014.

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

    justin_393

    I'm trying to make a plugin to where whenever a player picks up an xp orb they get so much help, but when they pick up the xp or, all they get is the xp and no health. Here's my code:

    Code:java
    1. @EventHandler(priority = EventPriority.HIGHEST)
    2. public void onPickup(PlayerPickupItemEvent event) {
    3. Player player = event.getPlayer();
    4. if (event.getItem().getType() == EntityType.EXPERIENCE_ORB) {
    5. player.setHealth(player.getHealth()
    6. + core.getConfig().getInt("Health"));
    7. }
    8.  
    9. }


    Anyone have any ideas?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 10, 2016
  2. Offline

    Fhbgsdhkfbl

    justin_393
    Only bump every 24 hours, not 20 minutes.
    Do you have your events registered?
     
  3. Offline

    justin_393

  4. Offline

    Fhbgsdhkfbl

    justin_393
    Have you tried debugging to see where it stops with printing lines?
     
  5. Offline

    justin_393

Thread Status:
Not open for further replies.

Share This Page