Firstly: Thanks for this! It's been really useful!
Question: So, I'm making armor that I intend to have infinite durability and diamond-level protection (do not question my design principles yet, please XD). I've gotten the infinite durability done, but the armor ends up just making the player invincible. I've also managed to make "unblockable" damage go through this armor, but stuff like mob damage has no effect (even though diamond level protection should still let some damage through).
Basically, I want regular damage application with the ISpecialArmor thingy, but I'm not sure how to do that/if ISpecialArmor is what I should be using.
The Meaning of Life, the Universe, and Everything.
Join Date:
3/6/2014
Posts:
44
Minecraft:
SodaSpartan
Xbox:
Soda Sp4rtan
Member Details
If i were to make my own custom potion effect that allowed flight, could I then make it so that when the full set is worn I can fly. That way if I take off a piece the potion affect would go away almost immediately.
If i were to make my own custom potion effect that allowed flight, could I then make it so that when the full set is worn I can fly. That way if I take off a piece the potion affect would go away almost immediately.
How do you apply health boost, saturation, and absorption?
By health boost I'm going to assume you mean regeneration, which is Potion.regeneration. For saturation, use Potion.hunger, and by absorption I'm going to assume you mean strength, which is probably something along the lines of Potion.strength or Potion.damageResist.
No I mean absorption and health boost. Absorption gives you extra yellow hearts and health boost gives you extra regular hearts, look it up on the wiki.
No I mean absorption and health boost. Absorption gives you extra yellow hearts and health boost gives you extra regular hearts, look it up on the wiki.
Thanks!!
Also hunger is the opposite of saturation.
Ah. You're going to have to look up specific potion effects or look at the source code for other mods(I know Tinker's Construct adds additional hearts).
im a noob i want to learn how to code but no one teach me and it looks like its really dificult i really wanted a teacher for teach me how to code items,blocks,armor,Mobs, also 3d things.... im just a noob that only know the () or potion.idk
im a noob i want to learn how to code but no one teach me and it looks like its really dificult i really wanted a teacher for teach me how to code items,blocks,armor,Mobs, also 3d things.... im just a noob that only know the () or potion.idk
Look up a java tutorial. This is the internet; there is tons of readily accessible information. You only need to know how to find it.
im a noob i want to learn how to code but no one teach me and it looks like its really dificult i really wanted a teacher for teach me how to code items,blocks,armor,Mobs, also 3d things.... im just a noob that only know the () or potion.idk
My tutorials offer those things you mentioned, if you follow it properly, you should be able to start making your mods without previous knowledge, and probably learn Java a little bit, if you explore the code.
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister reg)
{
this.itemIcon = reg.registerIcon(this.iconPath);
}
public String getArmorTexture(ItemStack stack, Entity entity, int layer, int slot)
{
return this.texturePath;
}
public void onCreated(ItemStack item, World world, EntityPlayer player)
{
item.addEnchantment(Enchantment.unbreaking, 10);
// Replace the "." after "Enchantment" to see options
// The number is the Enchantment Level
}
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister reg)
{
this.itemIcon = reg.registerIcon(this.iconPath);
}
public String getArmorTexture(ItemStack stack, Entity entity, int layer, int slot)
{
return this.texturePath;
}
/** Makes your Item Enchanted when it is crafted */
public void onCreated(ItemStack item, World world, EntityPlayer player)
{
item.addEnchantment(Enchantment.aquaAffinity, 5);
item.addEnchantment(Enchantment.blastProtection, 5);
item.addEnchantment(Enchantment.featherFalling, 5);
item.addEnchantment(Enchantment.projectileProtection, 5);
item.addEnchantment(Enchantment.protection, 5);
item.addEnchantment(Enchantment.respiration, 3);
item.addEnchantment(Enchantment.thorns, 5);
item.addEnchantment(Enchantment.unbreaking, 5);
// Replace the "." after "Enchantment" to see options
// The number is the Enchantment Level
}
}
ok I get no errors from my setup but the potion effect isn't showing up for some reason.
(The plan is simple i want when someone is holding said item (poo) that it gives them the nausea and poison effect like their getting sick. and if they drop it, it goes away.)
The code seem's ok just when i have the item in my inventory it doesn't do anything.
public class ItemPoo extends Item
{
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) {
super.onUpdate(stack, world, entity, par4, par5);
EntityPlayer player = (EntityPlayer) entity;
ItemStack equipped = player.getCurrentEquippedItem();
if(equipped != null && equipped == stack) {
player.addPotionEffect(new PotionEffect(Potion.poison.id, 5, 0));
player.addPotionEffect(new PotionEffect(Potion.confusion.id, 5, 0));
}
}
}
I can't say I know. If it does work though, report back so people that have the same problem can get help
yes health boost gives you more hearts
Firstly: Thanks for this! It's been really useful!
Question: So, I'm making armor that I intend to have infinite durability and diamond-level protection (do not question my design principles yet, please XD). I've gotten the infinite durability done, but the armor ends up just making the player invincible. I've also managed to make "unblockable" damage go through this armor, but stuff like mob damage has no effect (even though diamond level protection should still let some damage through).
Basically, I want regular damage application with the ISpecialArmor thingy, but I'm not sure how to do that/if ISpecialArmor is what I should be using.
Thanks in advance,
Type1ninja
If i were to make my own custom potion effect that allowed flight, could I then make it so that when the full set is worn I can fly. That way if I take off a piece the potion affect would go away almost immediately.
Yes, that works.
How do you apply health boost, saturation, and absorption?
By health boost I'm going to assume you mean regeneration, which is Potion.regeneration. For saturation, use Potion.hunger, and by absorption I'm going to assume you mean strength, which is probably something along the lines of Potion.strength or Potion.damageResist.
No I mean absorption and health boost. Absorption gives you extra yellow hearts and health boost gives you extra regular hearts, look it up on the wiki.
Thanks!!
Also hunger is the opposite of saturation.
Ah. You're going to have to look up specific potion effects or look at the source code for other mods(I know Tinker's Construct adds additional hearts).
I fixed it thank you!
im a noob i want to learn how to code but no one teach me and it looks like its really dificult i really wanted a teacher for teach me how to code items,blocks,armor,Mobs, also 3d things.... im just a noob that only know the () or potion.idk
Look up a java tutorial. This is the internet; there is tons of readily accessible information. You only need to know how to find it.
My tutorials offer those things you mentioned, if you follow it properly, you should be able to start making your mods without previous knowledge, and probably learn Java a little bit, if you explore the code.
My code for a set of armor is all in one class. How would I do that?
[url ="http://www.minecraftforum.net/topic/1066990-hardcore-ender-expansion"]
[I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
[url=http://www.minecraftnoobtest.com/test.php][/url]
To take the test, check out
[url=http://www.minecraftnoobtest.com/test.php]http://minecraftnoobtest.com/test.php[/url]
Post your code.
package mymod.armor;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class MyFireOpalArmor extends ItemArmor{
private String texturePath = "mymod:textures/armor/";
private String iconPath = "mymod:";
public MyFireOpalArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4, String myArmorName) {
super(par1, par2EnumArmorMaterial, par3, par4);
this.setMaxStackSize(1);
this.setCreativeTab(CreativeTabs.tabCombat);
this.SetArmorType(myArmorName, par4);
}
private void SetArmorType(String myArmorName, int par4)
{
switch(par4)
{
case 0:
this.setUnlocalizedName("MyHelmet_2");
this.texturePath += myArmorName + "_1.png";
this.iconPath += "MyHelmet_2";
break;
case 1:
this.setUnlocalizedName("MyChest_2");
this.texturePath += myArmorName + "_1.png";
this.iconPath += "MyChest_2";
break;
case 2:
this.setUnlocalizedName("MyLeggings_2");
this.texturePath += myArmorName + "_2.png";
this.iconPath += "MyLeggings_2";
break;
case 3:
this.setUnlocalizedName("MyBoots_2");
this.texturePath += myArmorName + "_1.png";
this.iconPath += "MyBoots_2";
break;
}
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister reg)
{
this.itemIcon = reg.registerIcon(this.iconPath);
}
public String getArmorTexture(ItemStack stack, Entity entity, int layer, int slot)
{
return this.texturePath;
}
public void onCreated(ItemStack item, World world, EntityPlayer player)
{
item.addEnchantment(Enchantment.unbreaking, 10);
// Replace the "." after "Enchantment" to see options
// The number is the Enchantment Level
}
}
[url ="http://www.minecraftforum.net/topic/1066990-hardcore-ender-expansion"]
[I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
[url=http://www.minecraftnoobtest.com/test.php][/url]
To take the test, check out
[url=http://www.minecraftnoobtest.com/test.php]http://minecraftnoobtest.com/test.php[/url]
here is my armor with potion
package mymod.armor;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
public class MyArmor extends ItemArmor{
private String texturePath = "mymod:textures/armor/";
private String iconPath = "mymod:";
public MyArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4, String myArmorName) {
super(par1, par2EnumArmorMaterial, par3, par4);
this.setMaxStackSize(1);
this.setCreativeTab(CreativeTabs.tabCombat);
this.SetArmorType(myArmorName, par4);
}
private void SetArmorType(String myArmorName, int par4)
{
switch(par4)
{
case 0:
this.setUnlocalizedName("MyHelmet_1");
this.texturePath += myArmorName + "_1.png";
this.iconPath += "MyHelmet_1";
break;
case 1:
this.setUnlocalizedName("MyChest_1");
this.texturePath += myArmorName + "_1.png";
this.iconPath += "MyChest_1";
break;
case 2:
this.setUnlocalizedName("MyLeggings_1");
this.texturePath += myArmorName + "_2.png";
this.iconPath += "MyLeggings_1";
break;
case 3:
this.setUnlocalizedName("MyBoots_1");
this.texturePath += myArmorName + "_1.png";
this.iconPath += "MyBoots_1";
break;
}
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister reg)
{
this.itemIcon = reg.registerIcon(this.iconPath);
}
public String getArmorTexture(ItemStack stack, Entity entity, int layer, int slot)
{
return this.texturePath;
}
public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemstack)
{
if(player.getCurrentItemOrArmor(1) != null)
{
ItemStack chest = player.getCurrentItemOrArmor(1);
{
//not sure about this line, experiment
player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 100, 5));
}
}
}
}
and here is armor with enchantments
package mymod.armor;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class MyArmor5 extends ItemArmor{
private String texturePath = "mymod:textures/armor/";
private String iconPath = "mymod:";
public MyArmor5(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4, String myArmorName) {
super(par1, par2EnumArmorMaterial, par3, par4);
this.setMaxStackSize(1);
this.setCreativeTab(CreativeTabs.tabCombat);
this.SetArmorType(myArmorName, par4);
}
private void SetArmorType(String myArmorName, int par4)
{
switch(par4)
{
case 0:
this.setUnlocalizedName("MyHelmet_5");
this.texturePath += myArmorName + "_9.png";
this.iconPath += "MyHelmet_5";
break;
case 1:
this.setUnlocalizedName("MyChest_5");
this.texturePath += myArmorName + "_9.png";
this.iconPath += "MyChest_5";
break;
case 2:
this.setUnlocalizedName("MyLeggings_5");
this.texturePath += myArmorName + "_10.png";
this.iconPath += "MyLeggings_5";
break;
case 3:
this.setUnlocalizedName("MyBoots_5");
this.texturePath += myArmorName + "_9.png";
this.iconPath += "MyBoots_5";
break;
}
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister reg)
{
this.itemIcon = reg.registerIcon(this.iconPath);
}
public String getArmorTexture(ItemStack stack, Entity entity, int layer, int slot)
{
return this.texturePath;
}
/** Makes your Item Enchanted when it is crafted */
public void onCreated(ItemStack item, World world, EntityPlayer player)
{
item.addEnchantment(Enchantment.aquaAffinity, 5);
item.addEnchantment(Enchantment.blastProtection, 5);
item.addEnchantment(Enchantment.featherFalling, 5);
item.addEnchantment(Enchantment.projectileProtection, 5);
item.addEnchantment(Enchantment.protection, 5);
item.addEnchantment(Enchantment.respiration, 3);
item.addEnchantment(Enchantment.thorns, 5);
item.addEnchantment(Enchantment.unbreaking, 5);
// Replace the "." after "Enchantment" to see options
// The number is the Enchantment Level
}
}
its nice to see another youth digital student
I agree, it is.
Well, it adds the effect, but to each separate piece- I want only when the full set is worn.
[url ="http://www.minecraftforum.net/topic/1066990-hardcore-ender-expansion"]
[I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
[url=http://www.minecraftnoobtest.com/test.php][/url]
To take the test, check out
[url=http://www.minecraftnoobtest.com/test.php]http://minecraftnoobtest.com/test.php[/url]
ok I get no errors from my setup but the potion effect isn't showing up for some reason.
(The plan is simple i want when someone is holding said item (poo) that it gives them the nausea and poison effect like their getting sick. and if they drop it, it goes away.)
The code seem's ok just when i have the item in my inventory it doesn't do anything.
public class ItemPoo extends Item
{
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) {
super.onUpdate(stack, world, entity, par4, par5);
EntityPlayer player = (EntityPlayer) entity;
ItemStack equipped = player.getCurrentEquippedItem();
if(equipped != null && equipped == stack) {
player.addPotionEffect(new PotionEffect(Potion.poison.id, 5, 0));
player.addPotionEffect(new PotionEffect(Potion.confusion.id, 5, 0));
}
}
}
correction- it only adds the effect to the boots
[url ="http://www.minecraftforum.net/topic/1066990-hardcore-ender-expansion"]
[I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
[url=http://www.minecraftnoobtest.com/test.php][/url]
To take the test, check out
[url=http://www.minecraftnoobtest.com/test.php]http://minecraftnoobtest.com/test.php[/url]