Jump to content

[1.7.2] How to Create a Set Armor ?


xXxKanemanxXx

Recommended Posts

Hello Guys :)

 

I have a Question for you. How can i create a Set Armor like in a RPG which gives u when wearing 2 Items an Enchantment like DigSpeed, when u wear 3 Items it gives u Movement Speed and on 4 Items it adds Absorbtion.

 

I've tried this but it didn't worked...

The Armor Class:

 

 

 

public class armorCrystal extends armorEnch{

 

public List list;

 

public armorCrystal(ArmorMaterial p_i45325_1_, int proxy,int piece) {

super(p_i45325_1_, proxy, piece);

this.setCreativeTab(CRItems.crystalTabWeapons);

//this.setEnch(enchantment.fireProtection, 4);

}

 

public String getArmorTexture(ItemStack stack, Entity entity, int slot, String Type){

if(stack.getItem().equals(CRItems.CrystalHelmet) || stack.getItem().equals(CRItems.CrystalChest) || stack.getItem().equals(CRItems.CrystalBoots)){

return Main.MODID + ":textures/models/armor/layer_1.png";

}else if(stack.getItem().equals(CRItems.CrystalLeggs)){

return Main.MODID + ":textures/models/armor/layer_2.png";

}else{

return null;

}

 

}

 

  @SideOnly(Side.CLIENT)

    public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {

  par3List.add("Tier 1");

  par3List.add("");

  par3List.add("On 2 Items equipped: Fire Protection 1");

  par3List.add("On 3 Items equipped: Unbreaking 1");

  par3List.add("On 4 Items equipped: Protection 1");

 

  }

  /*@Override

  public void onCreated(ItemStack i, World w, EntityPlayer p){

 

  /*

    * 3 = Helmet

    * 2 = Chest

    * 1 = Leggs

    * 0 = Boots

    *

 

  ItemStack helmet = p.getCurrentArmor(3);

  ItemStack chest = p.getCurrentArmor(2);

  ItemStack leggs = p.getCurrentArmor(1);

  ItemStack boots = p.getCurrentArmor(0);

 

  if(p.getCurrentArmor(3) != null && p.getCurrentArmor(2) != null){

  if(helmet.getItem() == Main.CrystalHelmet && chest.getItem() == Main.CrystalChest){

  helmet.addEnchantment(Enchantment.unbreaking, 1);

  chest.addEnchantment(Enchantment.unbreaking, 1);

  leggs.addEnchantment(Enchantment.unbreaking, 1);

  boots.addEnchantment(Enchantment.unbreaking, 1);

  }

  }

 

  if(p.getCurrentArmor(3) != null && p.getCurrentArmor(2) != null && p.getCurrentArmor(1) != null){

  if(helmet.getItem() == Main.CrystalHelmet && chest.getItem() == Main.CrystalChest && leggs.getItem() == Main.CrystalLeggs){

  helmet.addEnchantment(Enchantment.unbreaking, 1);

  chest.addEnchantment(Enchantment.unbreaking, 1);

  leggs.addEnchantment(Enchantment.unbreaking, 1);

  boots.addEnchantment(Enchantment.unbreaking, 1);

  }

  }

 

  if(p.getCurrentArmor(3) != null && p.getCurrentArmor(2) != null && p.getCurrentArmor(1) != null && p.getCurrentArmor(0) != null){

  if(helmet.getItem() == Main.CrystalHelmet && chest.getItem() == Main.CrystalChest && leggs.getItem() == Main.CrystalLeggs && boots.getItem() == Main.CrystalBoots){

  helmet.addEnchantment(Enchantment.protection, 1);

  chest.addEnchantment(Enchantment.protection, 1);

  leggs.addEnchantment(Enchantment.protection, 1);

  boots.addEnchantment(Enchantment.protection, 1);

  }

  }

 

  }*/

 

  @Override

