Custom drop pickup

Discussion in 'Plugin Development' started by HackintoshMan, May 21, 2013.

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

    HackintoshMan

    I am looking to create a custom drop (flag) and I need to detect if a player picks it up. I have no idea how to do this:eek: which is why Im here. I don't expect you to feed me code, but examples would be great!
     
  2. Offline

    TheUpdater

    playermoveevent and check if its the item
     
  3. Offline

    JWhy

    Set an identification of the item to it's metadata, then check on every ItemPickupEvent (or whatever it was called) if the picked up item has the metadata
     
  4. Offline

    TheUpdater

    check if player moves on the item

    make so thay cant pick it up then check if player is on it then thay can pick it up
     
  5. Offline

    Minnymin3

    Isnt there an event like PlayerPickupItemEvent or something?
     
  6. Offline

    HackintoshMan

    How do I spawn a dropped item?

    Bump

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

    Paper

  8. Offline

    HackintoshMan

    Paper
    Thanks…now how to use an ItemStack:p
     
  9. Offline

    Paper

    HackintoshMan
    Location loc = new Location("world", 0, 0, 0);
    Itemstack is = new ItemStack(Material.yourMaterial);
    yourWorld.dropItem(loc, is);

    Btw, I'm not sure if its dropItem or dropItemNaturally, both should do the same.
     
  10. Offline

    HackintoshMan

    I used dropItem, naturally might make it go away…I hope dropItem keeps it there
     
  11. Offline

    MrTwiggy

    The only difference between dropItem and dropItemNaturally is that dropItemNaturally randomizes the spawn location a bit. So if you put in the location for (0,0,0) and use dropItemNaturally, the item might spawn at (0.2, 0.13, 0.04)
     
  12. Offline

    HackintoshMan

    Can I make a new ID for the drop? Like how dirt is 1 or 2 or I have no idea. But could I assign it 982?
     
  13. Offline

    HackintoshMan

Thread Status:
Not open for further replies.

Share This Page