Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ed.enderdeath.mod.Tool;
- import cpw.mods.fml.common.FMLLog;
- import cpw.mods.fml.common.eventhandler.Event.Result;
- import cpw.mods.fml.relauncher.Side;
- import cpw.mods.fml.relauncher.SideOnly;
- import ed.enderdeath.mod.common.enderdeath;
- import net.minecraft.block.Block;
- import net.minecraft.command.IEntitySelector;
- import net.minecraft.enchantment.Enchantment;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.item.EntityItem;
- import net.minecraft.entity.monster.EntityMob;
- import net.minecraft.entity.passive.EntityAnimal;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.init.Blocks;
- import net.minecraft.item.EnumRarity;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemSnowball;
- import net.minecraft.item.ItemStack;
- import net.minecraft.item.ItemSword;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.potion.Potion;
- import net.minecraft.potion.PotionEffect;
- import net.minecraft.util.ChatComponentTranslation;
- import net.minecraft.util.MovingObjectPosition;
- import net.minecraft.util.Vec3;
- import net.minecraft.world.World;
- import net.minecraftforge.common.MinecraftForge;
- import net.minecraftforge.event.entity.player.UseHoeEvent;
- public class UltimateSword extends ItemSword {
- public UltimateSword(ToolMaterial ToolMaterial) {
- super(ToolMaterial);
- }
- public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
- if (player.isSneaking()) {
- if (!stack.hasTagCompound()) {
- stack.setTagCompound(new NBTTagCompound());
- }
- byte mode = stack.getTagCompound().getByte("mode");
- mode++;
- if (mode == 3) {
- mode = 0;
- }
- stack.getTagCompound().setByte("mode", mode);
- if (!world.isRemote) {
- player.addChatMessage(new ChatComponentTranslation("Ultimate.mode.message." + mode));
- }
- } else {
- super.onItemRightClick(stack, world, player);
- }
- return stack;
- }
- private ItemStack stack;
- public boolean hitEntity(ItemStack stack, EntityLivingBase attackedLiving, EntityLivingBase attackerLiving) {
- if (!stack.hasTagCompound()) {
- stack.setTagCompound(new NBTTagCompound());
- } else if (stack.getTagCompound().getByte("mode") == 0) {
- if (stack.isItemEnchanted() == false) {
- stack.addEnchantment(enderdeath.StarsPower, 1);
- stack.addEnchantment(Enchantment.sharpness, 5);
- System.out.println("Puissance 1");
- stack.isItemEnchanted();
- if (stack.getTagCompound().getByte("mode") == 1) {
- stack.isItemEnchantable();
- }
- }
- }
- if (stack.getTagCompound().getByte("mode") == 1) {
- if (stack.isItemEnchanted() == false) {
- stack.addEnchantment(Enchantment.knockback, 3);
- stack.addEnchantment(Enchantment.sharpness, 3);
- stack.isItemEnchanted();
- System.out.println("recul 1");
- if (stack.getTagCompound().getByte("mode") == 2) {
- stack.isItemEnchantable();
- }
- }
- } else if (stack.getTagCompound().getByte("mode") == 2) {
- if (stack.isItemEnchanted() == false) {
- stack.addEnchantment(Enchantment.fireAspect, 10);
- stack.addEnchantment(Enchantment.sharpness, 3);
- stack.isItemEnchanted();
- System.out.println("fire 1");
- if (stack.getTagCompound().getByte("mode") == 0) {
- stack.isItemEnchantable();
- }
- }
- } else
- {
- }
- return super.hitEntity(stack, attackedLiving, attackerLiving);
- }
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(ItemStack itemstack) {
- return EnumRarity.epic;
- }
- @SideOnly(Side.CLIENT)
- public boolean hasEffect(ItemStack stack) {
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment