Jump to content

Recommended Posts

Posted

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);
	}
}

 

  • 2 weeks later...
Posted

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)

 

Posted (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 by TrazorMC

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.