Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package melonslise.runicinscription.common.item;
- import melonslise.runicinscription.RunicInscription;
- import melonslise.runicinscription.common.entity.player.PropertiesMana;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.world.World;
- public class ItemScrollHeal extends Item
- {
- @Override
- public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
- {
- if (!world.isRemote)
- {
- PropertiesMana properties = PropertiesMana.get(player);
- if (properties.consumeMana(15) == true)
- {
- player.heal(5);
- world.playSoundAtEntity(player, RunicInscription.ID + ":BlessingCast", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
- for (int a = 0; a < 10; ++a)
- {
- player.worldObj.spawnParticle("happyVillager", player.posX + 1.0D, player.posY - 1.0D + a * 0.2, player.posZ, 0.0D, 0.7D, 0.0D);
- player.worldObj.spawnParticle("happyVillager", player.posX - 1.0D, player.posY - 1.0D + a * 0.2, player.posZ, 0.0D, 0.7D, 0.0D);
- player.worldObj.spawnParticle("happyVillager", player.posX, player.posY - 1.0D + a * 0.2, player.posZ + 1.0D, 0.0D, 0.7D, 0.0D);
- player.worldObj.spawnParticle("happyVillager", player.posX, player.posY - 1.0D + a * 0.2, player.posZ - 1.0D, 0.0D, 0.7D, 0.0D);
- }
- if (!player.capabilities.isCreativeMode)
- {
- --itemStack.stackSize;
- }
- }
- }
- return itemStack;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement