test2.txt 431 B

1234567891011121314151617
  1. test(read.player("marvinius"));
  2. test(read.player("kajetanjohannes"));
  3. function test(player) {
  4. a = item.custom.getAll();
  5. iter = iterator(a);
  6. while(hasNext(iter)) {
  7. player.safeGiveItem(player, item.custom.new(next(iter)));
  8. }
  9. }
  10. function player.safeGiveItem(player, item) {
  11. rest_item = player.giveItem(player, item);
  12. if(item.getAmount(rest_item) > 0) {
  13. item.drop(entity.getLocation(player), rest_item);
  14. }
  15. }