Can't pickup items?

Discussion in 'Plugin Development' started by pkt, Feb 2, 2013.

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

    pkt

    For some odd reason, the mob drops the items... but I can't pick them up..
    Code:
                List<ItemStack> drops = new ArrayList<ItemStack>();
                for (String s : newDrop) {
                    int id = 0;
                    byte meta = 0;
                    int amt = 0;
                    short dmg = 0;
     
                    String[] split = s.split(":");
                    if (split.length == 4) {
                        String idS = split[0];
                        String metaS = split[1];
                        String amtS = split[2];
                        String dmgS = split[3];
     
                        try {
                            id = Integer.parseInt(idS);
                            meta = Byte.parseByte(metaS);
                            amt = Integer.parseInt(amtS);
                            dmg = Short.parseShort(dmgS);
     
                            ItemStack newItem = new ItemStack(id);
                            newItem.setAmount(amt);
                            newItem.getData().setData(meta);
                            newItem.setDurability(dmg);
                            drops.add(newItem);
                        } catch (Exception e) {
                            id = 0;
                            meta = 0;
                            amt = 0;
                            dmg = 0;
                        }
                    }
                }
                event.getDrops().addAll(drops);
            }
     
  2. Offline

    KeybordPiano459

    pkt
    And you can pick items up other than those mob drops? Do you have any plugins that cancel the PlayerPickupItemEvent?
     
  3. Offline

    pkt

    nope its just the drops from this code I cant pickup
     
  4. Offline

    pkt

    Sorry I've been away from this topic for so long, but does anyone know the problem, or solution?
     
Thread Status:
Not open for further replies.

Share This Page