Jump to content

Terraform

Members
  • Posts

    9
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Terraform's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. [New Question] I have a new question I need to ask. How would I call "NBT" integers and place it in getItemAttributeModifiers? Would I create a new ItemStack and check for the item in the player's hand, or do I create a new instance of ItemStack. You guys have suggested a method getAttributeModifiers(ItemStack) but I am unable to locate it in the source or any sort of code. Any help would be greatly appreciated! c: -Terraform
  2. bump. :c I've put a System.out.println method in my getItemAttributeModifiers() method. It is however being called, but the bonus damage is "not" however being applied. Any ideas? EDIT: Fixed it. A single little mistake destroys everything.
  3. Does it have something to do with my Forge version? I decided to change my code around to see if it worked, nope. I gave up, and tried using your "exact" code changing just the names and removing unnecessary methods from interfaces, etc., no luck. Just. lol, I'm confuzzled. I'll show my code, just in case I'm doing something wrong: Main Class - cut down to what is necessary public static Item sword_GAIN; static ToolMaterial GAIN = EnumHelper.addToolMaterial("GAIN", 3, -1, 1.0F, 3, 9); @EventHandler public void preInit(FMLPreInitializationEvent event) { sword_GAIN = new GainSword(GAIN, 50D).setUnlocalizedName("gainSword"); } SwordGain class - I didn't put my imports nor package in this code //removed package / imports public class SwordGain extends ItemSword { private float weaponDamage; private final ToolMaterial toolMaterial; public SwordGain(ToolMaterial material, float damage) { super(material); maxStackSize = 1; setNoRepair(); this.weaponDamage = damage; this.setCreativeTab(SMain.smTab); } @Override public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { return bFull3D; } @Override public String getUnlocalizedName(ItemStack par1ItemStack) { int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, 15); return super.getUnlocalizedName(); } @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister par1IconRegister) { this.itemIcon = par1IconRegister.registerIcon(SMain.modid + ":" + (this.getUnlocalizedName().substring(5))); } public float getStrVsBlock(ItemStack itemstack, Block block) { return block != Blocks.stone ? 1.5F : 5F; } public boolean onBlockDestroyed(ItemStack itemstack, int i, int j, int k, int l, EntityLiving entityliving) { return true; } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if (!par2World.isRemote) { par3EntityPlayer.addChatMessage(new ChatComponentText("need to add something here ><"); } return par1ItemStack; } public boolean isFull3D() { return true; } public EnumAction getItemUseAction(ItemStack itemstack) { return EnumAction.block; } public int getMaxItemUseDuration(ItemStack itemstack) { return 0x11940; } public boolean canHarvestBlock(Block block) { return false; } public int getItemEnchantability() { return material.getEnchantability(); } @Override public Multimap getItemAttributeModifiers() { Multimap multimap = super.getItemAttributeModifiers(); multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", (double) this.weaponDamage, 0)); return multimap; } }
  4. I put it at the bottom of my ItemSword class. I'm wondering, is it due to the fact that my "tool material" is overriding it? Or - am I even suppose to have a tool material? I can show code if absolutely necessary, thanks for the help everyone c:
  5. There is no method - getAttributeModifiers I have am using this: @Override public Multimap getItemAttributeModifiers() { Multimap multimap = HashMultimap.create(); multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", (double) this.weaponDamage + 50D, 0)); return multimap; } The problem is that it only does 8 damage, however I change it, it stays like that. (Added 50D)
  6. I have a few problems that I am stuck on. Lately, I've asked a question about NBT on swords. What I've accomplished is a whole system of NBT tags (that works), thanks to you guys for the advice. Now, I need to know how to change the Sword's base damage (I have a custom ToolMaterial) I don't know how to change the sword damage corresponding to my NBT tag - "killCount"
  7. -- I know how to use NBT, now (that's out of the way) -- I don't know how to apply let's say a new integer named "kills" and store it to something. I don't know how to get that "something" because I want it for each individual player as well. Maybe I'm over thinking this, if anyone can help me solve this, it will be great c:
  8. Still kinda confused. How would I set up a NBT tag to store the integer and the player name (String)?
  9. I want to make like a sword that steals power from what you kill. Example: You kill an entity you gain 1 stack. You can have a max of 1000 stacks (100 bonus damage) I probably have to use IExtendedEntityProperties and/or NBT. So any ideas where I should start, and any suggestions? Thanks. -I have basic Java knowledge, and Minecraft modding knowledge-
×
×
  • Create New...

Important Information

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