Jump to content

Recommended Posts

Posted (edited)

Is there anyway to change the damage of swords/axes or any weapon, And if so do i need to make a new package for it or can i put it in my ModItems package?, This is for 1.12.2 btw.

Edited by J0WAY
Posted
2 minutes ago, J0WAY said:

Is there anyway to change the damage of swords/axes or any weapon,

Yes why not take a look at SwordItem to see how it's damage is applied?

 

4 minutes ago, J0WAY said:

And if so do i need to make a new package for it or can i put it in my ModItems package?

If you knew Java you would know how ridiculous this question sounded. What do you mean "do I need to make a new package"?

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.

Posted
1 minute ago, Animefan8888 said:

 

If you knew Java you would know how ridiculous this question sounded. What do you mean "do I need to make a new package"?
I did mean class not package but still you wouldn't need a new class now thinking about it because you can just put it in ModItems, Now thinking about that i feel stupid even asking lol.

 

Posted
3 hours ago, J0WAY said:

Is there anyway to change the damage of swords/axes or any weapon, And if so do i need to make a new package for it or can i put it in my ModItems package?, This is for 1.12.2 btw.

There is a float attackDamage in ItemSword.

Posted
30 minutes ago, J0WAY said:

Not in mine

There must be. Otherwise there is something terribly wrong and you will have to rebuild your workspace.

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Posted

I did fix the problem, In ModItems i just copyed
public static final ToolMaterial MATERIAL_OBSIDIAN_SHARD = EnumHelper.addToolMaterial("material_obsidian_shard", 3, 420, 2.0F, 14.0F, 10);
And put 1 at the end of Mat and then went to my tools and put 1 at the end of mat as well 

Posted
37 minutes ago, J0WAY said:

I did fix the problem, In ModItems i just copyed
public static final ToolMaterial MATERIAL_OBSIDIAN_SHARD = EnumHelper.addToolMaterial("material_obsidian_shard", 3, 420, 2.0F, 14.0F, 10);
And put 1 at the end of Mat and then went to my tools and put 1 at the end of mat as well 

It sounds like you are doing something terribly wrong. Please post all of your code, preferrably in a GitHub repo.

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Posted (edited)

Just have a look at itemsword there is a float variable attackDamage, and in the constructor it assign the attackDamage from material +3 or something. Means if you extends the itemsword, you should be able to assign the damage in the constructor as well. 

Edited by poopoodice
Posted (edited)
10 minutes ago, J0WAY said:

Well i'm not posting all of my code if it's fine and i get no errors and everything works in game lol.

Things seems fine in-game does not means there is no mistake in the code. If there are problematic code and they get unnoticed, errors can still pop-up once in a while and things can behave in unexpected ways.

It sounds like you are creating multiple materials for your tools. This should not happen, as each material should contain information such as attack damage and mining speed, and tools of the same tier should use the same material (i.e. diamond sword and diamond shovel).

Edited by DavidM

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

Announcements



×
×
  • Create New...

Important Information

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