  public void onArmorTick(World w, EntityPlayer p, ItemStack i){

  /*

    * 3 = Helmet

    * 2 = Chest

    * 1 = Leggs

    * 0 = Boots

    */

 

  ItemStack helmet = p.getCurrentArmor(3);

  ItemStack chest = p.getCurrentArmor(2);

  ItemStack leggs = p.getCurrentArmor(1);

  ItemStack boots = p.getCurrentArmor(0);

 

  if(p.getCurrentArmor(3) != null && p.getCurrentArmor(2) != null){

  if(helmet.getItem() == Main.CrystalHelmet && chest.getItem() == Main.CrystalChest){

  helmet.addEnchantment(Enchantment.unbreaking, 1);

  chest.addEnchantment(Enchantment.unbreaking, 1);

  leggs.addEnchantment(Enchantment.unbreaking, 1);

  boots.addEnchantment(Enchantment.unbreaking, 1);

  }

  }

 

  if(p.getCurrentArmor(3) != null && p.getCurrentArmor(2) != null && p.getCurrentArmor(1) != null){

  if(helmet.getItem() == Main.CrystalHelmet && chest.getItem() == Main.CrystalChest && leggs.getItem() == Main.CrystalLeggs){

  helmet.addEnchantment(Enchantment.unbreaking, 1);

  chest.addEnchantment(Enchantment.unbreaking, 1);

  leggs.addEnchantment(Enchantment.unbreaking, 1);

  boots.addEnchantment(Enchantment.unbreaking, 1);

  }

  }

 

  if(p.getCurrentArmor(3) != null && p.getCurrentArmor(2) != null && p.getCurrentArmor(1) != null && p.getCurrentArmor(0) != null){

  if(helmet.getItem() == Main.CrystalHelmet && chest.getItem() == Main.CrystalChest && leggs.getItem() == Main.CrystalLeggs && boots.getItem() == Main.CrystalBoots){

  helmet.addEnchantment(Enchantment.protection, 1);

  chest.addEnchantment(Enchantment.protection, 1);

  leggs.addEnchantment(Enchantment.protection, 1);

  boots.addEnchantment(Enchantment.protection, 1);

  }

  }

 

  }

 

 

armorEnch Class:

 

public class armorEnch extends ItemArmor{

 

public armorEnch(ArmorMaterial p_i45325_1_, int p_i45325_2_, int p_i45325_3_) {

super(p_i45325_1_, p_i45325_2_, p_i45325_3_);

// TODO Auto-generated constructor stub

}

 

protected Enchantment enchantment;

protected int level;

 

public Item setEnch(Enchantment ench, int lvl) {

this.enchantment = ench;

this.level = lvl;

return this;

}

 

public int getDamage(ItemStack stack) {

if (!stack.isItemEnchanted() && !isRestricted(stack)) {

stack.addEnchantment(this.enchantment, this.level);

NBTTagCompound tag = stack.getTagCompound();

tag.setBoolean("enchant-set", true);

stack.setTagCompound(tag);

}

return super.getDamage(stack);

}

 

private boolean isRestricted(ItemStack item) {

if (item.hasTagCompound()) {

NBTTagCompound tag = item.getTagCompound();

if (tag.hasKey("enchant-set")) {

return tag.getBoolean("enchant-set");

} else {

tag.setBoolean("enchant-set", false);

item.setTagCompound(tag);

}

}

return false;

}

 

}

 

 

The armorEnch Class is used for the setEnch in the Armor Class...

 

I've tried it this way but it did not work...

 

I seek for help :/

Link to comment
Share on other sites

So the OnArmorTick in the Armor Class is not necessary or what ?

 

That is exactly what Abyrnos is saying. The function "onArmorTick" in the custom Armor class is where you would have the series of conditional statements to achieve your goal. It might be a lengthy process and I'd highly recommend writing out all possible combinations.

Link to comment
Share on other sites

I have it already done like that, not all combinations but a few

 

my Crashlog when i'm using it like i've posted it in the first post:

 

[15:17:44] [Client thread/FATAL]: Reported exception thrown!

net.minecraft.util.ReportedException: Ticking entity

at net.minecraft.world.World.updateEntities(World.java:2079) ~[World.class:?]

at net.minecraft.client.Minecraft.runTick(Minecraft.java:2064) ~[Minecraft.class:?]

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:996) ~[Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:912) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_51]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_51]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]

Caused by: java.lang.NullPointerException

at crystalrevolution.armor.armorCrystal.onArmorTick(armorCrystal.java:61) ~[armorCrystal.class:?]

at net.minecraft.entity.player.InventoryPlayer.decrementAnimations(InventoryPlayer.java:357) ~[inventoryPlayer.class:?]

at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:625) ~[EntityPlayer.class:?]

at net.minecraft.client.entity.EntityPlayerSP.onLivingUpdate(EntityPlayerSP.java:299) ~[EntityPlayerSP.class:?]

at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1820) ~[EntityLivingBase.class:?]

