Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

KakesRevenge

Members
  • Joined

  • Last visited

Everything posted by KakesRevenge

  1. Oh its that easy thank you thats exactky what i want
  2. Hello, my goal is to make property displayed next to players name so now in vanilla my name would be displayed like : "KakesRevenge". And for example i want to display another name next to players name like that : "[AnythingGoesHere]KakesRevenge". My question is how to do it ?
  3. Wow cool i just dont understand the detectAndSendChanges thing but thank you very much
  4. 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.
  5. 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
  6. Basically what i need to do - the current stack + another one.
  7. 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 ?
  8. Ok so make it like diesieben said : switch (meta) { case 0: return <>; case 1: return <>; ... ... default: return <default value for unknown meta>; }
  9. lol sorry i didnt say the main thing but never mind i figured it out thank you
  10. ok so whats worng with Item drop = null; ?
  11. 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");
  12. 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);
  13. @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
  14. Learn some basic java - switch case statement
  15. 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; }
  16. In the method onItemDropped just check if meta == 2 then drop this and if meta == 1 drop this
  17. 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
  18. I know just a little bit of java and thank you very much finally fixed it.
  19. I know what should i do but i dont know how .. thats why i would like to see an example
  20. I dont know how the icon field should look like
  21. Could you write an example for me please ?

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.