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.13.2] Tool attack damage broken?
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
HarryTechReviews

[1.13.2] Tool attack damage broken?

By HarryTechReviews, February 18, 2019 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

HarryTechReviews    4

HarryTechReviews

HarryTechReviews    4

  • Stone Miner
  • HarryTechReviews
  • Members
  • 4
  • 55 posts
Posted February 18, 2019

No matter what I set my tool material's attack damage value to, it loads into the game as over 700 attack damage. Any ideas why or is this a bug?

 

ToolMaterialList class

public enum ToolMaterialList implements IItemTier
{
	TUTORIAL(1.7f, 5.0f, 25, 700, 3, ItemList.tutorial_item);
	
	private float attackDamage, efficiency;
	private int enchantability, durability, harvestLevel;
	private Item  repairMaterial;
	
	private ToolMaterialList(float attackDamage, float efficiency, int enchantability, int durability, int harvestLevel, Item repairMaterial)
	{
		this.attackDamage = attackDamage;
		this.efficiency = efficiency;
		this.enchantability = enchantability;
		this.durability = durability;
		this.harvestLevel = harvestLevel;
		this.repairMaterial = repairMaterial;	
	}

	@Override
	public float getAttackDamage() { return this.attackDamage; }

	@Override
	public float getEfficiency() { return this.efficiency; }

	@Override
	public int getEnchantability() { return this.enchantability; }

	@Override
	public int getHarvestLevel() { return this.harvestLevel; }

	@Override
	public int getMaxUses() { return this.durability; }

	@Override
	public Ingredient getRepairMaterial() { return Ingredient.fromItems(repairMaterial); }
}

 

Example of a tool class (they are all the same)

public class ItemTutorialAxe extends ItemAxe
{
	public ItemTutorialAxe(IItemTier tier, Item.Properties properties) 
	{
		super(tier, tier.getMaxUses(), 0, properties);
	}
}

 

  • Quote

Share this post


Link to post
Share on other sites

sunsigne    0

sunsigne

sunsigne    0

  • Tree Puncher
  • sunsigne
  • Members
  • 0
  • 47 posts
Posted February 19, 2019

What is this "TUTORIAL" at the second line ? Souldn't it be "private ToolMaterialList" instead ?

  • Quote

Share this post


Link to post
Share on other sites

Kokkie    55

Kokkie

Kokkie    55

  • Dragon Slayer
  • Kokkie
  • Forge Modder
  • 55
  • 796 posts
Posted February 19, 2019
29 minutes ago, sunsigne said:

What is this "TUTORIAL" at the second line ? Souldn't it be "private ToolMaterialList" instead ?

It's an enum so it's right

  • Quote

Classes: 94

Lines of code: 12173

Other files: 206

Github repo: https://github.com/KokkieBeer/DeGeweldigeMod

Share this post


Link to post
Share on other sites

Jaysondotjson    0

Jaysondotjson

Jaysondotjson    0

  • Tree Puncher
  • Jaysondotjson
  • Members
  • 0
  • 2 posts
Posted March 1, 2019

Seems like a Forge bug.

Durability seems to be the Attack damage. 
 

TUTORIAL(1.7f, 5.0f, 25, Attack Damage / not durability at Tools, 3, ItemList.tutorial_item);

To overrun this go to your Registry / properties and add:
 

defaultMaxDamage(700)

 

  • Quote

Share this post


Link to post
Share on other sites

TrazorMC    1

TrazorMC

TrazorMC    1

  • Tree Puncher
  • TrazorMC
  • Members
  • 1
  • 16 posts
Posted March 2, 2019 (edited)

The ItemAxe constructor takes attack damage as an argument, not durability. You're passing in the durability, so it always ends up being 700.

Edited March 2, 2019 by TrazorMC
  • 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 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Draco18s
      GUI Documentation

      By Draco18s · Posted 15 minutes ago

      GUIs aren't that difficult. There's dozens of tutorials for them and they haven't really changed all that much in ten years.
    • Xenfo
      Mod Blocker

      By Xenfo · Posted 31 minutes ago

      Any mod blockers that actually work? Please link them if yes.
    • diesieben07
      Tessellator ignores lighting?

      By diesieben07 · Posted 52 minutes ago

      Neither 1.10 now 1.14 are supported here. Please refer to the supported versions page: https://forums.minecraftforge.net/topic/91712-supported-version-directory/
    • CookieLukas
      Tessellator ignores lighting?

      By CookieLukas · Posted 53 minutes ago

      Oh,  sorry, the code was 1.10.2, but as its not allowed here, I updated it to 1.14.4.
    • diesieben07
      Forge isn't working on Minecraft Realms

      By diesieben07 · Posted 54 minutes ago

      1.8 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
  • Topics

    • T1ps
      3
      GUI Documentation

      By T1ps
      Started Tuesday at 10:14 PM

    • Xenfo
      0
      Mod Blocker

      By Xenfo
      Started 31 minutes ago

    • CookieLukas
      3
      Tessellator ignores lighting?

      By CookieLukas
      Started 1 hour ago

    • Extrodonary
      1
      Forge isn't working on Minecraft Realms

      By Extrodonary
      Started 1 hour ago

    • Liahim
      0
      [1.16.4-1.16.5] Seed for Biome Provider and Chunk Generator

      By Liahim
      Started 1 hour ago

  • Who's Online (See full list)

    • philip-elsner@gmx.net
    • Beethoven92
    • Mango106
    • Luis_ST
    • Liahim
    • diesieben07
    • Mounty
    • Tiro
    • jrein03
    • Draco18s
    • larsgerrits
    • RpxdYTX
    • Heinzchen
    • bananapizzuh
    • ozumman
    • Xenfo
    • EmilyW524
    • 1321313dfddksjdlsdw
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.13.2] Tool attack damage broken?
  • Theme

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