12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- p = read.player("kajetanjohannes");
- item = living.getEquip(p, "hand");
- item.clearAttributes(item);
- type = item.getType(item);
- if(type == "minecraft:leather_helmet") {
- item.addAttribute(item, "generic.armor", read.slot("head"), 5, 0);
- item.addAttribute(item, "generic.armor_toughness", read.slot("head"), 5, 0);
- item.addAttribute(item, "generic.knockback_resistance", read.slot("head"), 0.5, 0);
- }
- if(type == "minecraft:leather_chestplate") {
- item.addAttribute(item, "generic.armor", read.slot("chest"), 5, 0);
- item.addAttribute(item, "generic.armor_toughness", read.slot("chest"), 5, 0);
- item.addAttribute(item, "generic.knockback_resistance", read.slot("chest"), 0.5, 0);
- item.addAttribute(item, "generic.attack_speed", read.slot("chest"), 5, 0);
- }
- if(type == "minecraft:leather_leggings") {
- item.addAttribute(item, "generic.armor", read.slot("legs"), 5, 0);
- item.addAttribute(item, "generic.armor_toughness", read.slot("legs"), 5, 0);
- item.addAttribute(item, "generic.knockback_resistance", read.slot("legs"), 0.5, 0);
- item.addAttribute(item, "generic.max_health", read.slot("legs"), 20, 0);
- }
- if(type == "minecraft:leather_boots") {
- item.addAttribute(item, "generic.armor", read.slot("feet"), 5, 0);
- item.addAttribute(item, "generic.armor_toughness", read.slot("feet"), 5, 0);
- item.addAttribute(item, "generic.knockback_resistance", read.slot("feet"), 0.5, 0);
- item.addAttribute(item, "generic.movement_speed", read.slot("feet"), 0.05, 0);
- }
- /*z = entity.spawn("spider", entity.getLocation(p));
- entity.addEffect(z, "minecraft:speed", 999999, 10);
- entity.addEffect(z, "minecraft:regeneration", 999999, 3);
- entity.addEffect(z, "minecraft:strength", 999999, 12);
- entity.addEffect(z, "minecraft:fire_resistance", 999999, 1);
- living.setMaxHealth(z, 1000);
- living.heal(z, 2000);*/
- /*sgoto(3, "wusi");
- time = time.getMillis() + 100;
- msg("dev", "start");
- while(time.getMillis() < time) {
- msg("dev", time.getMillis(), " ", time);
- }
- msg("dev", "end");
- wait();
- term();
- @wusi
- msg("dev", "yes");*/
|