Destroying itemdrops

Discussion in 'Plugin Development' started by fullwall, Feb 16, 2011.

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

    fullwall

    I am working on a plugin that requires the destroying of items dropped on the ground. How would I do this? I have tried setting the material to air, but that just creates a null pointer exception. I would try to cast to EntityItem so I can use EntityItem.q() to kill it, but I can't seem to get it to be cast to EntityItem without errors. Can anyone help?
    --- merged: Feb 16, 2011 5:30 PM ---
    Never mind - casting to CraftItemDrop worked.
     
  2. Offline

    recanu

    Use this:
    Code:
    CraftItemDrop iD;
    EntityItem eI = (EntityItem) iD.getHandle();
    eI.q();
    
    Works, atleast in my plugin DropBuild.

    Edit:
    Damn, didn't see you already found a solution :p
     
Thread Status:
Not open for further replies.

Share This Page