Uncollectable items

Discussion in 'Plugin Development' started by MrCreeper, Aug 26, 2011.

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

    MrCreeper

    Hey :)
    I want to spread some items as particles. Which is the best way to make those items uncollectable? =)
     
  2. Offline

    Shamebot

    Cancel the PlayerPickupItemEvent.
     
  3. Offline

    MrCreeper

    How can I mark the items as particles when I spread them?

    Code:java
    1. List<Integer> particles = new ArrayList<Integer>();
    2. particles.add(user.getWorld().dropItem(user.getLocation(), new ItemStack(264, 1)).getEntityId());


    Solved. :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 19, 2016
  4. Offline

    Shamebot

    Put them in a HashSet and check for them in the event.
    Edit: Use a hashSet instead of a ArrayList, it's faster.
     
Thread Status:
Not open for further replies.

Share This Page