int removedDrops = removeItemDrops(player, 128);
player.sendChatMessage("Cleared " + removedDrops + " item drop(s).");
}
public static int removeItemDrops(Player player, int radius) {
Coordinate pos = player.getPosition();
World world = player.getWorld().getMinecraftWorld();
AxisAlignedBB boundingBox = AxisAlignedBB.getBoundingBox(
pos.getX() - radius, pos.getY() - radius, pos.getZ() - radius,
pos.getX() + radius, pos.getY() + radius, pos.getZ() + radius
);
List<?> nearbyEntities = world.getEntitiesWithinAABBExcludingEntity(
player.getMinecraftPlayer(), boundingBox
);
int removedDrops = 0;