test2.txt 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. p = read.player("kajetanjohannes");
  2. item = living.getEquip(p, "hand");
  3. item.clearAttributes(item);
  4. type = item.getType(item);
  5. if(type == "minecraft:leather_helmet") {
  6. item.addAttribute(item, "generic.armor", read.slot("head"), 5, 0);
  7. item.addAttribute(item, "generic.armor_toughness", read.slot("head"), 5, 0);
  8. item.addAttribute(item, "generic.knockback_resistance", read.slot("head"), 0.5, 0);
  9. }
  10. if(type == "minecraft:leather_chestplate") {
  11. item.addAttribute(item, "generic.armor", read.slot("chest"), 5, 0);
  12. item.addAttribute(item, "generic.armor_toughness", read.slot("chest"), 5, 0);
  13. item.addAttribute(item, "generic.knockback_resistance", read.slot("chest"), 0.5, 0);
  14. item.addAttribute(item, "generic.attack_speed", read.slot("chest"), 5, 0);
  15. }
  16. if(type == "minecraft:leather_leggings") {
  17. item.addAttribute(item, "generic.armor", read.slot("legs"), 5, 0);
  18. item.addAttribute(item, "generic.armor_toughness", read.slot("legs"), 5, 0);
  19. item.addAttribute(item, "generic.knockback_resistance", read.slot("legs"), 0.5, 0);
  20. item.addAttribute(item, "generic.max_health", read.slot("legs"), 20, 0);
  21. }
  22. if(type == "minecraft:leather_boots") {
  23. item.addAttribute(item, "generic.armor", read.slot("feet"), 5, 0);
  24. item.addAttribute(item, "generic.armor_toughness", read.slot("feet"), 5, 0);
  25. item.addAttribute(item, "generic.knockback_resistance", read.slot("feet"), 0.5, 0);
  26. item.addAttribute(item, "generic.movement_speed", read.slot("feet"), 0.05, 0);
  27. }
  28. /*z = entity.spawn("spider", entity.getLocation(p));
  29. entity.addEffect(z, "minecraft:speed", 999999, 10);
  30. entity.addEffect(z, "minecraft:regeneration", 999999, 3);
  31. entity.addEffect(z, "minecraft:strength", 999999, 12);
  32. entity.addEffect(z, "minecraft:fire_resistance", 999999, 1);
  33. living.setMaxHealth(z, 1000);
  34. living.heal(z, 2000);*/
  35. /*sgoto(3, "wusi");
  36. time = time.getMillis() + 100;
  37. msg("dev", "start");
  38. while(time.getMillis() < time) {
  39. msg("dev", time.getMillis(), " ", time);
  40. }
  41. msg("dev", "end");
  42. wait();
  43. term();
  44. @wusi
  45. msg("dev", "yes");*/