at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:342) ~[EntityPlayer.class:?]

at net.minecraft.client.entity.EntityClientPlayerMP.onUpdate(EntityClientPlayerMP.java:100) ~[EntityClientPlayerMP.class:?]

at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2254) ~[World.class:?]

at net.minecraft.world.World.updateEntity(World.java:2214) ~[World.class:?]

at net.minecraft.world.World.updateEntities(World.java:2064) ~[World.class:?]

... 10 more

---- Minecraft Crash Report ----

// This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]

 

Time: 01.08.14 15:17

Description: Ticking entity

 

java.lang.NullPointerException: Ticking entity

at crystalrevolution.armor.armorCrystal.onArmorTick(armorCrystal.java:61)

at net.minecraft.entity.player.InventoryPlayer.decrementAnimations(InventoryPlayer.java:357)

at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:625)

at net.minecraft.client.entity.EntityPlayerSP.onLivingUpdate(EntityPlayerSP.java:299)

at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1820)

at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:342)

at net.minecraft.client.entity.EntityClientPlayerMP.onUpdate(EntityClientPlayerMP.java:100)

at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2254)

at net.minecraft.world.World.updateEntity(World.java:2214)

at net.minecraft.world.World.updateEntities(World.java:2064)

at net.minecraft.client.Minecraft.runTick(Minecraft.java:2064)

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:996)

at net.minecraft.client.Minecraft.run(Minecraft.java:912)

at net.minecraft.client.main.Main.main(Main.java:112)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- Head --

Stacktrace:

at crystalrevolution.armor.armorCrystal.onArmorTick(armorCrystal.java:61)

at net.minecraft.entity.player.InventoryPlayer.decrementAnimations(InventoryPlayer.java:357)

at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:625)

at net.minecraft.client.entity.EntityPlayerSP.onLivingUpdate(EntityPlayerSP.java:299)

at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1820)

at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:342)

at net.minecraft.client.entity.EntityClientPlayerMP.onUpdate(EntityClientPlayerMP.java:100)

at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2254)

at net.minecraft.world.World.updateEntity(World.java:2214)

 

-- Entity being ticked --

Details:

Entity Type: null (net.minecraft.client.entity.EntityClientPlayerMP)

Entity ID: 172

Entity Name: Player110

Entity's Exact location: 95,98, 5,62, 249,22

Entity's Block location: World: (95,5,249), Chunk: (at 15,0,9 in 5,15; contains blocks 80,0,240 to 95,255,255), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

Entity's Momentum: 0,00, -0,08, 0,00

Stacktrace:

at net.minecraft.world.World.updateEntities(World.java:2064)

 

-- Affected level --

Details:

Level name: MpServer

All players: 1 total; [EntityClientPlayerMP['Player110'/172, l='MpServer', x=95,98, y=5,62, z=249,22]]

Chunk stats: MultiplayerChunkCache: 240, 240

Level seed: 0

Level generator: ID 01 - flat, ver 0. Features enabled: false

Level generator options:

Level spawn location: World: (209,4,2), Chunk: (at 1,0,2 in 13,0; contains blocks 208,0,0 to 223,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

Level time: 11706 game time, 11706 day time

Level dimension: 0

Level storage version: 0x00000 - Unknown?

Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)

Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false

