test.txt 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. cloth_code_map = map.new();
  2. map.add(cloth_code_map, "dark_gray", 4673362);
  3. map.add(cloth_code_map, "cyan", 1481884);
  4. map.add(cloth_code_map, "red", 11546150);
  5. map.add(cloth_code_map, "blue", 3949738);
  6. map.add(cloth_code_map, "orange", 16351261);
  7. map.add(cloth_code_map, "green", 6192150);
  8. map.add(cloth_code_map, "gray", 10329495);
  9. map.add(cloth_code_map, "white", 16383998);
  10. map.add(cloth_code_map, "pink", 15961002);
  11. map.add(cloth_code_map, "purple", 8991416);
  12. map.add(cloth_code_map, "yellow", 16701501);
  13. map.add(cloth_code_map, "lime", 8439583);
  14. player = read.player("marvinius");
  15. loc = entity.getLocation(player);
  16. ent = entity.spawn("zombie", loc, "{IsBaby:0}");
  17. living.removeAi(ent);
  18. entity.setName(ent, "");
  19. entity.setSilent(ent, true);
  20. amongus.forceEquip(ent, "blue");
  21. function amongus.forceEquip(entity, color) {
  22. color_code = map.get($cloth_code_map, color);
  23. item = read.item(concat("{id:\"minecraft:leather_helmet\",Count:1b,tag:{Damage:0,display:{color:", color_code, "}}}"));
  24. item.hide(item, "attributes");
  25. entity.setEquip(entity, "head", item);
  26. item = read.item(concat("{id:\"minecraft:leather_chestplate\",Count:1b,tag:{Damage:0,display:{color:", color_code, "}}}"));
  27. item.hide(item, "attributes");
  28. entity.setEquip(entity, "chest", item);
  29. item = read.item(concat("{id:\"minecraft:leather_leggings\",Count:1b,tag:{Damage:0,display:{color:", color_code, "}}}"));
  30. item.hide(item, "attributes");
  31. entity.setEquip(entity, "legs", item);
  32. item = read.item(concat("{id:\"minecraft:leather_boots\",Count:1b,tag:{Damage:0,display:{color:", color_code, "}}}"));
  33. item.hide(item, "attributes");
  34. entity.setEquip(entity, "feet", item);
  35. }