- 318
- 12
Как сделать что бы броня компенсировала весь урон от дамага определенного оружия
Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
if (event.source != null) {
if (event.source.isDifficultyScaled()) {
event.ammount = 0.0F;
}
}
EntityLivingBase to = event.entityLiving;//Кому наноситься урон,
if (to instanceof EntityPlayer) {
EntityPlayer player_to = (EntityPlayer)to;
ItemStack current_to = player_to.getCurrentEquippedItem();//Что дерижит кому наносится урон
ItemStack helm_to = player_to.getCurrentArmor(3);//Что в слоте шлема кому наносится урон
ItemStack chest_to = player_to.getCurrentArmor(2);//Что в слоте нагрудника кому наносится урон
ItemStack legs_to = player_to.getCurrentArmor(1);//Что в слоте штанов кому наносится урон
ItemStack boot_to = player_to.getCurrentArmor(0);//Что в слоте ботинок кому наносится урон
}
event.ammount = 0.0F;
armor[j].damageItem((int)event.ammount, player_to);
e.ammount = 0.0F;