KakesRevenge
Members-
Posts
153 -
Joined
-
Last visited
Everything posted by KakesRevenge
-
[1.7.10][SOLVED] Property displayed next to players name
KakesRevenge replied to KakesRevenge's topic in Modder Support
Oh its that easy thank you thats exactky what i want -
[1.7.10] Item onRightClick returning the same thing
KakesRevenge replied to KakesRevenge's topic in Modder Support
Wow cool i just dont understand the detectAndSendChanges thing but thank you very much -
[1.7.10] Item onRightClick returning the same thing
KakesRevenge replied to KakesRevenge's topic in Modder Support
I want just add the same item when the item is right clicked no matter what. Idealy the onItemRightClick would be void. I just dont know how to deal with the return statement. -
[1.7.10] Item onRightClick returning the same thing
KakesRevenge replied to KakesRevenge's topic in Modder Support
So its not possible then... -
[1.7.10] Item onRightClick returning the same thing
KakesRevenge replied to KakesRevenge's topic in Modder Support
I did that here : @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { player.inventory.addItemStackToInventory(new ItemStack(this)); return stack ; } or i dont understand you -
[1.7.10] Item onRightClick returning the same thing
KakesRevenge replied to KakesRevenge's topic in Modder Support
Basically what i need to do - the current stack + another one. -
Hey, Im trying to make an item and when you right click it you will get another item (same one) and this: @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { player.inventory.addItemStackToInventory(new ItemStack(this)); return stack ; } i know why but is there any way to solve it ?
-
How to make different block metadatas drop different items?
KakesRevenge replied to bokisa12's topic in Modder Support
Ok so make it like diesieben said : switch (meta) { case 0: return <>; case 1: return <>; ... ... default: return <default value for unknown meta>; } -
[1.7.10] Unable to put armor in armor slot
KakesRevenge replied to KakesRevenge's topic in Modder Support
lol sorry i didnt say the main thing but never mind i figured it out thank you -
How to make different block metadatas drop different items?
KakesRevenge replied to bokisa12's topic in Modder Support
ok so whats worng with Item drop = null; ? -
[1.7.10] Unable to put armor in armor slot
KakesRevenge replied to KakesRevenge's topic in Modder Support
So i have my armor class like this : package fewmorethings.items.armor; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; 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; import fewmorethings.Main; import fewmorethings.items.ArmoryHandler; public class EmeraldArmor extends ItemArmor { private static Item bootsEmerald; private String [] armorTypes = new String [] {"EmeraldHelmet", "EmeraldChestplate", "EmeraldLeggings", "EmeraldBoots"}; public EmeraldArmor(ArmorMaterial armorMaterial, int renderIndex, int armorType){ super(armorMaterial, renderIndex, armorType); this.setCreativeTab(Main.fmtab); } @Override public String getArmorTexture(ItemStack stack, Entity entity,int slot, String layer){ if(stack.getItem().equals(ArmoryHandler.EmeraldHelmet)|| stack.getItem().equals(ArmoryHandler.EmeraldChestplate)|| stack.getItem().equals(ArmoryHandler.EmeraldBoots)){ return "fmt:textures/armor/EmeraldArmor1.png"; } if(stack.getItem().equals(ArmoryHandler.EmeraldLeggings)){ return "fmt:textures/armor/EmeraldArmor2.png"; } else return null; } @Override public void registerIcons(IIconRegister reg){ if(this == ArmoryHandler.EmeraldHelmet) this.itemIcon = reg.registerIcon("fmt:EmeraldHelmet"); if(this == ArmoryHandler.EmeraldChestplate) this.itemIcon = reg.registerIcon("fmt:EmeraldChestplate"); if(this == ArmoryHandler.EmeraldLeggings) this.itemIcon = reg.registerIcon("fmt:EmeraldLeggings"); if(this == ArmoryHandler.EmeraldBoots) this.itemIcon = reg.registerIcon("fmt:EmeraldBoots"); } @Override public void onArmorTick(World world, EntityPlayer player, ItemStack itemstack){ if(player.getCurrentArmor(3) != null && player.getCurrentArmor(2) != null && player.getCurrentArmor(1) !=null && player.getCurrentArmor(0) != null){ ItemStack helmet = player.getCurrentArmor(3); ItemStack plate = player.getCurrentArmor(2); ItemStack leggings = player.getCurrentArmor(1); ItemStack boots = player.getCurrentArmor(0); if(helmet.getItem() == ArmoryHandler.EmeraldHelmet && plate.getItem() == ArmoryHandler.EmeraldChestplate && leggings.getItem() == ArmoryHandler.EmeraldLeggings && boots.getItem() == ArmoryHandler.EmeraldBoots){ player.addPotionEffect( new PotionEffect(Potion.resistance.getId(), 10, 60)); } } } } and init armor : public static Item EmeraldHelmet = new EmeraldArmor(ArmorEmerald, 5, 0).setUnlocalizedName("EmeraldHelmet"); public static Item EmeraldChestplate = new EmeraldArmor(ArmorEmerald, 5, 1).setUnlocalizedName("EmeraldChestplate"); public static Item EmeraldLeggings = new EmeraldArmor(ArmorEmerald, 5, 2).setUnlocalizedName("EmeraldLeggings"); public static Item EmeraldBoots = new EmeraldArmor(ArmorEmerald, 5, 3).setUnlocalizedName("EmeraldBoots"); -
How to make different block metadatas drop different items?
KakesRevenge replied to bokisa12's topic in Modder Support
ok so Item drop = null; ? -
How to make different block metadatas drop different items?
KakesRevenge replied to bokisa12's topic in Modder Support
why not ? -
How to make different block metadatas drop different items?
KakesRevenge replied to bokisa12's topic in Modder Support
So for better explanation (sorry for my english) : basically what switch case is doing - you will say @Override public Item getItemDropped(int meta, Random random, int fortune) { Item drop = new Item(); //drop variable switch (meta or any other integer) { //in this case its the integer meta which is basically saying what block you mean case 1: //in case the meta int is eqal to 1 drop = Items.apple // change the drop variable to apple break; //STOP case 2: //in case the meta is equal to 2 drop = Items.diamond // change the drop variable to apple break; } return drop; //now we need to return the item which will be dropped which will be the drop variable for dropping item as block simply : Item.getItemFromBlock(Blocks.dirt); -
How to make different block metadatas drop different items?
KakesRevenge replied to bokisa12's topic in Modder Support
@Override public Item getItemDropped(int meta, Random random, int int2) { Item drop = new Item(); switch (meta) { case 1: drop = Items.diamond; break; case 2: drop = Items.apple; } return drop; } (int meta, Random random, int int2) int meta -
How to make different block metadatas drop different items?
KakesRevenge replied to bokisa12's topic in Modder Support
Learn some basic java - switch case statement -
[1.7.10] Unable to put armor in armor slot
KakesRevenge replied to KakesRevenge's topic in Modder Support
Well thats unfortunate -
How to make different block metadatas drop different items?
KakesRevenge replied to bokisa12's topic in Modder Support
You can make switch case of the 1st int like this : @Override public Item getItemDropped(int meta, Random random, int int2) { Item drop = new Item(); switch (meta) { case 1: drop = Items.diamond; break; case 2: drop = Items.apple; } return drop; } -
How to make different block metadatas drop different items?
KakesRevenge replied to bokisa12's topic in Modder Support
In the method onItemDropped just check if meta == 2 then drop this and if meta == 1 drop this -
Hello everyone, Im trying to make armor which will work only if player.someBoolean == true that means that if the boolean is == false then player cannot place armor in his armor slot. I was looking in ItemArmor.class but i cant find some method which is placing the armor in slot. Thx for any help
-
I know just a little bit of java and thank you very much finally fixed it.
-
I know what should i do but i dont know how .. thats why i would like to see an example
-
I dont know how the icon field should look like
-
Could you write an example for me please ?