Forced entities: 49 total; [EntitySlime['Slime'/5978, l='MpServer', x=50,86, y=4,95, z=199,78], EntitySlime['Slime'/1, l='MpServer', x=47,75, y=4,00, z=195,63], EntitySlime['Slime'/5977, l='MpServer', x=74,31, y=4,95, z=187,60], EntitySlime['Slime'/5, l='MpServer', x=24,21, y=4,00, z=190,50], EntitySlime['Slime'/6, l='MpServer', x=24,09, y=4,81, z=175,34], EntitySlime['Slime'/10, l='MpServer', x=46,59, y=4,00, z=200,00], EntitySlime['Slime'/11, l='MpServer', x=43,94, y=4,00, z=205,91], EntitySlime['Slime'/12, l='MpServer', x=47,34, y=4,00, z=198,00], EntitySlime['Slime'/14, l='MpServer', x=72,09, y=4,35, z=193,32], EntitySlime['Slime'/35, l='MpServer', x=126,36, y=4,47, z=191,84], EntityChicken['Chicken'/33, l='MpServer', x=136,63, y=4,00, z=169,56], EntityPig['Pig'/42, l='MpServer', x=153,34, y=4,00, z=185,06], EntitySheep['Sheep'/43, l='MpServer', x=158,66, y=4,00, z=176,38], EntitySlime['Slime'/40, l='MpServer', x=166,75, y=4,00, z=176,34], EntitySlime['Slime'/41, l='MpServer', x=145,78, y=4,96, z=170,66], EntitySlime['Slime'/186, l='MpServer', x=41,41, y=4,00, z=259,56], EntitySlime['Slime'/184, l='MpServer', x=37,69, y=4,00, z=205,25], EntitySlime['Slime'/190, l='MpServer', x=50,21, y=4,00, z=315,30], EntitySlime['Slime'/191, l='MpServer', x=23,31, y=4,00, z=301,53], EntitySlime['Slime'/188, l='MpServer', x=43,94, y=4,00, z=233,47], EntitySlime['Slime'/189, l='MpServer', x=37,50, y=4,00, z=287,01], EntitySheep['Sheep'/62, l='MpServer', x=160,22, y=4,00, z=175,81], EntitySlime['Slime'/180, l='MpServer', x=20,13, y=4,00, z=272,63], EntitySlime['Slime'/205, l='MpServer', x=108,44, y=4,00, z=279,72], EntitySlime['Slime'/204, l='MpServer', x=102,75, y=4,00, z=237,38], EntitySlime['Slime'/207, l='MpServer', x=96,75, y=4,00, z=271,03], EntitySlime['Slime'/206, l='MpServer', x=110,99, y=4,00, z=271,83], EntitySlime['Slime'/201, l='MpServer', x=93,72, y=4,00, z=201,94], EntitySlime['Slime'/203, l='MpServer', x=97,13, y=4,00, z=246,44], EntitySlime['Slime'/202, l='MpServer', x=92,63, y=6,01, z=231,63], EntitySlime['Slime'/197, l='MpServer', x=69,91, y=4,82, z=243,30], EntitySlime['Slime'/196, l='MpServer', x=49,13, y=4,00, z=228,75], EntitySlime['Slime'/198, l='MpServer', x=58,97, y=4,00, z=311,23], EntitySlime['Slime'/192, l='MpServer', x=25,97, y=4,82, z=322,12], EntitySlime['Slime'/220, l='MpServer', x=177,18, y=4,60, z=253,73], EntitySlime['Slime'/222, l='MpServer', x=161,34, y=4,00, z=329,59], EntityClientPlayerMP['Player110'/172, l='MpServer', x=95,98, y=5,62, z=249,22], EntitySlime['Slime'/216, l='MpServer', x=162,21, y=4,00, z=227,48], EntitySlime['Slime'/217, l='MpServer', x=147,69, y=5,06, z=321,82], EntitySlime['Slime'/218, l='MpServer', x=170,75, y=4,00, z=225,23], EntitySlime['Slime'/219, l='MpServer', x=173,91, y=4,00, z=216,19], EntitySlime['Slime'/212, l='MpServer', x=131,52, y=4,00, z=249,90], EntitySlime['Slime'/213, l='MpServer', x=142,94, y=4,00, z=268,47], EntitySlime['Slime'/214, l='MpServer', x=134,88, y=4,00, z=293,06], EntitySlime['Slime'/215, l='MpServer', x=127,31, y=4,00, z=320,47], EntitySlime['Slime'/208, l='MpServer', x=97,78, y=4,00, z=327,50], EntitySlime['Slime'/209, l='MpServer', x=98,23, y=4,00, z=269,38], EntitySlime['Slime'/210, l='MpServer', x=135,81, y=4,00, z=326,03], EntitySlime['Slime'/224, l='MpServer', x=175,06, y=4,00, z=233,16]]

Retry entities: 0 total; []

Server brand: fml,forge

Server type: Integrated singleplayer server

Stacktrace:

at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:412)

at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2523)

at net.minecraft.client.Minecraft.run(Minecraft.java:934)

at net.minecraft.client.main.Main.main(Main.java:112)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

 

 

My Armor Class:

 

package crystalrevolution.armor;

 

import java.util.List;

 

import net.minecraft.enchantment.Enchantment;

import net.minecraft.entity.Entity;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.item.ItemArmor;

import net.minecraft.item.ItemArmor.ArmorMaterial;

import net.minecraft.item.ItemStack;

import net.minecraft.world.World;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

