Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.11.2] (UNSOLVED) Anyone know to give a weapon custom damage?
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
BlockExpert

[1.11.2] (UNSOLVED) Anyone know to give a weapon custom damage?

By BlockExpert, July 13, 2017 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

BlockExpert    0

BlockExpert

BlockExpert    0

  • Stone Miner
  • BlockExpert
  • Members
  • 0
  • 54 posts
Posted July 13, 2017

I need to create a custom damage type for a sword I'm making. It's not quite Iron but it's not quite stone. I need something in between.

  • Quote

Share this post


Link to post
Share on other sites

Animefan8888    741

Animefan8888

Animefan8888    741

  • Reality Controller
  • Animefan8888
  • Forge Modder
  • 741
  • 6157 posts
Posted July 13, 2017
2 hours ago, BlockExpert said:

I need to create a custom damage type for a sword I'm making. It's not quite Iron but it's not quite stone. I need something in between.

What do you mean custom damage type?

  • Quote

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Share this post


Link to post
Share on other sites

_Bedrockbreaker_    1

_Bedrockbreaker_

_Bedrockbreaker_    1

  • Stone Miner
  • _Bedrockbreaker_
  • Members
  • 1
  • 56 posts
Posted July 14, 2017

Use setMaxDamage(int) in the item class. Remember to subtract one because of zero indexing. Also, setting this to -1 will have infinite durability.

  • Quote

Professional Hot Garbage Programmer.

https://github.com/Bedrockbreaker/

Share this post


Link to post
Share on other sites

Choonster    1651

Choonster

Choonster    1651

  • Reality Controller
  • Choonster
  • Forge Modder
  • 1651
  • 5100 posts
Posted July 14, 2017
4 hours ago, _Bedrockbreaker_ said:

Use setMaxDamage(int) in the item class. Remember to subtract one because of zero indexing. Also, setting this to -1 will have infinite durability.

 

I think the OP is talking about attack damage, not durability.

 

If you create your own ToolMaterial with EnumHelper.addToolMaterial, you can specify its attack damage. ItemSword adds 3.0 to this and uses it as the attack damage AttributeModifier.

  • Quote

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Share this post


Link to post
Share on other sites

BlockExpert    0

BlockExpert

BlockExpert    0

  • Stone Miner
  • BlockExpert
  • Members
  • 0
  • 54 posts
Posted July 14, 2017
10 hours ago, Choonster said:

 

I think the OP is talking about attack damage, not durability.

 

If you create your own ToolMaterial with EnumHelper.addToolMaterial, you can specify its attack damage. ItemSword adds 3.0 to this and uses it as the attack damage AttributeModifier.

Thank you!

  • Quote

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • diesieben07
      [1.16.5] Enchantments can Apply to all Tools

      By diesieben07 · Posted just now

      By calling remove on the iterator you remove the current element from the collection you are iterating.
    • Luis_ST
      [1.16.5] Enchantments can Apply to all Tools

      By Luis_ST · Posted 2 minutes ago

      while (enchantmentIterator.hasNext()) { Enchantment enchantment = (Enchantment) enchantmentIterator.next(); if (!enchantment.isCompatibleWith((Enchantment) enchantmentIterator)) { enchantmentIterator.remove(); } } so is this correct? and how to remove now the level of the enchantment?
    • diesieben07
      Forge 1.16.5 - 36.0.9 start up crash

      By diesieben07 · Posted 17 minutes ago

      Problem with RandomPatches.
    • diesieben07
      my 1.16.5 modded game crashes after a while of playing

      By diesieben07 · Posted 18 minutes ago

    • diesieben07
      I need help

      By diesieben07 · Posted 19 minutes ago

      Some zip managers like to take control of the .jar file extension away from Java. Make sure you have Java installed and try running Jarfix once, then try the installer again.
  • Topics

    • Luis_ST
      19
      [1.16.5] Enchantments can Apply to all Tools

      By Luis_ST
      Started Yesterday at 07:21 AM

    • Maxi90909
      3
      Forge 1.16.5 - 36.0.9 start up crash

      By Maxi90909
      Started 1 hour ago

    • matthyit
      3
      my 1.16.5 modded game crashes after a while of playing

      By matthyit
      Started 2 hours ago

    • Zockerbua
      1
      I need help

      By Zockerbua
      Started 27 minutes ago

    • domi0908
      6
      fix hitbox red baby mobs version forge

      By domi0908
      Started Tuesday at 03:04 PM

  • Who's Online (See full list)

    • Luis_ST
    • Ray99
    • diesieben07
    • domi0908
    • gaularn@gmail.com
    • Zockerbua
    • Alpvax
    • Stefan2007
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.11.2] (UNSOLVED) Anyone know to give a weapon custom damage?
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community