
Recable
Members-
Posts
43 -
Joined
-
Last visited
Everything posted by Recable
-
Can I please have an example of how to do what I asked in the first post? Then I can manage it from there and won't need any more help.
-
Still don't know
-
I know but what I mean is I'm not sure how to use the forge methods with it, like the ItemArmor.ArmorMaterial
-
It's used to manipulate classes and everything in that class, right?
-
Yes and I don't know how to do that in forge, like what would an example be?
-
Then what do I do, I'm not an expert.
-
So like this as an example? ItemArmor.ArmorMaterial.IRON.getDamageReductionAmount(0);
-
Can I have an example please? And would I make a new class for this or put it in my normal item classes?
-
How would I change the vanilla armor values?
-
Okay then instead of making it glow how would I do it so on held it changes to another item and when that other item is stopped being held it changes to the original item?
-
How would I make it so that the item only glows when it's held and doesn't glow when it's not held? @SideOnly(Side.CLIENT) @Override public boolean hasEffect(ItemStack stack) { return true; }
-
True it's limited but like Draco said it's exactly what I wanted However if I was to want to use different colors, would it be like this?: @Override public EnumRarity getRarity(ItemStack stack) { if (this == ModItems.Sword) { return EnumChatFormatting.AQUA; } else { return EnumChatFormatting.WHITE; } }
-
Never mind, I looked into the Golden Apple code and found they color their items in terms of rarity which is exactly what I wanted to do so I just used the same code with my items. @Override public EnumRarity getRarity(ItemStack stack) { if (this == ModItems.Sword) { return EnumRarity.EPIC; } else { return EnumRarity.COMMON; } }
-
That's not what I meant either way, if I return it, it won't change the color?
-
What would an example of returning it be like? I'm not anything of an expert yet.
-
So like this?: @Override public String getItemStackDisplayName(ItemStack stack) { if (this == ModItems.ArrowMould) { stack.setStackDisplayName(EnumChatFormatting.AQUA + "ArrowMouldLol"); } if (this == ModItems.Chromium) { stack.setStackDisplayName(EnumChatFormatting.AQUA + "ChromiumLol"); } return super.getItemStackDisplayName(stack); } Edit: Just tested it and it works, thanks
-
package com.Recable.mod.items.foodsetup; import com.Recable.mod.ModGlobal; import net.minecraft.item.ItemFood; public class ModItemFood extends ItemFood { public ModItemFood(String unlocalizedName, int amount, float saturation, boolean isWolfFood){ super(amount, saturation, isWolfFood); this.setUnlocalizedName(unlocalizedName); this.setCreativeTab(ModGlobal.modCreativeTabFood); } }
-
Why doesn't this EnumChatFormatting work? Ingame the text is aqua but says "item.Food.name" instead of just "Food" in aqua? GameRegistry.registerItem(Cherry = new ModItemFood (EnumChatFormatting.AQUA+"Food", 3, 0.3F, false), "Food");
-
Okay so I've made this item where when help you can a player capability that makes it so you can't take damage (like in creative mode) and the potion effect weakness (so you all can't hurt people), but I've realised there's a problem because at the moment you must hold the gem for the effect to work and when you switch to another item slot without holding the gem the effect goes, but if you hold the gem and then throw it out of your inventory it gives you the effects forever, how would I fix that? package com.Recable.mod.gemstones; import java.util.List; import com.Recable.mod.MAGlobal; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.init.Items; import net.minecraft.item.EnumAction; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.stats.StatList; import net.minecraft.world.World; public class ModImmortalGemstone extends Item { public ModImmortalGemstone(String unlocalizedName) { super(); this.setUnlocalizedName(unlocalizedName); this.setCreativeTab(ModGlobal.modCreativeTabGemstones); this.setMaxStackSize(1); } @Override public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag) { if (entity instanceof EntityPlayer) { EntityPlayer Player = (EntityPlayer) entity; if(Player.getCurrentEquippedItem() != null && Player.getCurrentEquippedItem().getItem() instanceof ModImmortalGemstone) { Player.capabilities.disableDamage = true; Player.addPotionEffect(new PotionEffect(Potion.weakness.id, 0, 100000 - 1)); } else { Player.capabilities.disableDamage = false; Player.removePotionEffect(i); } } } }
-
Then how would I make it not add every tick and instead only at 0 seconds duration?
-
Yeah but the problem is, the timer doesn't tick down at all?
-
Yeah your help got it fixed, thanks.
-
Could I possibly have an example please?
-
What happens is right now when holding the gemstone it gives the holder regeneration 2, however at the moment the timer doesn't tick down, making it so that the player doesn't actually regenerate, how do I fix this? package com.Recable.mod.gemstones; import java.util.List; import com.Recable.mod.ModGlobal; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.init.Items; import net.minecraft.item.EnumAction; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.stats.StatList; import net.minecraft.world.World; public class ModVitalityGemstone extends Item { public ModVitalityGemstone(String unlocalizedName) { super(); this.setUnlocalizedName(unlocalizedName); this.setCreativeTab(ModGlobal.ModCreativeTabGemstones); this.setMaxStackSize(1); } @Override public void onUpdate(ItemStack stack, World worldIn, Entity entity, int i, boolean flag) { if (entity instanceof EntityPlayer) { EntityPlayer Player = (EntityPlayer) entity; if(Player.getCurrentEquippedItem() != null && Player.getCurrentEquippedItem().getItem() instanceof ModVitalityGemstone) { Player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 50, 2 - 1)); Player.removePotionEffect(i); } else { Player.removePotionEffect(i); } } } private void effectPlayer(Entity entityIn, Potion potion, int amplifier) { EntityLivingBase player = (EntityLivingBase) entityIn; if (player.getActivePotionEffect(potion)== null || player.getActivePotionEffect(potion).getDuration() <=20) player.addPotionEffect(new PotionEffect(potion.id, 40 /** Duration */, amplifier, true, true)); }
-
Oh, I see that makes sense just I thought that it being an instanceof my pickaxe it would only work from using that and nothing else, but oh well, thank you.