import crystalrevolution.Main;

import crystalrevolution.core.CRItems;

 

public class armorCrystal extends ItemArmor{

 

public List list;

 

public armorCrystal(ArmorMaterial p_i45325_1_, int proxy,int piece) {

super(p_i45325_1_, proxy, piece);

this.setCreativeTab(CRItems.crystalTabWeapons);

//this.setEnch(enchantment.fireProtection, 4);

}

 

public String getArmorTexture(ItemStack stack, Entity entity, int slot, String Type){

if(stack.getItem().equals(CRItems.CrystalHelmet) || stack.getItem().equals(CRItems.CrystalChest) || stack.getItem().equals(CRItems.CrystalBoots)){

return Main.MODID + ":textures/models/armor/layer_1.png";

}else if(stack.getItem().equals(CRItems.CrystalLeggs)){

return Main.MODID + ":textures/models/armor/layer_2.png";

}else{

return null;

}

 

}

 

  @SideOnly(Side.CLIENT)

    public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {

  par3List.add("Tier 1");

  par3List.add("");

  par3List.add("On 2 Items equipped: Fire Protection 1");

  par3List.add("On 3 Items equipped: Unbreaking 1");

  par3List.add("On 4 Items equipped: Protection 1");

 

  }

 

 

  @Override

  public void onArmorTick(World w, EntityPlayer p, ItemStack i){

 

  ItemStack helmet = p.getCurrentArmor(3);

  ItemStack chest = p.getCurrentArmor(2);

  ItemStack leggs = p.getCurrentArmor(1);

  ItemStack boots = p.getCurrentArmor(0);

 

  if(p.getCurrentArmor(3) != null && p.getCurrentArmor(2) != null){

  if(helmet.getItem() == CRItems.CrystalHelmet && chest.getItem() == CRItems.CrystalChest){

  helmet.addEnchantment(Enchantment.fireProtection, 1);

  chest.addEnchantment(Enchantment.fireProtection, 1);

  leggs.addEnchantment(Enchantment.fireProtection, 1);

  boots.addEnchantment(Enchantment.fireProtection, 1);

  }

  }

 

  if(p.getCurrentArmor(3) != null && p.getCurrentArmor(2) != null && p.getCurrentArmor(1) != null){

  if(helmet.getItem() == CRItems.CrystalHelmet && chest.getItem() == CRItems.CrystalChest && leggs.getItem() == CRItems.CrystalLeggs){

  helmet.addEnchantment(Enchantment.unbreaking, 1);

  chest.addEnchantment(Enchantment.unbreaking, 1);

  leggs.addEnchantment(Enchantment.unbreaking, 1);

  boots.addEnchantment(Enchantment.unbreaking, 1);

  }

  }

 

  if(p.getCurrentArmor(3) != null && p.getCurrentArmor(2) != null && p.getCurrentArmor(1) != null && p.getCurrentArmor(0) != null){

  if(helmet.getItem() == CRItems.CrystalHelmet && chest.getItem() == CRItems.CrystalChest && leggs.getItem() == CRItems.CrystalLeggs && boots.getItem() == CRItems.CrystalBoots){

  helmet.addEnchantment(Enchantment.protection, 1);

  chest.addEnchantment(Enchantment.protection, 1);

  leggs.addEnchantment(Enchantment.protection, 1);

  boots.addEnchantment(Enchantment.protection, 1);

  }

  }

 

 

 

  }

 

}

 

 

Link to comment
Share on other sites

My first question is why are you calling for "getCurrentArmor" in your if statements when you've already created ItemStacks for those slots just lines above?

 

But realistically, I think that the problem you are having is that you are adding enchantments to armor, EVERY TICK. The code you have there doesn't just add ONE enchantment and stop, it adds "Unbreaking I" to your armor for EVERY tick that condition is true. This eventually leads to a NullPointException (I'm not sure the crash occurs because of how many enchantments you have on the piece or because you take the armor off).

 

The way you made it seem in the first post was that you were going to be modifying the player's dig speed, movement speed, and other things that can be controlled either by potion effects or through EntityPlayer. If you are going to be adding an enchantment to a set of armor while you are wearing it, then this method is not for you.

Link to comment
Share on other sites

Looking at it a bit more, you could probably check to see if the item is enchanted before adding the enchantment to it. Keep in mind though, you can't easily remove the enchantment from the item. So if someone were to take off the armor, the armor would still be enchanted.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.