Picking up items!! :D

Discussion in 'Plugin Development' started by MrGermanrain, Aug 13, 2013.

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

    MrGermanrain

    How do I make it so that someone can not pickup items?
     
  2. Offline

    etaxi341

  3. Offline

    MrGermanrain

    what would that look like, im sorry D:

    btw... I love your Germarican Status :p
     
  4. Offline

    etaxi341

    MrGermanrain Wait a moment I will write it.

    MrGermanrain
    Code:java
    1. @EventHandler
    2. public static void NoPickup(PlayerPickupItemEvent ev){
    3. ev.setCancelled(true);
    4. }


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

    herpingdo


    Let me tell you what is wrong with your code. First off, you made the method static, which is not required for event handling methods, and I think it is also bad form. Second, you made the "N" in `NoPickup()` capitalized. This is again bad form/conventions. Use a lowercase letter for the first character of method and variable names!
     
  6. Offline

    etaxi341

Thread Status:
Not open for further replies.

Share This Page